login.java~6~
来自「rmi的例子和制作的录像」· JAVA~6~ 代码 · 共 53 行
JAVA~6~
53 行
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(280,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 + =
减小字号Ctrl + -
显示快捷键?