Browse Source

Merge remote-tracking branch 'origin/develop' into develop

remotes/origin/develop
fdai6499 2 years ago
parent
commit
5f7f8d0829
  1. 49
      sudokuExample/src/Main.java

49
sudokuExample/src/Main.java

@ -3,6 +3,7 @@ import javax.swing.border.EmptyBorder;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.lang.String;
public class Main { public class Main {
@ -26,7 +27,7 @@ public class Main {
JFrame main = new JFrame(); JFrame main = new JFrame();
main.setLayout(null); main.setLayout(null);
main.setVisible(true); main.setVisible(true);
main.setBounds(300, 200, 500, 500);
main.setBounds(300, 200, 500, 600);
main.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); main.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel rootPanel = new JPanel(); JPanel rootPanel = new JPanel();
@ -41,6 +42,40 @@ public class Main {
main.setContentPane(rootPanel); 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(); JButton back = new JButton();
back.setVisible(true); back.setVisible(true);
back.setBounds(5, 5, 100, 25); back.setBounds(5, 5, 100, 25);
@ -53,6 +88,18 @@ public class Main {
newButton.setText("New"); newButton.setText("New");
rootPanel.add(newButton); rootPanel.add(newButton);
JButton retryButton = new JButton();
retryButton.setVisible(true);
retryButton.setText("Retry");
retryButton.setBounds(5, 525, 100, 25);
rootPanel.add(retryButton);
JButton correctButton = new JButton();
correctButton.setVisible(true);
correctButton.setText("Correct");
correctButton.setBounds(395, 525, 100, 25);
rootPanel.add(correctButton);
} }
}); });
} }

Loading…
Cancel
Save