Code example for Preferences

Methods: getInt

0
	} 
 
	 
	public int loadInt(String id, int defaultValue)
	{ 
		return cfg.getInt(pref_prefix+id, defaultValue);
	} 
	 
	public void saveInt(String id, int value)
	{ 
	    cfg.putInt(pref_prefix+id, value);
	} 
 
	public void restorePosition() 
	{ 
		// Restore window geometry 
	    Rectangle bounds = new Rectangle();
	    bounds.x = loadInt("window.x", getDefaultGeometry().x);
	    bounds.y = loadInt("window.y", getDefaultGeometry().y);
	    bounds.width = loadInt("window.width", getDefaultGeometry().width);
	    bounds.height = loadInt("window.height", getDefaultGeometry().height);