Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.*;
- import java.awt.*;
- public class ConnectFour extends JApplet
- {
- public void init()
- {
- setLayout(new BorderLayout());
- add(new JLabel("Connect 4"), BorderLayout.NORTH);
- JPanel pane = new JPanel();
- pane.setLayout(new GridLayout(9,7,10,10));
- IconPanel icons[][] = new IconPanel[7][6];
- JButton button[] = new JButton[6];
- for(int i = 0;i<8;i++)
- {
- for(int j =0;j<7;j++)
- {
- icons[i][j] = new IconPanel();
- pane.add(icons[i][j]);
- }
- }
- for(int i = 0;i<7;i++)
- {
- button[i] = new JButton();
- pane.add(button[i]);
- }
- }
- public static void main(String [] args)
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement