Skip to content

Instantly share code, notes, and snippets.

@sedran
Created March 25, 2020 19:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sedran/36f8c5eb7f97c45bff02122efc9c8b8f to your computer and use it in GitHub Desktop.
Save sedran/36f8c5eb7f97c45bff02122efc9c8b8f to your computer and use it in GitHub Desktop.
/**
* Pencere.java
* for AltAlta.java, click the link below:
* http://pastebin.com/FqtaG6bC
* Serdar KUZUCU - http://serdarkuzucu.com
*/
package sedran.layoutManagers;
import java.awt.Dimension;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
public class Pencere extends JFrame {
private static final long serialVersionUID = 1L;
public static void main(String args[]) {
new Pencere();
}
public Pencere() {
super("LayoutManager Test");
setDefaultCloseOperation(EXIT_ON_CLOSE);
getContentPane().setLayout(new AltAlta());
for(int i=0; i<5; i++) {
add(new JButton("Buton " + i));
add(new JTextField("Alan " + i));
JLabel label = new JLabel("Etiket 1");
label.setPreferredSize(new Dimension(200, 30));
add(label);
}
pack();
setLocationRelativeTo(null);
setVisible(true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment