Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. import javax.swing.*;
  2. import java.awt.*;
  3.  
  4. public class ConnectFour extends JApplet
  5. {
  6. public void init()
  7. {
  8. setLayout(new BorderLayout());
  9. add(new JLabel("Connect 4"), BorderLayout.NORTH);
  10. JPanel pane = new JPanel();
  11. pane.setLayout(new GridLayout(9,7,10,10));
  12. IconPanel icons[][] = new IconPanel[7][6];
  13. JButton button[] = new JButton[6];
  14. for(int i = 0;i<8;i++)
  15. {
  16. for(int j =0;j<7;j++)
  17. {
  18. icons[i][j] = new IconPanel();
  19. pane.add(icons[i][j]);
  20. }
  21. }
  22. for(int i = 0;i<7;i++)
  23. {
  24. button[i] = new JButton();
  25. pane.add(button[i]);
  26. }
  27.  
  28. }
  29.  
  30. public static void main(String [] args)
  31. {
  32.  
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement