登录

现实笑死人 2019-06-03 11:49:00
package test; import java.awt.*; import javax.swing.*; public class demo extends JFrame{ private JButton jb1, jb2; private JPanel jp1, jp2, jp3; private JLabel jl1, jl2; private JTextField jtf1, jtf2; //private JPasswordField jtf2; public static void main(String[] args){ demo demo1 = new demo(); } //构造函数 public demo(){ jb1 = new JButton("登录"); jb2 = new JButton("取消"); jp1 = new JPanel(new FlowLayout()); jp2 = new JPanel(new FlowLayout()); jp3 = new JPanel(new FlowLayout()); jl1 = new JLabel("用户名"); jl2 = new JLabel("密 码"); jtf1 = new JTextField(10); jtf2 = new JPasswordField(10); jp1.add(jl1); jp1.add(jtf1); jp2.add(jl2); jp2.add(jtf2); jp3.add(jb1); jp3.add(jb2); this.setLayout(new GridLayout(3, 1)); this.add(jp1); this.add(jp2); this.add(jp3); this.setTitle("你好啊!"); this.setSize(260, 150); this.setLocation(300, 200); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setResizable(false); this.setVisible(true); } }
...全文
51 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

51,409

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧