扩展JDialog类
public JDialog(Frame owner,
String title,
boolean modal,
GraphicsConfiguration gc)
Creates a modal or non-modal dialog with the specified title, owner Frame, and GraphicsConfiguration.
NOTE: Any popup components (JComboBox, JPopupMenu, JMenuBar) created within a modal dialog will be forced to be lightweight. Parameters:
owner - the Frame from which the dialog is displayed
title - the String to display in the dialog's title bar
modal - true for a modal dialog, false for one that allows other windows to be active at the same time
gc - the GraphicsConfiguration of the target screen device. If gc is null, the same GraphicsConfiguration as the owning Frame is used.
把modal参数设为true就行了
public JDialog(Frame owner,
String title,
boolean modal,
GraphicsConfiguration gc)
Creates a modal or non-modal dialog with the specified title, owner Frame, and GraphicsConfiguration.
NOTE: Any popup components (JComboBox, JPopupMenu, JMenuBar) created within a modal dialog will be forced to be lightweight. Parameters:
owner - the Frame from which the dialog is displayed
title - the String to display in the dialog's title bar
modal - true for a modal dialog, false for one that allows other windows to be active at the same time
gc - the GraphicsConfiguration of the target screen device. If gc is null, the same GraphicsConfiguration as the owning Frame is used.
把modal参数设为true就行了
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货