. -
- -可修编.
//
import .*;
import .*;
import ;
import .*;
import .*;
import ;
import .*;
public class Memorial extends JFrame implements ActionListener{
/**
* param args
*/
private JLabel title,picture,mark,jl1,jl2,jl3,jl4;
private JTextField jt1,jt2,jt3;
private utton Ok ,Cancle;
private static String name1 =null;
private static String pass1 = null;
// 构造函数
public Memorial(){
title = new JLabel("我的备忘录");
picture = new JLabel(new ImageIcon("photos/"));//背景标签
/*mark = new JLabel(new ImageIcon("")); */
jl1 =new JLabel( "登录名:");
jl2 =new JLabel( "登录密码:");
jl3 =new JLabel( );
jl4 = new JLabel("看不清");
jt1 = new JTextField();
jt2 = new JTextField();
jt3 = new JTextField();
Ok = new utton ("登录");
Cancle = new utton("取消");
}
//页面布局
public void launchFrame(){
JPanel p = (JPanel) getContentPane();
( getcode() );
(); //设置验证码的颜色
(());//使验证码凸出显示
();//设置“看不清”标签的前景色为洋红色
(new addEvent()); //为“看不清”标签添加鼠标监听器
(this); //为“登录”按钮添加监听器
(this); //为“取消”按钮添加监听器
. -
- -可修编.
(()); //使按钮凸出显示
(());
//****设置背景图片
(null);//使用setBounds(),必须使布局为null
(0,0,500,330);
(picture);
(false);//使内容窗格透明
//把背景图片添加到分层窗格的最底层作为背景
getLayeredPane().add(p
java备忘录编写源代码及运行界面截图 来自淘豆网m.daumloan.com转载请标明出处.