![JAVA简单用户界面----留言板_第1页](http://file1.renrendoc.com/fileroot_temp2/2020-6/22/3ea84d9c-d9bf-4ff1-ac7a-463ab78ebcb8/3ea84d9c-d9bf-4ff1-ac7a-463ab78ebcb81.gif)
![JAVA简单用户界面----留言板_第2页](http://file1.renrendoc.com/fileroot_temp2/2020-6/22/3ea84d9c-d9bf-4ff1-ac7a-463ab78ebcb8/3ea84d9c-d9bf-4ff1-ac7a-463ab78ebcb82.gif)
![JAVA简单用户界面----留言板_第3页](http://file1.renrendoc.com/fileroot_temp2/2020-6/22/3ea84d9c-d9bf-4ff1-ac7a-463ab78ebcb8/3ea84d9c-d9bf-4ff1-ac7a-463ab78ebcb83.gif)
![JAVA简单用户界面----留言板_第4页](http://file1.renrendoc.com/fileroot_temp2/2020-6/22/3ea84d9c-d9bf-4ff1-ac7a-463ab78ebcb8/3ea84d9c-d9bf-4ff1-ac7a-463ab78ebcb84.gif)
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、JAVA简单用户界面-留言板导入Java.awt.* .导入Java.awt.event.*导入Java.util.date;导入Java.text .简单数据格式;导入Java.io.*导入Java.applet.*公共类框架;publicstaticvoidmain (string args ) new MyFrame ();以下以下我的帧扩展帧类.举止/Panel P1,P2;button BTN是,btnNo;标签名称、lno、lsex、lmassage、lwelcome;TextField no,nameTextArea info,massage;Choice sex;Checkbo
2、x check;StringBuffer sb=new StringBuffer ( );我的帧()举止设置可见性(true )setsize (700,300 )settitle(pp );setResizable(false )addwindowlistener (新窗口适配器() publicvoidwindowinclosing (windowevente )System.exit(0); 以下 );/p1=新面板();/P1.setBackground(Color.red )/p2=新面板();/p2. set background (color.yellow )/setLayout
3、(new FlowLayout ();lwelcome=new Label (欢迎使用留言板! “);添加(l welcome )lname=new Label (名称: );add(lname )name=new TextField(5)add(name )lno=new Label (学号: );添加(lno )no=new TextField(10 )添加(否)lsex=新标签(性别: );添加(lsex )lmassage=new Label (信息信息: );add(lmassage )sex=new Choice ();sex.add (男 );sex.add (女 );添加(se
4、x )btnNo=new Button (清除)添加(BTN no )btnYes=new Button (注释 );添加(是)info=new textarea (3,20 )添加(信息)massage=new textarea (5,70 )add(massage )check=new Checkbox (匿名消息 );添加(检查)设置布局(空)El welcome.set bounds (45,50,130,20 )check.set bounds (274,110,80,20 )lname.set bounds (45,80,30,20 )name.set bounds (80,80,
5、50,20 )lno.set bounds (150,80,30,20 )no.set bounds (185,80,50,20 )lsex.set bounds (250,80,30,20 )sex.set bounds (290,80,50,20 )info.set bounds (130,130,210,100 )ls massage.set bounds (45,125,60,50 )BTN nyes.set bounds (55,235,100,30 )btnorno.set bounds (200,235,100,30 )massage.set bounds (360,50,300
6、,200 )massage.setEditable(false )btnpryes.addactionlistener (new submit () );BTN opo.addactionlistener (new cancle () );check.additem监听器(new checked ();以下classcheckedimplementitemlistener举止publicvoidinatestatechanged (itemevente )举止Checkbox temp;temp=(Checkbox)(e.getSource ();if(temp.getState () )举止
7、name.enable(false )no.enable(false )sex.enable(false )以下else举止name.enable(true )no.enable(true )sex.enable(true )以下以下以下classsubmitimplementsactionlistener举止publicvoidactionperformed (actionevent e )举止simpledateformatdf=newsimpledateformat ( yyyy-mm-ddhh : mm : ss );/file file=new file ( d : a.txt );
8、/output stream out=new file output stream (file )if(e.getSource()=btnYes )举止if(check.getState () ) massage.settext (massage.gettext () 匿名消息! “rn”消息时间: df.format(new Date() rn 注释内容: info.getText() rnn ;info.setText ( );以下else举止massage.settext (massage.gettext () 学号: no.getText () 名称: name.getText () 性别: sex.getSelectedItem() rn 消息时间: df.format(new Date() rn 注释内容: info.getText() rnn ;no.setText ( );name.setText ( );info.setText ( );以下以下以下以下classcancleimplementsactionlistener举止publicvoidaction
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 水镁石相关项目实施方案
- 环境整改报告范文(3篇)
- 关于高一新生军训心得范文(30篇)
- 小学三年级教学工作计划(18篇)
- 画杨桃反思总结(35篇)
- 2022年广告公司实习报告
- 2022年学生学习态度调查报告
- 商场营业员年度个人工作总结范本(八篇)
- 保密要害部门部位管理制度(六篇)
- 2024年农副产品竹笋干订单合同(3篇)
- 江永事业单位笔试试题2024
- 幼儿防丢防拐骗知识讲座
- 家庭教育公开知识讲座
- 2024年氢能源行业未来三年发展洞察报告
- SJ-T 11798-2022 锂离子电池和电池组生产安全要求
- 2024年陕西西安咸阳国际机场股份有限公司招聘笔试参考题库含答案解析
- 礼仪对礼仪培训课件
- 智能安防行业的数字化转型与发展趋势
- 电力基础知识考试题库(考试题库)
- 2023-2023学年广东省深圳市龙华区七年级(下)期末生物试卷(附答案详解)
- 服装店铺调拨流程V3课件
评论
0/150
提交评论