Browse Source

only for demo use

remotes/origin/develop
fdai6499 2 years ago
parent
commit
6ba3893133
  1. 43
      sudokuExample/src/Main2.java

43
sudokuExample/src/Main2.java

@ -0,0 +1,43 @@
import javax.swing.*;
import javax.swing.border.EmptyBorder;
public class Main2 {
public static void main(String[] args) {
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
JFrame jFrame = new JFrame();
jFrame.setVisible(true);
jFrame.setBounds(300, 300, 500, 500);
JPanel yPanel = new JPanel();
yPanel.setLayout(new BoxLayout(yPanel, BoxLayout.Y_AXIS));
yPanel.setBorder(new EmptyBorder(1, 0, 1,0));
for (int i = 0; i < 9; i++) {
JPanel xPanel = new JPanel();
xPanel.setLayout(new BoxLayout(xPanel, BoxLayout.X_AXIS));
xPanel.setBorder(new EmptyBorder(0, 1, 0,1));
for (int j = 0; j < 9; j++) {
JTextField jTextField = new JTextField();
jTextField.setColumns(1);
jTextField.setBounds(0, 0, 10, 10);
xPanel.add(jTextField);
}
yPanel.add(xPanel);
}
jFrame.setContentPane(yPanel);
}
});
}
}
Loading…
Cancel
Save