本文整理汇总了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;
}