Browse Source

Setup Panel with label nr 1

remotes/origin/develop
fdai7460 2 years ago
parent
commit
56e2808177
  1. 19
      src/main/java/src/MainFrame.java

19
src/main/java/src/MainFrame.java

@ -36,13 +36,14 @@ public class MainFrame extends JFrame {
int j = 0;
double d = 1.0;
String str = "Hallo";
JPanel boxPanel = setupJPanel();
boxPanel.setLayout(new BoxLayout(boxPanel, BoxLayout.X_AXIS));
rootPanel.add(boxPanel);
JPanel jPanel1 = setupJPannel2("1");
boxPanel.add(jPanel1);
JButton back = new JButton();
back.setVisible(true);
back.setBounds(5, 5, 100, 25);
@ -69,6 +70,20 @@ public class MainFrame extends JFrame {
}
private JPanel setupJPannel2(String number) {
JPanel jPanel = new JPanel();
jPanel.setBackground(Color.BLUE);
jPanel.setVisible(true);
jPanel.setBorder(new LineBorder(Color.PINK, 1));
JLabel numLabel1 = new JLabel();
numLabel1.setText(number);
numLabel1.setLayout(null);
numLabel1.setVisible(true);
jPanel.add(numLabel1);
return jPanel;
}
public JPanel setupJPanel() {

Loading…
Cancel
Save