本文整理了Java中javax.swing.JInternalFrame.setDefaultCloseOperation()
方法的一些代码示例,展示了JInternalFrame.setDefaultCloseOperation()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JInternalFrame.setDefaultCloseOperation()
方法的具体详情如下:
包路径:javax.swing.JInternalFrame
类名称:JInternalFrame
方法名:setDefaultCloseOperation
暂无
代码示例来源:origin: geotools/geotools
frame.setDefaultCloseOperation(JInternalFrame.DISPOSE_ON_CLOSE);
frame.addInternalFrameListener(InternalWindowListener.wrap(listener));
((JDesktopPane) owner).add(frame);
代码示例来源:origin: geotools/geotools
parentSize = desktop.getSize();
frame.setContentPane(content);
frame.setDefaultCloseOperation(JInternalFrame.HIDE_ON_CLOSE);
desktop.add(frame, JLayeredPane.PALETTE_LAYER);
} else {
代码示例来源:origin: geotools/geotools
window.setDefaultCloseOperation(JInternalFrame.DISPOSE_ON_CLOSE);
if (warningArea == null || !window.isVisible()) {
window.dispose();
代码示例来源:origin: pentaho/mondrian
jf.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
代码示例来源:origin: pentaho/mondrian
updateMDXCatalogList();
schemaFrame.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
代码示例来源:origin: antlr/antlrworks
public void setDefaultCloseOperation(int operation) {
if(useDesktop) {
jInternalFrame.setDefaultCloseOperation(operation);
} else {
jFrame.setDefaultCloseOperation(operation);
}
}
代码示例来源:origin: com.eas.platypus/platypus-js-forms
public void setDefaultCloseOperation(int aValue) {
defaultCloseOperation = aValue;
if (surface instanceof JDialog) {
((JDialog) surface).setDefaultCloseOperation(defaultCloseOperation);
}
if (surface instanceof JInternalFrame) {
((JInternalFrame) surface).setDefaultCloseOperation(defaultCloseOperation);
}
if (surface instanceof JFrame) {
((JFrame) surface).setDefaultCloseOperation(defaultCloseOperation);
}
}
代码示例来源:origin: de.sciss/scisslib
public void setDefaultCloseOperation( int mode )
{
if( ggTitle != null ) {
ggTitle.setDefaultCloseOperation( mode );
} else if( jf != null ) {
jf.setDefaultCloseOperation( mode );
} else if( jd != null ) {
jd.setDefaultCloseOperation( mode );
} else if( jif != null ) {
jif.setDefaultCloseOperation( mode );
} else {
throw new IllegalStateException( "setDefaultCloseOperation wrapper not yet implemented" );
}
}
代码示例来源:origin: org.japura/japura-gui
private void backupProperties(JInternalFrame frame) {
oldDefaultCloseOperation = frame.getDefaultCloseOperation();
frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
oldInternalFrameListeners = frame.getInternalFrameListeners();
for (InternalFrameListener listener : oldInternalFrameListeners) {
frame.removeInternalFrameListener(listener);
}
}
代码示例来源:origin: cmu-phil/tetrad
/**
* Constructs a new frame which will throw up a warning dialog if someone
* tries to close it.
*
* @param title the title of the frame.
*/
public TetradInternalFrame(String title) {
super(title, false, true, false, false);
Image image = ImageUtils.getImage(this, "tyler16.png");
setFrameIcon(new ImageIcon(image));
super.setDefaultCloseOperation(JInternalFrame.DO_NOTHING_ON_CLOSE);
addInternalFrameListener(new InternalFrameAdapter() {
/**
* Throws up a warning dialog and then closes the frame if the user
* says to. Otherwise ignores the attempt.
*/
public void internalFrameClosing(InternalFrameEvent e) {
ActionEvent e2 = new ActionEvent(e.getSource(),
ActionEvent.ACTION_PERFORMED, "FrameClosing");
CloseSessionAction closeSessionAction =
new CloseSessionAction();
closeSessionAction.actionPerformed(e2);
}
});
}
}
代码示例来源:origin: BranislavLazic/SwingTutorials
public void run() {
JDesktopPane desktopPane = new JDesktopPane();
JInternalFrame intFrame = new JInternalFrame(
"JInternalFrame demo");
intFrame.setMaximizable(true);
intFrame.setIconifiable(true);
intFrame.setResizable(true);
intFrame.setClosable(true);
intFrame.setDefaultCloseOperation(JInternalFrame.DISPOSE_ON_CLOSE);
intFrame.setSize(320, 240);
// intFrame.pack();
intFrame.setVisible(true);
desktopPane.add(intFrame);
JFrame frame = new JFrame();
frame.add(desktopPane);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.setSize(640, 480);
// frame.pack();
frame.setVisible(true);
}
});
代码示例来源:origin: net.sourceforge.ondex.apps/ovtk2
/**
* Adds command line window to main frame.
*
* @param desktop
* OVTK2Desktop to host command line
*/
private void initCommandLine(OVTK2Desktop desktop) {
if (console == null || console.isClosed()) {
console = new RegisteredJInternalFrame(Config.language.getProperty("Menu.Tools.Console"), "Tools", Config.language.getProperty("Menu.Tools.Console"), true, true, true, true);
console.setDefaultCloseOperation(JInternalFrame.DISPOSE_ON_CLOSE);
console.setSize(600, 100);
try {
OutputPrinter c = OVTKScriptingInitialiser.getCommandLine();
JScrollPane scrollingArea = new JScrollPane((Component) c);
scrollingArea.setMinimumSize(new Dimension(0, 35));
console.add(scrollingArea);
} catch (RuntimeException e) {
ErrorDialog.show(e);
}
desktop.display(console, Position.centered);
console.setVisible(true);
} else {
console.setVisible(true);
console.toFront();
}
}
代码示例来源:origin: org.japura/japura-gui
private void restoreRootPane() {
rootPane.getRootPane().removeComponentListener(resizeListener);
rootPane.getLayeredPane().remove(getModalPanel());
if (rootPane instanceof JFrame) {
JFrame frame = (JFrame) rootPane;
frame.setDefaultCloseOperation(oldDefaultCloseOperation);
for (WindowListener listener : oldWindowListeners) {
frame.addWindowListener(listener);
}
} else if (rootPane instanceof JDialog) {
JDialog dialog = (JDialog) rootPane;
dialog.setDefaultCloseOperation(oldDefaultCloseOperation);
for (WindowListener listener : oldWindowListeners) {
dialog.addWindowListener(listener);
}
} else if (rootPane instanceof JInternalFrame) {
JInternalFrame frame = (JInternalFrame) rootPane;
frame.setDefaultCloseOperation(oldDefaultCloseOperation);
for (InternalFrameListener listener : oldInternalFrameListeners) {
frame.addInternalFrameListener(listener);
}
}
Component comp = (Component) rootPane;
comp.update(comp.getGraphics());
}
代码示例来源:origin: org.jspresso.framework/jspresso-swing-application
/**
* Creates a new JInternalFrame and populates it with a view.
*
* @param view
* the view to be set into the internal frame.
* @return the constructed internal frame.
*/
private JInternalFrame createJInternalFrame(JComponent view, String title,
Icon frameIcon) {
JInternalFrame internalFrame = new JInternalFrame(title);
internalFrame.setFrameIcon(frameIcon);
internalFrame.setResizable(true);
internalFrame.setClosable(true);
internalFrame.setMaximizable(true);
internalFrame.setIconifiable(true);
internalFrame.getContentPane().add(view, BorderLayout.CENTER);
internalFrame.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
internalFrame.setGlassPane(createHermeticGlassPane());
return internalFrame;
}
代码示例来源:origin: org.scijava/scijava-ui-swing
@Override
protected void setupConsole() {
final JInternalFrame frame = new JInternalFrame("Console");
desktopPane.add(frame);
frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
frame.setContentPane(getConsolePane().getComponent());
frame.setJMenuBar(createConsoleMenu());
frame.pack();
getConsolePane().setWindow(frame);
}
代码示例来源:origin: org.bidib.jbidib.swinglabs.swingx/swingx-core
pane.applyComponentOrientation(window.getComponentOrientation());
window.setDefaultCloseOperation(JInternalFrame.DISPOSE_ON_CLOSE);
window.pack();
代码示例来源:origin: org.swinglabs.swingx/swingx-all
pane.applyComponentOrientation(window.getComponentOrientation());
window.setDefaultCloseOperation(JInternalFrame.DISPOSE_ON_CLOSE);
window.pack();
代码示例来源:origin: com.haulmont.thirdparty/swingx-core
pane.applyComponentOrientation(window.getComponentOrientation());
window.setDefaultCloseOperation(JInternalFrame.DISPOSE_ON_CLOSE);
window.pack();
代码示例来源:origin: org.swinglabs.swingx/swingx-core
pane.applyComponentOrientation(window.getComponentOrientation());
window.setDefaultCloseOperation(JInternalFrame.DISPOSE_ON_CLOSE);
window.pack();
代码示例来源:origin: org.jspresso/jspresso-swing-application
/**
* Creates a new JInternalFrame and populates it with a view.
*
* @param view
* the view to be set into the internal frame.
* @return the constructed internal frame.
*/
private JInternalFrame createJInternalFrame(IView<JComponent> view) {
JInternalFrame internalFrame = new JInternalFrame(view.getDescriptor()
.getI18nName(getTranslationProvider(), getLocale()));
internalFrame.setFrameIcon(getIconFactory().getIcon(
view.getDescriptor().getIconImageURL(), IIconFactory.SMALL_ICON_SIZE));
internalFrame.setResizable(true);
internalFrame.setClosable(false);
internalFrame.setMaximizable(true);
internalFrame.setIconifiable(true);
internalFrame.getContentPane().add(view.getPeer(), BorderLayout.CENTER);
internalFrame.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
internalFrame.setGlassPane(createHermeticGlassPane());
return internalFrame;
}
内容来源于网络,如有侵权,请联系作者删除!