|
@ -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); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
} |