|
|
@ -30,76 +30,31 @@ public class MainFrame extends JFrame { |
|
|
|
header.setBounds(125, 5, 250, 50); |
|
|
|
rootPanel.add(header); |
|
|
|
|
|
|
|
|
|
|
|
GameField gameField = new GameField(360); |
|
|
|
gameField.setBounds(70, 50, 360, 360); |
|
|
|
rootPanel.add(gameField); |
|
|
|
|
|
|
|
|
|
|
|
int j = 0; |
|
|
|
double d = 1.0; |
|
|
|
String str = "Hallo"; |
|
|
|
|
|
|
|
JPanel boxPanel = new JPanel(); |
|
|
|
boxPanel.setBounds(100, 450, 300, 30); |
|
|
|
boxPanel.setVisible(true); |
|
|
|
boxPanel.setBackground(Color.GREEN); |
|
|
|
JPanel boxPanel = setupJPanel(); |
|
|
|
boxPanel.setLayout(new BoxLayout(boxPanel, BoxLayout.X_AXIS)); |
|
|
|
rootPanel.add(boxPanel); |
|
|
|
|
|
|
|
JPanel panel1 = new JPanel(); |
|
|
|
panel1.setBackground(Color.BLUE); |
|
|
|
panel1.setVisible(true); |
|
|
|
panel1.setBorder(new LineBorder(Color.PINK, 1)); |
|
|
|
boxPanel.add(panel1); |
|
|
|
boxPanel.add(Box.createHorizontalStrut(5)); |
|
|
|
panel1.addMouseListener(new MouseListener() { |
|
|
|
@Override |
|
|
|
public void mouseClicked(MouseEvent e) { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void mousePressed(MouseEvent e) { |
|
|
|
if (gameField.getActivePanel() != null) { |
|
|
|
gameField.getActivePanel().setValue(1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void mouseReleased(MouseEvent e) { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void mouseEntered(MouseEvent e) { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void mouseExited(MouseEvent e) { |
|
|
|
|
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
JLabel numLabel1 = new JLabel(); |
|
|
|
numLabel1.setText("1"); |
|
|
|
numLabel1.setLayout(null); |
|
|
|
numLabel1.setVisible(true); |
|
|
|
panel1.add(numLabel1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JPanel panel2 = new JPanel(); |
|
|
|
panel2.setBackground(Color.BLUE); |
|
|
|
panel2.setVisible(true); |
|
|
|
panel2.setBorder(new LineBorder(Color.PINK, 1)); |
|
|
|
boxPanel.add(panel2); |
|
|
|
boxPanel.add(Box.createHorizontalStrut(5)); |
|
|
|
|
|
|
|
JLabel numLabel2 = new JLabel(); |
|
|
|
numLabel2.setText("2"); |
|
|
|
numLabel2.setLayout(null); |
|
|
|
numLabel2.setVisible(true); |
|
|
|
panel2.add(numLabel2); |
|
|
|
// JPanel panel2 = new JPanel(); |
|
|
|
// panel2.setBackground(Color.BLUE); |
|
|
|
// panel2.setVisible(true); |
|
|
|
// panel2.setBorder(new LineBorder(Color.PINK, 1)); |
|
|
|
// boxPanel.add(panel2); |
|
|
|
// boxPanel.add(Box.createHorizontalStrut(5)); |
|
|
|
// |
|
|
|
// JLabel numLabel2 = new JLabel(); |
|
|
|
// numLabel2.setText("2"); |
|
|
|
// numLabel2.setLayout(null); |
|
|
|
// numLabel2.setVisible(true); |
|
|
|
// panel2.add(numLabel2); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -129,6 +84,16 @@ public class MainFrame extends JFrame { |
|
|
|
rootPanel.add(correctButton); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public JPanel setupJPanel() { |
|
|
|
JPanel panel = new JPanel(); |
|
|
|
panel.setBounds(100, 450, 300, 30); |
|
|
|
panel.setVisible(true); |
|
|
|
panel.setBackground(Color.GREEN); |
|
|
|
return panel; |
|
|
|
} |
|
|
|
|
|
|
|
private JPanel setupHeader(int headerSize, int subheaderSize) { |
|
|
|
|
|
|
|
JPanel jPanel = new JPanel(); |
|
|
|