import java.applet.Applet; import java.awt.event.*; import java.awt.*; import java.awt.geom.*; public class test1 extends Applet { GridBagLayout game; GridBagConstraints c; PlayingBoard B1,B2; ViewCanvas B3,B4; Canvas B12; ButtonCanvas BC; TextCanvas B5; Panel P1,P2,P12; Color BACK=Color.black; int SIZE; public void init() { game=new GridBagLayout(); c=new GridBagConstraints(); c.gridwidth=GridBagConstraints.REMAINDER; setLayout(game); setBackground(Color.black); /*****************/ /*****************/ SIZE=440; /*****************/ /*****************/ P1=new Panel(); P2=new Panel(); B1=new PlayingBoard(SIZE,1); B2=new PlayingBoard(SIZE,2); B12=new Canvas(); B3=new ViewCanvas(SIZE,B1); B5=new TextCanvas(SIZE); B4=new ViewCanvas(SIZE,B2); BC=new ButtonCanvas(SIZE,B1,B2,B3,B4,B5); B1.setSize(SIZE,SIZE); B2.setSize(SIZE,SIZE); B3.setSize((int)(SIZE/2),(int)(SIZE/2)); B5.setSize(100+SIZE,(int)(SIZE/2)); B4.setSize((int)(SIZE/2),(int)(SIZE/2)); B12.setSize(1,SIZE); BC.setSize(100,SIZE); B12.setBackground(Color.blue); B1.setBackground(BACK); B2.setBackground(BACK); B1.setBackground(BACK); B2.setBackground(BACK); B3.setBackground(BACK); B5.setBackground(new Color(0,0,100)); B4.setBackground(BACK); P1.setBackground(Color.blue); P2.setBackground(Color.blue); BC.setBackground(new Color(0,0,100)); B1=B1.addControl(B2); B2=B2.addControl(B1); B1=B1.addRecord(B3); B2=B2.addRecord(B4); P1.add(B1); P1.add(BC); P1.add(B2); P2.add(B3); P2.add(B5); P2.add(B4); c.ipady=-5; game.setConstraints(P1,c); c.ipady=0; game.setConstraints(P2,c); add(P1); add(P2); } }