Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.samkough.main;
- import javax.swing.*;
- import java.awt.*;
- import java.awt.event.*;
- @SuppressWarnings("serial")
- public class Win extends JFrame
- {
- private static final int WIDTH = 600;
- private static final int HEIGHT = 600;
- JButton b1, b2, b3;
- JLabel l1, l2, l3;
- public Win()
- {
- // first is rows, then columns
- setLayout(new GridLayout(2, 3));
- b1 = new JButton("1");
- b2 = new JButton("2");
- b3 = new JButton("3");
- l1 = new JLabel("1");
- l2 = new JLabel("2");
- l3 = new JLabel("3");
- add(b1);
- add(b2);
- add(b3);
- add(l1);
- add(l2);
- add(l3);
- }
- public static void main(String args[])
- {
- Win frame = new Win();
- frame.setVisible(true);
- frame.setSize(WIDTH, HEIGHT);
- frame.setTitle("Tutorial #10");
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame.setLocationRelativeTo(null);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement