votako

hmmm

Feb 28th, 2013
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.08 KB | None | 0 0
  1. import javax.swing.*;
  2. import java.awt.*;
  3.  
  4. public class Board {
  5.     JButton buttonWhite;
  6.     JButton buttonBlack;
  7.     JPanel board;
  8.     JPanel x1; JPanel x2; JPanel x3; JPanel x4; JPanel x5;JPanel x6; JPanel x7; JPanel x8;
  9.     Board(){
  10.         board = new JPanel();
  11.         BorderLayout bl = new BorderLayout();
  12.         board.setLayout(bl);
  13.  
  14.         buttonBlack = new JButton("1");
  15.         buttonWhite = new JButton("0");
  16.  
  17.         x1 = new JPanel();
  18.         GridLayout gl = new GridLayout(8,1);
  19.         x1.setLayout(gl);
  20.  
  21.         x1.add(buttonBlack);
  22.         x1.add(buttonWhite);
  23.  
  24.         x1.add(buttonBlack);
  25.         x1.add(buttonWhite);
  26.  
  27.         x1.add(buttonBlack);
  28.         x1.add(buttonWhite);
  29.  
  30.         x1.add(buttonBlack);
  31.         x1.add(buttonWhite);
  32.  
  33.  
  34.         x2 = new JPanel();
  35.         GridLayout gl2 = new GridLayout(8,1);
  36.  
  37.         board.add("East", x1);
  38.         board.add("West", x2);
  39.  
  40.  
  41.         JFrame frame = new JFrame("Chess");
  42.         frame.setContentPane(board);
  43.  
  44.         frame.pack();
  45.  
  46.         frame.setVisible(true);
  47.          
  48.     }
  49.     public static void main(String[] args) {
  50.         Board b = new Board();
  51.     }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment