📄 frame1.java~2~
字号:
package sfms;import java.awt.*;import java.awt.event.*;import javax.swing.*;import com.borland.jbcl.layout.*;public class Frame1 extends JFrame { JPanel contentPane; XYLayout xYLayout1 = new XYLayout(); JLabel jLabel1 = new JLabel(); JLabel jLabel2 = new JLabel(); JTextField jTextField1 = new JTextField(); JTextField jTextField2 = new JTextField(); JButton jButton1 = new JButton(); JButton jButton2 = new JButton(); JLabel jLabel3 = new JLabel(); //Construct the frame public Frame1() { enableEvents(AWTEvent.WINDOW_EVENT_MASK); try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } //Component initialization private void jbInit() throws Exception { contentPane = (JPanel) this.getContentPane(); jLabel1.setFont(new java.awt.Font("Dialog", 1, 16)); jLabel1.setForeground(Color.blue); jLabel1.setText("用户名"); contentPane.setLayout(xYLayout1); this.setSize(new Dimension(400, 300)); this.setTitle("Frame Title"); jLabel2.setFont(new java.awt.Font("Dialog", 1, 16)); jLabel2.setForeground(Color.blue); jLabel2.setHorizontalAlignment(SwingConstants.LEADING); jLabel2.setText("密码"); contentPane.setBackground(new Color(118, 255, 144)); contentPane.setForeground(new Color(0, 0, 203)); jButton1.setFont(new java.awt.Font("Dialog", 1, 16)); jButton1.setForeground(Color.blue); jButton1.setText("提交"); jButton2.setFont(new java.awt.Font("Dialog", 1, 16)); jButton2.setForeground(Color.blue); jButton2.setText("取消"); jTextField1.setText(""); jTextField2.setText(""); jLabel3.setFont(new java.awt.Font("Dialog", 1, 18)); jLabel3.setForeground(new Color(184, 0, 144)); jLabel3.setHorizontalAlignment(SwingConstants.CENTER); jLabel3.setHorizontalTextPosition(SwingConstants.CENTER); jLabel3.setText("欢迎您进入资料档案管理系统"); jLabel4.setText(""); contentPane.add(jButton1, new XYConstraints(64, 204, 79, 29)); contentPane.add(jButton2, new XYConstraints(237, 204, 79, 29)); contentPane.add(jLabel3, new XYConstraints(20, 9, 368, 39)); contentPane.add(jTextField1, new XYConstraints(161, 85, 128, 27)); contentPane.add(jLabel1, new XYConstraints(70, 85, 57, 32)); contentPane.add(jLabel2, new XYConstraints(70, 148, 57, 32)); contentPane.add(jTextField2, new XYConstraints(161, 148, 128, 27)); } //Overridden so we can exit when window is closed protected void processWindowEvent(WindowEvent e) { super.processWindowEvent(e); if (e.getID() == WindowEvent.WINDOW_CLOSING) { System.exit(0); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -