窗口
package v01;
import java.awt.BorderLayout;
import java.awt.GridLayout;
import javax.swing.*;
import layout.SpringUtilities;
public class DataFormm {
static JTextField textField ;
JFrame frame;
JPanel p1;
JPanel p2;
JLabel labels;
final static String LOOKANDFEEL = null;
public DataFormm() {
addWidgets();
}
private void addWidgets() {
p1.add(textField);
p2.add(textField);
frame.getContentPane().add(p1, BorderLayout.WEST);
frame.getContentPane().add(p2, BorderLayout.EAST);
textField.setHorizontalAlignment(JTextField.LEFT);
}
private static void createAndShowGUI() {
String[] labels = {"基本情况","姓名 ", "性别", "城市 ","联系方式","Email ","手机","通信地址"};
int numPairs = labels.length;
JFrame.setDefaultLookAndFeelDecorated(true);
JFrame frame = new JFrame("注册表信息");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
}
public static void main(String[] args) {
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
}
});
}
}