java窗口登陆
2014-11-25 17:13
204 查看
import javax.swing.*; import java.awt.*; import java.util.Random; public class Windows { /** * @param args */ public static void main(String[] args) { // TODO 自动生成的方法存根 Random ra=new Random(); int num=ra.nextInt(1000)+1000; JFrame window1=new JFrame("用户登录"); Container con=window1.getContentPane(); con.setBackground(Color.red); window1.setBounds(60,100,400,300); window1.setLayout(null); JLabel l1=new JLabel("用户名"); JLabel l2=new JLabel("密码"); JLabel l3=new JLabel("验证码"); JLabel l4=new JLabel(Integer.toString(num)); JPasswordField j=new JPasswordField(10); JTextField j1=new JTextField(10); JTextField j2=new JTextField(10); JButton b1=new JButton("确定"); JButton b2=new JButton("重置"); JButton b3=new JButton("取消"); window1.setVisible(true); window1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); window1.add(l1); l1.setBounds(30,30,50,50); window1.add(j1); j1.setBounds(100,46,100,20); window1.add(l2); l2.setBounds(30,60,100,100); window1.add(j); j.setBounds(100,96,100,20); window1.add(l3); l3.setBounds(30,140,50,50); window1.add(j2); j2.setBounds(100,148,100,20); window1.add(l4); l4.setBounds(222,119,100,100); window1.add(b1); b1.setBounds(30,200,100,30); window1.add(b2); b2.setBounds(130,200,100,30); window1.add(b3); b3.setBounds(230,200,100,30); } }
相关文章推荐
- java中在Ext环境中实现带验证码的登陆窗口
- JAVA----登陆窗口
- Extjs 带验证码的登陆窗口,java版
- java 登陆窗口的实现
- //设计登陆窗口界面,当输入账号密码正确时,界面如图一所示,当输入账号密码有误时,界面如图二所示。 import java.awt.*; import java.awt.event.*; import
- //设计登陆窗口界面,当输入账号密码正确时,界面如图一所示,当输入账号密码有误时,界面如图二所示。 import java.awt.*; import java.awt.event.*; import
- java在线聊天项目 客户端登陆窗口LoginDialog的注册用户功能 修改注册逻辑 增空用户名密码的反馈 增加showMessageDialog()提示框
- Java写的登陆窗口
- java 登陆窗口的实现
- 设计登陆窗口界面,当输入账号密码正确时,界面如图一所示,当输入账号密码有误时,界面如图二所示。 import java.awt.*; import java.awt.event.*; import
- 设计登陆窗口界面,当输入账号密码正确时,界面如图一所示,当输入账号密码有误时,界面如图二所示。 import java.awt.*; import java.awt.event.*; import
- java制作登陆窗口示例
- java在线聊天项目 客户端登陆窗口LoginDialog的注册用户功能
- 用JAVA实现一个简单的登陆窗口
- 用java制作简单登陆窗口,求大神教导
- //设计登陆窗口界面,当输入账号密码正确时,界面如图一所示,当输入账号密码有误时,界面如图二所示。 import java.awt.*; import java.awt.event.*; import
- 设计登陆窗口界面,当输入账号密码正确时,界面如图一所示,当输入账号密码有误时,界面如图二所示。 import java.awt.*; import java.awt.event.*; import
- 在应用程序中使用启动屏幕和登陆窗口
- 关于java窗口关闭的疑问
- 显示主窗体前显示登陆窗口的完美解决方案