Code example for Preferences

Methods: putInt

0
		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);
	    setBounds(bounds); // Do not use pack()!
	} 
	 
	@Override 
	public void windowActivated(WindowEvent arg0) {}