📄 uidesignerdemo.java
字号:
package chapter6.uidesigner;
import javax.swing.*;
import com.borland.jbcl.layout.XYLayout;
import com.borland.jbcl.layout.*;
import java.awt.Font;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class UIDesignerDemo extends JFrame{
public UIDesignerDemo() {
try {
jbInit();
} catch (Exception ex) {
ex.printStackTrace();
}
}
private void jbInit() throws Exception {
this.getContentPane().setLayout(xYLayout1);
jButton1.addActionListener(new UIDesignerDemo_jButton1_actionAdapter(this));
this.getContentPane().add(jPanel1, new XYConstraints(3, 3, 396, 297));
jPanel1.setLayout(xYLayout2);
jLabel2.setFont(new java.awt.Font("宋体", Font.PLAIN, 15));
jLabel2.setText("用户名:");
jLabel3.setFont(new java.awt.Font("宋体", Font.PLAIN, 15));
jLabel3.setText("密码:");
jLabel4.setForeground(Color.red);
jLabel4.setText("XXXX@2000-2010版权所有");
jButton1.setText("确定");
jButton2.setText("取消");
jTextField1.setText("jTextField1");
jPasswordField1.setText("jPasswordField1");
jLabel1.setFont(new java.awt.Font("宋体", Font.BOLD, 30));
jLabel1.setForeground(Color.white);
jPanel1.setBackground(new Color(57, 182, 235));
jPanel1.add(jLabel1, new XYConstraints(66, 16, 233, 44));
jPanel1.add(jTextField1, new XYConstraints(174, 90, 125, 28));
jPanel1.add(jPasswordField1, new XYConstraints(174, 135, 125, 29));
jPanel1.add(jLabel3, new XYConstraints(101, 135, 51, 30));
jPanel1.add(jLabel2, new XYConstraints(86, 92, 73, 26));
jPanel1.add(jButton2, new XYConstraints(174, 195, 75, 27));
jPanel1.add(jButton1, new XYConstraints(84, 195, 65, 27));
jPanel1.add(jLabel4, new XYConstraints(97, 237, 175, 35));
jLabel1.setText("欢迎访问本网站");
}
XYLayout xYLayout1 = new XYLayout();
JPanel jPanel1 = new JPanel();
XYLayout xYLayout2 = new XYLayout();
JLabel jLabel1 = new JLabel();
JLabel jLabel2 = new JLabel();
JLabel jLabel3 = new JLabel();
JLabel jLabel4 = new JLabel();
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();
JTextField jTextField1 = new JTextField();
JPasswordField jPasswordField1 = new JPasswordField();
public void jButton1_actionPerformed(ActionEvent e) {
}
}
class UIDesignerDemo_jButton1_actionAdapter implements ActionListener {
private UIDesignerDemo adaptee;
UIDesignerDemo_jButton1_actionAdapter(UIDesignerDemo adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton1_actionPerformed(e);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -