java 登陆窗口的实现
来源:互联网 发布:mac os恢复模式 编辑:程序博客网 时间:2024/06/05 13:30
import javax.swing.*;/** * Created by Administrator on 2015/4/13 0013. * <p> * 组件的绝对定位 : 使用的是 Compontent 类中的setBounds 方法 * <p> * <p> * setBounds x y 表示组件的位置 width height 组件的宽高 */public class chap15_10 { public static void main(String[] args) { JFrame frame = new JFrame("登陆窗口"); frame.setLayout(null); JLabel lbLogin = new JLabel("用户名"); JTextField textLogin = new JTextField(); JLabel lbPassword = new JLabel("密码"); JTextField textPassword = new JTextField(); JButton btnCon = new JButton("连接"); JButton btnExit = new JButton("退出"); JButton btnPro = new JButton("属性"); //容器的大小位置定义 frame.setSize(400, 200); frame.setLocation(300, 200); //用户名 和输入框 的定位 lbLogin.setBounds(45,5,50,20); textLogin.setBounds(100, 5, 210, 20); lbPassword.setBounds(45, 35, 50, 20); textPassword.setBounds(100, 35, 210, 20); btnCon.setBounds(45, 100, 80, 20); btnExit.setBounds(130, 100, 80, 20); btnPro.setBounds(220, 100, 80, 20); frame.add(lbLogin); frame.add(textLogin); frame.add(lbPassword); frame.add(textPassword); frame.add(btnCon); frame.add(btnExit); frame.add(btnPro); frame.setVisible(true); }}
实现的效果图为:
本文出自 “会搬砖的猴子” 博客,请务必保留此出处http://silianbo.blog.51cto.com/6627757/1632018
阅读全文
0 0
- java 登陆窗口的实现
- 登陆窗口的实现
- 用JAVA实现一个简单的登陆窗口
- Java写的登陆窗口
- BCB中登陆窗口的实现
- 登陆窗口实现dojo
- Wpf 实现登陆窗口
- java中在Ext环境中实现带验证码的登陆窗口
- JAVA----登陆窗口
- java窗口登陆
- java用户登陆窗口
- java实现的登陆界面
- 简单的登陆窗口
- 登陆窗口的建立
- openLaszlo简单登陆窗口实现
- Qt学习记录3——登陆窗口的实现
- 响应式网页设计--登陆窗口布局的实现
- MFC编程-登陆窗口和背景的实现
- php-5
- VMware无法启动虚拟机的解决办法
- fiddle ip的显示
- spring 架构的优缺点
- 微信接入
- java 登陆窗口的实现
- 记录web历程
- java 学习笔记---布局管理组件
- PHP处理textarea上传的数据
- lintcode python代码 463 整数排序
- JFrame 和JPanel 的关系-区别(学习笔记)
- BAT,网易,新浪等互联网公司的业务架构及系统架构案例
- 登陆窗口实现(二)-----使用JPanel
- context-param和init-param区别