本文整理匯總了Java中javax.swing.JFrame.setState方法的典型用法代碼示例。如果您正苦於以下問題:Java JFrame.setState方法的具體用法?Java JFrame.setState怎麽用?Java JFrame.setState使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.JFrame
的用法示例。
在下文中一共展示了JFrame.setState方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initLayerManager
import javax.swing.JFrame; //導入方法依賴的package包/類
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;
}
示例2: detachDisplay
import javax.swing.JFrame; //導入方法依賴的package包/類
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;
}