Browse Source

DTSUD-48

Eingabe Felder von 1 bis 9 incl. ein leeres feld
remotes/origin/develop
fdai7460 2 years ago
parent
commit
bb2304a3af
  1. 35
      sudokuExample/src/Main.java

35
sudokuExample/src/Main.java

@ -3,6 +3,7 @@ import javax.swing.border.EmptyBorder;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.lang.String;
public class Main {
@ -41,6 +42,40 @@ public class Main {
main.setContentPane(rootPanel);
JPanel numberPanel = new JPanel();
numberPanel.setVisible(true);
numberPanel.setBounds(100, 450, 300, 30);
rootPanel.add(numberPanel);
for (int i = 1, j=0; i < 10; i++) {
JLabel numberi= new JLabel();
numberi.setText(""+i);
numberi.setBounds(5+j, 5, 20, 20);
numberPanel.setLayout(null);
JPanel ni = new JPanel();
ni.setBounds(5+j, 5, 20, 20);
ni.setVisible(true);
ni.setBackground(Color.pink);
ni.add(numberi);
numberPanel.add(ni);
j=j+25;
}
JLabel number10= new JLabel();
number10.setText(" ");
number10.setBounds(250, 5, 20, 20);
numberPanel.setLayout(null);
JPanel n10 = new JPanel();
n10.setBounds(250, 5, 20, 20);
n10.setVisible(true);
n10.setBackground(Color.pink);
n10.add(number10);
numberPanel.add(n10);
JButton back = new JButton();
back.setVisible(true);
back.setBounds(5, 5, 100, 25);

Loading…
Cancel
Save