Advertisement
sedran

Java LayoutManager - Pencere.java

Feb 1st, 2012
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.91 KB | None | 0 0
  1. /**
  2.  * Pencere.java
  3.  * for AltAlta.java, click the link below:
  4.  * http://pastebin.com/FqtaG6bC
  5.  * Serdar KUZUCU - http://blog.asosyalbebe.com
  6.  */
  7. package sedran.layoutManagers;
  8.  
  9. import java.awt.Dimension;
  10.  
  11. import javax.swing.JButton;
  12. import javax.swing.JFrame;
  13. import javax.swing.JLabel;
  14. import javax.swing.JTextField;
  15.  
  16. public class Pencere extends JFrame {
  17.     private static final long serialVersionUID = 1L;
  18.  
  19.     public static void main(String args[]) {
  20.         new Pencere();
  21.     }
  22.    
  23.     public Pencere() {
  24.         super("LayoutManager Test");
  25.         setDefaultCloseOperation(EXIT_ON_CLOSE);
  26.         getContentPane().setLayout(new AltAlta());
  27.         for(int i=0; i<5; i++) {
  28.             add(new JButton("Buton " + i));
  29.             add(new JTextField("Alan " + i));
  30.             JLabel label = new JLabel("Etiket 1");
  31.             label.setPreferredSize(new Dimension(200, 30));
  32.             add(label);
  33.         }
  34.         pack();
  35.         setLocationRelativeTo(null);
  36.         setVisible(true);
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement