📄 loginpanel.java
字号:
/* * LoginPanel.java * * Created on 2004年1月11日, 下午7:36 */package romulus.UI;/** * * @author S */public class LoginPanel extends javax.swing.JPanel { /** Creates new form LoginPanel */ public LoginPanel() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ private void initComponents() {//GEN-BEGIN:initComponents UserNameLabel = new javax.swing.JLabel(); UserNameTextField = new javax.swing.JTextField(); PasswordLabel = new javax.swing.JLabel(); PasswordField = new javax.swing.JPasswordField(); TestLabel = new javax.swing.JLabel(); CommitButton = new javax.swing.JButton(); ExitButton = new javax.swing.JButton(); TestTextField = new javax.swing.JTextField(); setLayout(new java.awt.GridBagLayout()); java.awt.GridBagConstraints gridBagConstraints1; setBorder(new javax.swing.border.TitledBorder(null, "\u767b\u5f55", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, getFont())); setToolTipText("LoginPanel"); setFont(getFont()); setName(""); UserNameLabel.setFont(getFont()); UserNameLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); UserNameLabel.setText("\u7528\u6237\u540d\uff1a"); gridBagConstraints1 = new java.awt.GridBagConstraints(); gridBagConstraints1.gridx = 0; gridBagConstraints1.gridy = 0; gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints1.weightx = 1.0; gridBagConstraints1.weighty = 1.0; add(UserNameLabel, gridBagConstraints1); UserNameTextField.setFont(getFont()); gridBagConstraints1 = new java.awt.GridBagConstraints(); gridBagConstraints1.gridx = 1; gridBagConstraints1.gridy = 0; gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints1.weightx = 1.0; gridBagConstraints1.weighty = 1.0; add(UserNameTextField, gridBagConstraints1); PasswordLabel.setFont(getFont()); PasswordLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); PasswordLabel.setText("\u5bc6\u7801\uff1a"); gridBagConstraints1 = new java.awt.GridBagConstraints(); gridBagConstraints1.gridx = 0; gridBagConstraints1.gridy = 1; gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints1.weightx = 1.0; gridBagConstraints1.weighty = 1.0; add(PasswordLabel, gridBagConstraints1); PasswordField.setFont(getFont()); gridBagConstraints1 = new java.awt.GridBagConstraints(); gridBagConstraints1.gridx = 1; gridBagConstraints1.gridy = 1; gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints1.weightx = 1.0; gridBagConstraints1.weighty = 1.0; add(PasswordField, gridBagConstraints1); TestLabel.setFont(getFont()); TestLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); TestLabel.setText("\u8003\u8bd5\u9879\u76ee\uff1a"); gridBagConstraints1 = new java.awt.GridBagConstraints(); gridBagConstraints1.gridx = 0; gridBagConstraints1.gridy = 2; gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints1.weightx = 1.0; gridBagConstraints1.weighty = 1.0; add(TestLabel, gridBagConstraints1); CommitButton.setFont(getFont()); CommitButton.setText("\u63d0\u4ea4"); CommitButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { CommitButtonActionPerformed(evt); } }); gridBagConstraints1 = new java.awt.GridBagConstraints(); gridBagConstraints1.gridx = 0; gridBagConstraints1.gridy = 3; gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints1.weightx = 1.0; gridBagConstraints1.weighty = 1.0; add(CommitButton, gridBagConstraints1); ExitButton.setFont(getFont()); ExitButton.setText("\u9000\u51fa"); ExitButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ExitButtonActionPerformed(evt); } }); gridBagConstraints1 = new java.awt.GridBagConstraints(); gridBagConstraints1.gridx = 1; gridBagConstraints1.gridy = 3; gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints1.weightx = 1.0; gridBagConstraints1.weighty = 1.0; add(ExitButton, gridBagConstraints1); TestTextField.setFont(getFont()); gridBagConstraints1 = new java.awt.GridBagConstraints(); gridBagConstraints1.gridx = 1; gridBagConstraints1.gridy = 2; gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints1.weightx = 1.0; gridBagConstraints1.weighty = 1.0; add(TestTextField, gridBagConstraints1); }//GEN-END:initComponents private void ExitButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ExitButtonActionPerformed firePropertyChange(PropName, "", Prop_Exit); }//GEN-LAST:event_ExitButtonActionPerformed private void CommitButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CommitButtonActionPerformed String commitinfo = UserNameTextField.getText() +"|" +new String(PasswordField.getPassword()) +"|" +TestTextField.getText(); firePropertyChange(PropName, "", commitinfo); }//GEN-LAST:event_CommitButtonActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel UserNameLabel; private javax.swing.JTextField UserNameTextField; private javax.swing.JLabel PasswordLabel; private javax.swing.JPasswordField PasswordField; private javax.swing.JLabel TestLabel; private javax.swing.JButton CommitButton; private javax.swing.JButton ExitButton; private javax.swing.JTextField TestTextField; // End of variables declaration//GEN-END:variables public static String PropName = "LoginPanel"; public static String Prop_Exit = "Exit";}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -