⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mymessage.java

📁 可以用来保持常用的帐号和密码的软件,保存常用的邮箱帐号密码以及网游
💻 JAVA
字号:
import java.io.*;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class mymessage{
	DesEncrypt pw=new DesEncrypt();                       //保险柜窗口
	user myuser=new user();
	Frame f=new Frame("safebox ,author:  csophys fedora");
	Panel p=new Panel();
	//Button b2=new Button("保存");
	Button b1=new Button("添加");
  TextArea tf=new TextArea();
    String sr;
	Label l1=new Label("帐号                   ");
	Label l2=new Label("密码                ");
	Label l3=new Label("备注                    ");
	Label l4=new Label("注册时间             ");
	JPanel p11=new JPanel();
	             JPanel p22=new JPanel();
	             JFrame f1=new JFrame();
	             JLabel l11=new JLabel("文件内容已经被修改,是否保存?");
	             JButton b11=new JButton("是");
	             JButton b22=new JButton("否");

/*public static void main(String args[])
{ mymessage my=new mymessage();
my.create();
}*/
     void del(){
     	 try{FileWriter fis=new FileWriter("message.saf");
     String s="";pw.getKey("aadd");
     String s1=pw.getEncString(s);
      fis.write(s1);
	   fis.close();
     }catch(IOException g){System.out.println(g);
     }
     }
     void create(){
	p.add(l1);p.add(l2);p.add(l4);p.add(l3);
	p.add(b1);
//p.add(b2);
	f.setVisible(true);
	f.setResizable(false);
		f.setSize(550,300);
  tf.setFont(new Font("simsunn",Font.PLAIN,14));
	try
		{
    myin();
    }catch(IOException t){
    	System.out.println("Catch  导入"+t);
    }
    sr=tf.getText().trim();
	f.add("North",p);
	f.add("Center",tf);
	             f1.setLayout(new BorderLayout());
	             f1.add("North",p11);
	             f1.add("South",p22);
	             p11.add(l11);
	             p22.add(b11);p22.add(b22);
	             f1.setSize(250,100);
				f1.setLocation(500,300);
				f1.setResizable(false);
	b11.addActionListener(new ActionListener(){
		public void actionPerformed(ActionEvent e){
			try{
				 FileWriter fis=new FileWriter("message.saf");
     String s=tf.getText();
     pw.getKey("aadd");
     String s1=pw.getEncString(s);
      fis.write(s1);
	   fis.close();
		}catch(IOException g){System.out.println(g);
		}
		System.exit(0);
		f.dispose();
	}});
	b22.addActionListener(new ActionListener(){
		public void actionPerformed(ActionEvent e){
		System.exit(0);
		f.dispose();}});
	
		f.addWindowListener(new WindowAdapter(){
		public void windowClosing(WindowEvent e)
		{ String sr1=tf.getText().trim();
			if(sr1.equals(sr))
			System.exit(0);
			else f1.setVisible(true);
		}
	});
	myuser.setus.addActionListener(new ActionListener(){
		public void actionPerformed(ActionEvent e){
			String s=tf.getText();
			String s1=myuser.UserName1.getText()+'\t'+'\t'+myuser.PassWord1.getText()+'\t'+'\t'+myuser.PassWord2.getText()+'\t'+'\t'+myuser.PassWord3.getText();
		tf.setText(s+'\n'+s1);
		myuser.Jset.setVisible(false);
		myuser.UserName1.setText("");myuser.PassWord1.setText(""); myuser.PassWord2.setText(""); myuser.PassWord3.setText("");
		}
	});
	b1.addActionListener(new ActionListener (){
    	
    	public void actionPerformed(ActionEvent e){
    		myuser.Jset.setVisible(true);
    	}
    });
/*	b2.addActionListener(new ActionListener (){
		public void actionPerformed (ActionEvent e) {
		try
		{
    myout();
    }catch(IOException g){
    	System.out.println("Catch  导出"+g);
    }}});*/
	
}	
	
/*void myout() throws IOException
		{
    FileWriter fis=new FileWriter("message.saf");
     String s=tf.getText();
     pw.getKey("aadd");
     String s1=pw.getEncString(s);
      fis.write(s1);
	   fis.close();
	    }*/
void myin() throws IOException
  { FileInputStream fis=new FileInputStream("message.saf");
BufferedReader dis=new BufferedReader(new InputStreamReader(fis));
  String line=dis.readLine();
  //tf.setText("");
  pw.getKey("aadd");
  String line1=pw.getDesString(line);
  tf.setText(line1);
/*String str[]=new String[2000];
  do{int i=0;
 tf.append(line+'\n');  
 
  i++;
   }while((line=dis.readLine())!=null);*/
   
   
  }
  
   
  }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -