String boundsString = p.get(FRAME_BOUNDS, null); Rectangle r = new Rectangle(0, 0, 800, 650); if (boundsString != null) { String[] a = boundsString.split(",", 4); if (a.length > 0) try { r.x = Math.max(0, Integer.parseInt(a[0])); } catch (NumberFormatException nfe) { assert true; } if (a.length > 1) try { r.y = Math.max(0, Integer.parseInt(a[1])); } catch (NumberFormatException nfe) { assert true; } if (a.length > 2) try { r.width = Math.max(40, Integer.parseInt(a[2])); } catch (NumberFormatException nfe) { assert true; } if (a.length > 3) try { r.height = Math.max(40, Integer.parseInt(a[3])); } catch (NumberFormatException nfe) { assert true; } } newInstance.frameBounds = r;
	public static void loadInstance()	{		GUISaveState newInstance=new GUISaveState();		newInstance.recentProjects=new ArrayList<File>();		Preferences p=Preferences.userNodeForPackage(GUISaveState.class);				newInstance.starterDirectoryForLoadBugs=new File(p.get(GUISaveState.STARTERDIRECTORY, SystemProperties.getProperty("user.dir")));				int prevCommentsSize=p.getInt(GUISaveState.PREVCOMMENTSSIZE, 0);				for (int x=0;x<prevCommentsSize;x++)		{			String comment=p.get(GUISaveState.COMMENTKEYS[x], "");			newInstance.previousComments.add(comment);		}				int size=Math.min(MAXNUMRECENTPROJECTS,p.getInt(GUISaveState.NUMPROJECTS,0));		for (int x=0;x<size;x++)		{			newInstance.recentProjects.add(new File(p.get(GUISaveState.RECENTPROJECTKEYS[x],"")));		}		int sorterSize=p.getInt(GUISaveState.SORTERTABLELENGTH,-1);		if (sorterSize!=-1)		{			Sortables[] sortColumns=new Sortables[sorterSize];			String[] sortKeys=GUISaveState.generateSorterKeys(sorterSize);			for (int x=0;x<sorterSize;x++)			{				sortColumns[x]=Sortables.getSortableByPrettyName(p.get(sortKeys[x], "*none*"));				if (sortColumns[x]==null)				{					if (MainFrame.DEBUG) System.err.println("Sort order was corrupted, using default sort order");					newInstance.useDefault=true;				}			}			newInstance.starterTable=new SorterTableColumnModel(sortColumns);		}		else			newInstance.useDefault=true;		newInstance.dockingLayout = p.getByteArray(DOCKINGLAYOUT, new byte[0]);				instance=newInstance;	}