Eclipse生成EXE文件(可视化Login/读取文件)
Java Swing实现文件的简单读取
WindowBuilder的安装与使用
如何采用java设置一个登陆界面
package jp.services.slink2.batch.so2or;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
public class SO2ORLogin extends JFrame implements ActionListener {
private JPanel jp = new JPanel();
private JLabel[] jlArray = { new JLabel("UserID"),
new JLabel("PassWD"), new JLabel("") };
private JButton[] jbArray = { new JButton("Login"),
new JButton("Clear") };
private JTextField jtxtName = new JTextField();
private JPasswordField jtxtPassword = new JPasswordField();
public SO2ORLogin() {
jp.setLayout(null);
for (int i = 0; i < 2; i++) {
jlArray[i].setBounds(30, 20 + i * 50, 80, 26);
jbArray[i].setBounds(50 + i * 110, 130, 80, 26);
jp.add(jlArray[i]);
jp.add(jbArray[i]);
jbArray[i].addActionListener(this);
}
jtxtName.setBounds(80, 20, 180, 30);
jp.add(jtxtName);
jtxtName.addActionListener(this);
jtxtPassword.setBounds(80, 70, 180, 30);
jp.add(jtxtPassword);
jtxtPassword.setEchoChar('*');
jtxtPassword.addActionListener(this);
jlArray[2].setBounds(10, 180, 300, 30);
jp.add(jlArray[2]);
this.add(jp);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setTitle("Login");
this.setResizable(false);
this.setBounds(100, 100, 300, 250);
this.setVisible(true);
}
public void actionPerformed(ActionEvent e) {
if (e.getSource() == jtxtName) {
jtxtPassword.requestFocus();
} else if (e.getSource() == jbArray[1]) {
jlArray[2].setText("");
jtxtName.setText("");
jtxtPassword.setText("");
jtxtName.requestFocus();
} else {
if (jtxtName.getText().equals("xiaoming")
&& String.valueOf(jtxtPassword.getPassword()).equals("123")) {
jlArray[2].setText("Login Secced");
} else {
jlArray[2].setText("Login Fai");
}
}
}
public static void main(String[] args) {
new SO2ORLogin();
}
}
Eclipse生成EXE文件(可视化Login/读取文件)的更多相关文章
- R8—批量生成文件夹,批量读取文件夹名称+R文件管理系统操作函数
一. 批量生成文件夹,批量读取文件夹名称 今日,工作中遇到这样一个问题:boss给我们提供了200多家公司的ID代码(如6007.7920等),需要根据这些ID号去搜索下载新闻,从而将下载到的新闻存到 ...
- python练习六十一:文件处理,读取文件内容
python练习六十一:文件处理,读取文件内容 假设要读取text.txt文件中内容 写文件(如果有文件,那直接调用就行,我这里自己先创建的文件) list1 = ['python','jave',' ...
- python练习六十三:文件处理,读取文件内容,按内容生成文件
python练习六十三:文件处理 假设要读取code.txt文件中内容,code.txt文件内容如下 01 CN Chinese 02 US United States of America 03 J ...
- C# 好代码学习笔记(1):文件操作、读取文件、Debug/Trace 类、Conditional条件编译、CLS
目录 1,文件操作 2,读取文件 3,Debug .Trace类 4,条件编译 5,MethodImpl 特性 5,CLSCompliantAttribute 6,必要时自定义类型别名 目录: 1,文 ...
- HTML5 文件域+FileReader 读取文件(一)
在HTML5以前,HTML的文件上传域的功能具有很大的局限性,这种局限性主要体现在如下两点: 每次只能选择一个文件进行上传 客户端代码只能获取被上传文件的文件路径,无法访问实际的文件内容 一.File ...
- java io流(字符流) 文件打开、读取文件、关闭文件
java io流(字符流) 文件打开 读取文件 关闭文件 //打开文件 //读取文件内容 //关闭文件 import java.io.*; public class Index{ public sta ...
- HTML5 文件域+FileReader 读取文件并上传到服务器(三)
一.读取文件为blob并上传到服务器 HTML <div class="container"> <!--读取要上传的文件--> <input type ...
- HTML5 文件域+FileReader 读取文件(二)
一.读取文本文件内容,指定字符编码 <div class="container"> <!--文本文件验证--> <input type="f ...
- 3、FileInputStream--->类文件输入流(读取文件数据)
Api介绍 定义 FileInputStream 用于读取诸如图像数据之类的原始字节流.要读取字符流,请考虑使用 FileReader 构造方法 FileInputStream(File file) ...
随机推荐
- Express无法解析POST请求的JSON参数
在用Express和MongoDB搭建后端开发环境时,可能会利用测试工具发送带有JSON格式数据的POST请求,那么这时就要利用request.body获取json数据,但此时可能遇到json无法解析 ...
- 图片预加载的插件使用-jquery.imgpreload.min.js
使用方法: //图片预加载 var the_images = [];//新建一个数组,然后将要加载的图片地址推入这个数组中: the_images.push( 'bg.jpg' ); var load ...
- Mysql基础学习_Windows版(一)
1.Mysql简介 Mysql是一种关系数据库管理系统,关系数据库将数据保存在不同的表中,而不是将所有数据放在一个大仓库内,这样就增加了速度并提高了灵活性.所谓的关系型数据库,是建立在关系模型基础上的 ...
- spring 时间格式问题
注解@JsonFormat主要是后台到前台的时间格式的转换 注解@DateTimeFormat主要是前后到后台的时间格式的转换 @DateTimeFormat(pattern = "yyyy ...
- springboot和Redis集群版的整合
此篇接上一个文章springboot和Redis单机版的整合 https://www.cnblogs.com/lin530/p/12019023.html 下面接着介绍和Redis集群版的整合. 1. ...
- 网页报警提示 This page includes a password or credit card input in a non-secure context. A warning has been added to the URL bar. For more information, see https://goo.gl/zmWq3m.
This page includes a password or credit card input in a non-secure context. A warning has been added ...
- css选择器学习(一)
1.通用选择器“*”和元素选择器 <!DOCTYPE html> <html lang="en"> <head> <meta charse ...
- 2、组件注册-@Configuration&@Bean给容器中注册组件
2.组件注册-@Configuration&@Bean给容器中注册组件 2.1 创建maven项目 spring-annotation pom.xml文件添加 spring-context 依 ...
- JQuery 实践---创建元素包装集
1. 利用选择器,选择将被JQuery包装的元素 标识和选择DOM元素.JQuery采用我们已经知道的CSS语法并且扩展了一些.为了利用JQuery来选择元素,请把选择器包装在$()中. 基本CSS选 ...
- 【安卓基础】使用Guideline与约束辅助布局的平分空间设计
ConstraintLayout布局已经推出了很长一段时间,功能也是比较强大,能有效减少界面的视图层级嵌套,一定程度提升界面绘制效率. 在项目中,我也是最近才选择开始使用ConstraintLayou ...