import java.awt.FlowLayout;
import javax.swing.*;
public class MyFlowLayout extends JFrame{
public MyFlowLayout() {
setLayout(new FlowLayout());
add(new JButton ("Button 1"));
add(new JButton ("Button 2"));
add(new JButton ("Button 3"));
add(new JButton ("Button 4"));
add(new JButton ("Button 5"));
setTitle("FlowLayout");
setDefaultCloseOperation(EXIT_ON_CLOSE);
pack();
setVisible(true);
}
public static void main(String args[]){
SwingUtilities.invokeLater(new Runnable(){
public void run(){
new MyFlowLayout();
}
});
}
}
Tidak ada komentar:
Posting Komentar