/* * McbSettingsLoad.java * * Created on May 12, 2006, 5:10 PM */ package Current.popups.Settings; import java.awt.*; import java.awt.event.*; import java.util.*; import java.io.*; import java.net.URL; import Current.manage.*; import Current.gui.*; /** * * @author pat */ public class Load extends StringListCanvas { Manager M; static int padding=4; static Color bgColor=new Color(0,50,100); public Load(Manager M) { this.M=M; setColors(bgColor, new Color(100,100,255), Color.yellow, Color.black); LinkedList ll=new LinkedList(); try { String thisLine; //InputStream is = (new URL("Files/prop_files")).openStream(); InputStream is=M.getInputStream("Files/prop_files"); //getClass().getResourceAsStream("/Files/Properties/"); BufferedReader br = new BufferedReader(new InputStreamReader(is)); //if (((thisLine = br.readLine()) == null)) { // fall back on the file list // is = getClass().getResourceAsStream("/Files/prop_files"); // br = new BufferedReader(new InputStreamReader(is)); // thisLine = br.readLine(); //} thisLine = br.readLine(); if (thisLine!=null) do { //System.out.println(thisLine); ll.add(thisLine); } while ((thisLine = br.readLine()) != null); else System.out.println("No properties files found."); } catch (Exception e) { System.out.println("Error reading properties files..."); e.printStackTrace(); } String[] file_names=new String[ll.size()]; int i=0; for (ListIterator it=ll.listIterator(); it.hasNext();i++){ file_names[i]=(String)it.next(); } setNames(file_names); } public void deselect(){} public void select(String str){ M.settings.loadProperties(str); } }