Java Code Examples for javax.swing.JFrame.setState()

The following are Jave code examples for showing how to use setState() of the javax.swing.JFrame class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: geomapapp   File: MapApp.java   View Source Code Vote up 5 votes
protected void initLayerManager() {

		JFrame d = new JFrame();
		d.addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e) {
				((JCheckBoxMenuItem)(XML_Menu.commandToMenuItemHash.get("layer_manager_cmd"))).setSelected(false);
			}
		});
		LayerManager lm;
		
		//use existing layer manager if it already exists
		if (layerManager != null) {
			lm = layerManager;
		} else {
			lm = new LayerManager();
		}
		
		lm.setLayerList( toLayerList(map.overlays) );
		lm.setMap(map);

		lm.setDialog(d);
		JScrollPane sp = new JScrollPane(lm);
		sp.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
		d.setTitle("Layer Manager");
		d.setContentPane(sp);
//		d.getContentPane().add(sp);
		d.pack();
		d.setSize(new Dimension(lm.getPreferredSize().width+20,lm.getPreferredSize().height+55));
		d.setMaximumSize(new Dimension(400,300));

		d.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE);
		d.setLocationRelativeTo(frame);
		d.setState(Frame.NORMAL);
		d.setAlwaysOnTop(true);
		this.layerManager = lm;
		this.layerManagerDialog = d;	
	}
 
Example 2
Project: geomapapp   File: MapApp.java   View Source Code Vote up 5 votes
protected synchronized void detachDisplay() {
	if (currentDB == null) return;
	if (currentDB.getDataDisplay() == null) return;
	if (currentDB.getDataDisplay().getPreferredSize().height < 50) return;

	JFrame displayDialog = getDataDisplayDialog();
	displayDialog.setTitle( currentDB.getDBName() );

	displayDialog.getContentPane().removeAll();
	displayDialog.getContentPane().add(currentDB.getDataDisplay());

	int w = vPane.getSize().width;
	int h = currentDB.getDataDisplay().getPreferredSize().height;
	if(h>200) h=200;

	int x = frame.getLocationOnScreen().x;
	int y = frame.getLocationOnScreen().y + frame.getHeight();

	displayDialog.setSize(w, h);
	displayDialog.setLocation(x, y);

	vPane.setBottomComponent( null );
	displayDialog.setState( Frame.NORMAL );
	displayDialog.setVisible(true);
	detach_attachB.setText("Attach Profile/Table");
	attached = false;
}