rsconfigure.java

来自「一个基于NetBeans平台开发的」· Java 代码 · 共 112 行

JAVA
112
字号
/* * RSConfigure.java * * Created on 2005年3月23日, 上午10:37 */package com.sinpool.rivercrescent.myutil;import java.io.*;/** * * @author  sinpool */public class RSConfigure implements Serializable{    //设置面板,按钮选择与否的默认值    private boolean DefaultPathCheckBox_Selected = false;    private boolean P_J_Launch_CheckBox_Selected = true;    private boolean Start_Launch_CheckBox_Selected = false;    //设置面板,默认值    private String DefaultSavePath = null;    private String DefaultPeerName = null;    private int DefaultSearchThreshold = 10;    private int DefaultTimeThreshold = 10;        /** Creates a new instance of RSConfigure */    public RSConfigure() {    }    public boolean writeToDisk(){		String fileName = "RS.cfg";				try{			File file = new File(fileName);                        			FileOutputStream fos = new FileOutputStream(file);			ObjectOutputStream oos = new ObjectOutputStream(fos);			oos.writeObject(this);			oos.flush();			oos.close();			fos.close();		}catch (IOException ioe) {ioe.printStackTrace();System.out.println("将 RS.cfg 写入磁盘时,出错。");return false;}				return true;    }    public static RSConfigure readFromDisk(){                RSConfigure result = null;		try{			File file = new File("RS.cfg");			FileInputStream fis = new FileInputStream(file);			ObjectInputStream ois = new ObjectInputStream(fis);			result = (RSConfigure)ois.readObject();			ois.close();			fis.close();		}catch (IOException ioe) {ioe.printStackTrace();System.out.println("出现IO错误!");return null;}		catch (ClassNotFoundException cfe) {System.out.println("从流中检索的对象没有找到所属的类!");return null;}                 		return result;    }    public boolean getDefaultPathCheckBox_Selected(){        return this.DefaultPathCheckBox_Selected;    }    public void setDefaultPathCheckBox_Selected(boolean b){        this.DefaultPathCheckBox_Selected = b;    }    public boolean getP_J_Launch_CheckBox_Selected(){        return this.P_J_Launch_CheckBox_Selected;    }    public void setP_J_Launch_CheckBox_Selected(boolean b){        this.P_J_Launch_CheckBox_Selected = b;    }        public boolean getStart_Launch_CheckBox_Selected(){        return this.Start_Launch_CheckBox_Selected;    }    public void setStart_Launch_CheckBox_Selected(boolean b){        this.Start_Launch_CheckBox_Selected = b;    }        public String getDefaultSavePath(){        return this.DefaultSavePath;    }    public void setDefaultSavePath(String s){        this.DefaultSavePath = s;    }        public String getDefaultPeerName(){        return this.DefaultPeerName;    }    public void setDefaultPeerName(String s){        this.DefaultPeerName = s;    }        public int getDefaultSearchThreshold(){        return this.DefaultSearchThreshold;    }    public void setDefaultSearchThreshold(int i){        this.DefaultSearchThreshold = i;    }        public int getDefaultTimeThreshold(){        return this.DefaultTimeThreshold;    }    public void setDefaultTimeThreshold(int i){        this.DefaultTimeThreshold = i;    }}

⌨️ 快捷键说明

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