資源簡介
可以實現發送抖動,信息,截屏...
代碼簡單易懂。有注釋
附有數據庫,因為不知道是哪一個了,所以兩個都放在了文檔里

代碼片段和文件信息
import?java.awt.*;
import?java.awt.event.*;
import?java.io.*;
public?class?QQLogin?extends?frame?implements?ActionListenerFocusListener//當前類實現事件處理接口
{??
???TextField?t1pwd;
???private?Checkbox?ck;
???private?Label?lb;
???private?Dialog?d;
???
public?QQLogin(String?title)
{
super(title);
this.setLocation(100100);
this.setSize(400300);
this.setLayout(null);
this.setVisible(true);
ck=new?Checkbox(“保存密碼“);
lb=new?Label();
}
public?void?addText()
{
t1=new?TextField();//創建文本框對象
//設置文本框屬性
t1.setLocation(5050);
t1.setSize(8018);
this.add(t1);
t1.addKeyListener(new?Abcd());//想使用事件適配器做
pwd=new?TextField();//創建文本框對象
//設置文本框屬性
pwd.setLocation(5075);
pwd.setSize(8018);
pwd.setEchoChar(‘*‘);
this.add(pwd);
//添加獲得焦點監聽
pwd.addFocusListener(this);
Button?b=new?Button(“確定“);
b.setLocation(14998);
b.setSize(5020);
this.add(b);
b.addActionListener(this);
//設置
ck.setLocation(4098);
ck.setSize(8020);
this.add(ck);
lb.setLocation(14050);
lb.setSize(8020);
this.add(lb);
//使用匿名類添加窗口的關閉事件
this.addWindowListener(new?WindowAdapter(){
?public?void?windowClosing(WindowEvent?e)
?{
? System.exit(0);
?}
});
}
public?void?actionPerformed(ActionEvent?e)//重寫方法
?? {
?? Button?dd=(Button)e.getSource();//得到事件對象
?? ??if(dd.getLabel().equals(“OK“))//通過事件對象的名稱來判斷是誰發生了事件
?? ???{
?? ??? ?d.setVisible(false);
?? ???}
?? ???else{?? ???
?? String?st1=t1.getText();
?? String?spwd=pwd.getText();
?? System.out.println(st1);
?? System.out.println(spwd);
?? if(st1.equals(“654321“)&&spwd.equals(“123456“))
?? {
?? System.out.println(“登錄成功“);
?? d=new?Dialog(this“登錄成功“);//使用對話框
?? d.setLocation(450350);
?? d.setSize(200150);
?? d.setLayout(null);
?? Label?qqlb=new?Label(“你的QQ號碼是:“+st1);
?? qqlb.setLocation(2050);
?? qqlb.setSize(15020);
?? d.add(qqlb);
?? Button?b2=new?Button(“OK“);
?? b2.setLocation(9090);
?? b2.setSize(4020);
?? d.add(b2);
?? b2.addActionListener(this);//給對話框的按鈕添加監聽
??
?? d.setVisible(true);//顯示對話框
?? if(ck.getState())
?? {
?? try{
?? System.out.println(“選中“);
?? File?qq=new?File(“..//pwd//qq.pwd“);//1
?? //FileReader?fr=new?FileReader(qq);//讀取
?? //BufferedWriter?bw=new?BufferedWriter(new?FileWriter(qq));//2
?? PrintWriter?pw=new?PrintWriter(qq);//2
?? pw.println(st1);
?? pw.println(spwd);
?? pw.close();
?? }
?? catch(IOException?ie)
?? {
?? System.out.println(ie.getMessage());
?? }
??
?? }
?? }
?? }
?? }
??
??
?? //重寫方法
?? public?void?focusGained(FocusEvent?e)//獲得焦點
?? {
?? System.out.println(“獲得焦點“);
?? try{
?? File?qq=new?File(“..//pwd//qq.pwd“);//1
?? FileReader?fr=new?FileReader(qq);//讀取
?? BufferedReader?br=new?BufferedReader(fr);
?? String?s;
?? while((s=br.readLine())!=null)
?? {
?? if(s.equals(t
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????324??2011-09-22?17:40??QqTalk\.classpath
?????文件????????382??2007-09-23?09:33??QqTalk\.project
?????文件???????1383??2011-12-21?18:45??QqTalk\bin\Qq\CaptureScreen$1.class
?????文件????????500??2011-12-21?18:45??QqTalk\bin\Qq\CaptureScreen$2.class
?????文件????????928??2011-12-21?18:45??QqTalk\bin\Qq\CaptureScreen$BMPfilter.class
?????文件????????928??2011-12-21?18:45??QqTalk\bin\Qq\CaptureScreen$GIFfilter.class
?????文件????????928??2011-12-21?18:45??QqTalk\bin\Qq\CaptureScreen$JPGfilter.class
?????文件???????2264??2011-12-21?18:45??QqTalk\bin\Qq\CaptureScreen$PicPanel.class
?????文件???????1038??2011-12-21?18:45??QqTalk\bin\Qq\CaptureScreen$PNGfilter.class
?????文件???????8263??2011-12-21?18:45??QqTalk\bin\Qq\CaptureScreen$Temp.class
?????文件???????9418??2011-12-21?18:45??QqTalk\bin\Qq\CaptureScreen.class
?????文件????????653??2011-12-21?18:45??QqTalk\bin\Qq\NewLogin$1.class
?????文件????????768??2011-12-21?18:45??QqTalk\bin\Qq\NewLogin$2.class
?????文件???????3370??2011-12-21?18:45??QqTalk\bin\Qq\NewLogin$3.class
?????文件????????497??2011-12-21?18:45??QqTalk\bin\Qq\NewLogin$ItemObj.class
?????文件???????1354??2011-12-21?18:45??QqTalk\bin\Qq\NewLogin$JCBCellRenderer.class
?????文件????????760??2011-12-21?18:45??QqTalk\bin\Qq\NewLogin$JCBModel.class
?????文件???????4429??2011-12-21?18:45??QqTalk\bin\Qq\NewLogin.class
?????文件????????618??2011-12-21?18:45??QqTalk\bin\Qq\QqChat$1.class
?????文件???????1728??2011-12-21?18:45??QqTalk\bin\Qq\QqChat$2.class
?????文件???????1277??2011-12-21?18:45??QqTalk\bin\Qq\QqChat$3.class
?????文件????????702??2011-12-21?18:45??QqTalk\bin\Qq\QqChat$4.class
?????文件????????674??2011-12-21?18:45??QqTalk\bin\Qq\QqChat$5.class
?????文件???????1229??2011-12-21?18:45??QqTalk\bin\Qq\QqChat$clients.class
?????文件???????1179??2011-12-21?18:45??QqTalk\bin\Qq\QqChat$TRes.class
?????文件???????5189??2011-12-21?18:45??QqTalk\bin\Qq\QqChat.class
?????文件???????1452??2011-12-21?18:45??QqTalk\bin\Qq\QQClient$1.class
?????文件????????965??2011-12-21?18:45??QqTalk\bin\Qq\QQClient$2.class
?????文件????????919??2011-12-21?18:45??QqTalk\bin\Qq\QQClient$3.class
?????文件????????533??2011-12-21?18:45??QqTalk\bin\Qq\QQClient$ItemObj.class
............此處省略114個文件信息
評論
共有 條評論