Eclipse Design 翻译下
package com.java.view;
import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JLabel;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.JTextField;
import javax.swing.JPasswordField;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import com.jgoodies.forms.factories.DefaultComponentFactory;
public class LogOnFrm extends JFrame {
private JPanel contentPane;
private JTextField userName;
private JPasswordField password;
/**
* @wbp.nonvisual location=-403,267
*/
private final JLabel label = DefaultComponentFactory.getInstance().createTitle("New JGoodies title");
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
LogOnFrm frame = new LogOnFrm();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public LogOnFrm() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
JLabel label = new JLabel("\u7BA1\u7406\u5458\u767B\u5F55");
JLabel label_1 = new JLabel("");
JLabel lblNewLabel_1 = new JLabel("\u5BC6\u7801");
JLabel lblNewLabel_2 = new JLabel("\u8D26\u53F7");
userName = new JTextField();
userName.setColumns(10);
password = new JPasswordField();
JButton jb_logon = new JButton("\u767B\u5F55");
JButton jb_reset = new JButton("\u91CD\u7F6E");
jb_reset.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
}
});
GroupLayout gl_contentPane = new GroupLayout(contentPane);
gl_contentPane.setHorizontalGroup(
gl_contentPane.createParallelGroup(Alignment.LEADING)
.addGroup(gl_contentPane.createSequentialGroup()
.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
.addGroup(gl_contentPane.createSequentialGroup()
.addGap(78)
.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
.addGroup(gl_contentPane.createSequentialGroup()
.addComponent(lblNewLabel_2)
.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
.addGroup(gl_contentPane.createSequentialGroup()
.addGap(88)
.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
.addComponent(label)
.addComponent(label_1)))
.addGroup(gl_contentPane.createSequentialGroup()
.addGap(18)
.addComponent(userName, GroupLayout.PREFERRED_SIZE, 110, GroupLayout.PREFERRED_SIZE))))
.addGroup(gl_contentPane.createSequentialGroup()
.addComponent(lblNewLabel_1)
.addGap(18)
.addComponent(password, GroupLayout.PREFERRED_SIZE, 121, GroupLayout.PREFERRED_SIZE))))
.addGroup(gl_contentPane.createSequentialGroup()
.addGap(111)
.addComponent(jb_logon)
.addGap(49)
.addComponent(jb_reset)))
.addGap(78))
);
gl_contentPane.setVerticalGroup(
gl_contentPane.createParallelGroup(Alignment.LEADING)
.addGroup(gl_contentPane.createSequentialGroup()
.addContainerGap()
.addComponent(label)
.addGap(43)
.addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING)
.addComponent(label_1)
.addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)
.addComponent(lblNewLabel_2)
.addComponent(userName, GroupLayout.PREFERRED_SIZE, 21, GroupLayout.PREFERRED_SIZE)))
.addGap(57)
.addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)
.addComponent(lblNewLabel_1)
.addComponent(password, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addPreferredGap(ComponentPlacement.RELATED, 36, Short.MAX_VALUE)
.addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)
.addComponent(jb_logon)
.addComponent(jb_reset))
.addGap(26))
);
contentPane.setLayout(gl_contentPane);
}
}