Skip to content

Instantly share code, notes, and snippets.

@SametSahin10
Created March 1, 2019 15:42
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 SametSahin10/8c2883678012e3cb24a4161e0a89d0bd to your computer and use it in GitHub Desktop.
Save SametSahin10/8c2883678012e3cb24a4161e0a89d0bd to your computer and use it in GitHub Desktop.
public class JavaApplication105 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
JFrame frame = new JFrame("Example");
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(800, 600);
frame.setLocationRelativeTo(null);
JPanel panel = new JPanel();
panel.setLayout(new GridLayout(3, 3));
panel.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
JLabel label1 = new JLabel();
JLabel label2 = new JLabel();
JLabel label3 = new JLabel();
JLabel label4 = new JLabel();
JLabel label5 = new JLabel();
JLabel label6 = new JLabel();
JLabel label7 = new JLabel();
JLabel label8 = new JLabel();
JLabel label9 = new JLabel();
panel.add(label1);
panel.add(label2);
panel.add(label3);
panel.add(label4);
panel.add(label5);
panel.add(label6);
panel.add(label7);
panel.add(label8);
panel.add(label9);
frame.add(panel);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment