panel button
This commit is contained in:
parent
bd9d70383d
commit
7af2cf0739
@ -6,16 +6,18 @@ import java.awt.*;
|
|||||||
public class GameGui {
|
public class GameGui {
|
||||||
public static final int width= 500, height =650;
|
public static final int width= 500, height =650;
|
||||||
private Board board;
|
private Board board;
|
||||||
|
private Board board2;
|
||||||
private JFrame frame;
|
private JFrame frame;
|
||||||
|
|
||||||
public GameGui(){
|
public GameGui(){
|
||||||
frame = new JFrame("Tetris");
|
frame = new JFrame("Tetris");
|
||||||
|
|
||||||
JPanel panel = new JPanel();
|
JPanel panel = new JPanel();
|
||||||
panel.setBorder(BorderFactory.createEmptyBorder(450, 30, 100, 30));
|
panel.setBorder(BorderFactory.createMatteBorder(450, 50, 50, 50,Color.black));
|
||||||
JButton button1 = new JButton("Start");
|
JButton button1 = new JButton("Start");
|
||||||
JButton button2 = new JButton("Pause");
|
JButton button2 = new JButton("Pause");
|
||||||
|
|
||||||
|
|
||||||
panel.setLayout(new GridLayout(0,1));
|
panel.setLayout(new GridLayout(0,1));
|
||||||
panel.setBackground(Color.DARK_GRAY);
|
panel.setBackground(Color.DARK_GRAY);
|
||||||
panel.add(button1);
|
panel.add(button1);
|
||||||
@ -39,6 +41,8 @@ public class GameGui {
|
|||||||
frame.setVisible(true);
|
frame.setVisible(true);
|
||||||
board = new Board();
|
board = new Board();
|
||||||
frame.add(board,BorderLayout.CENTER);
|
frame.add(board,BorderLayout.CENTER);
|
||||||
|
board2 = new Board();
|
||||||
|
frame.add(board2,BorderLayout.EAST);
|
||||||
}
|
}
|
||||||
public static void main(String [] args)
|
public static void main(String [] args)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user