Java BorderLayout

Posted: September 20, 2014 in Java
Tags:

BorderLayout->Çerçeveyi 5 bölgeye ayırır.Bileşenleri bu bölgelere koymamıza izin verir.

import java.awt.BorderLayout;
import javax.swing.JButton;
import javax.swing.JFrame;

public class x {

public static void main(String[] args) {

BrdrLayout window= new BrdrLayout();
window.setSize(400, 500);
window.setTitle(“hermes”);
window.setLocationRelativeTo(null);
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
window.setVisible(true);

}

}

class BrdrLayout extends JFrame{

public BrdrLayout(){

BorderLayout a = new BorderLayout(40,40);
setLayout(a);
add(new JButton(“bayram”),BorderLayout.WEST);
add(new JButton(“zafer”),BorderLayout.NORTH);
add(new JButton(“cihad”),BorderLayout.EAST);
add(new JButton(“memo”),BorderLayout.CENTER);
add(new JButton(“reci”),BorderLayout.SOUTH);

}

}

13

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s