📄 login.java~5~
字号:
package rmichat;
import java.awt.BorderLayout;
import javax.swing.JFrame;
import javax.swing.JLabel;
import java.awt.Rectangle;
import javax.swing.JTextField;
import javax.swing.JButton;
public class Login extends JFrame {
public Login() {
try {
jbInit();
} catch (Exception exception) {
exception.printStackTrace();
}
}
private void jbInit() throws Exception {
getContentPane().setLayout(null);
jLabel1.setText("用户名:");
jLabel1.setBounds(new Rectangle(28, 33, 59, 28));
txtIP.setText("192.168.4.");
txtIP.setBounds(new Rectangle(86, 78, 104, 22));
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setTitle("聊天室登陆");
jButton1.setBounds(new Rectangle(86, 125, 75, 31));
jButton1.setText("登录");
this.getContentPane().add(jLabel1);
txtName.setBounds(new Rectangle(86, 35, 69, 22));
this.getContentPane().add(jLabel2);
this.getContentPane().add(txtName);
this.getContentPane().add(txtIP);
this.getContentPane().add(jButton1);
jLabel2.setText("IP地址:");
jLabel2.setBounds(new Rectangle(28, 78, 71, 19));
this.setSize(300,200);
this.setResizable(false);
this.setVisible(true);
}
public static void main(String[] args) {
Login login = new Login();
}
JLabel jLabel1 = new JLabel();
JLabel jLabel2 = new JLabel();
JTextField txtName = new JTextField();
JTextField txtIP = new JTextField();
JButton jButton1 = new JButton();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -