简单窗口的代码实现:
package boke1;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
public class three extends JFrame{
public three() {
this.setTitle("用户登录");
this.setLayout(null);
this.setBounds(100, 100,500, 500);
JLabel jbl= new JLabel("账号");
this.add(jbl);
jbl.setBounds(50, 50, 20, 30);
JTextField jt=new JTextField();
this.add(jt);
jt.setBounds(50, 50, 200, 30);
this.setVisible(true);
}
}
输出窗口
package boke1;
public class threeText {
public static void main(String[] args) {
// TODO Auto-generated method stub
// System.out.println("123");
three three = new three();
}
}