本文整理了Java中javax.swing.JDialog.setModalityType()
方法的一些代码示例,展示了JDialog.setModalityType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JDialog.setModalityType()
方法的具体详情如下:
包路径:javax.swing.JDialog
类名称:JDialog
方法名:setModalityType
暂无
代码示例来源:origin: stackoverflow.com
JDialog dialog = new JDialog ();
dialog.setModal (true);
dialog.setAlwaysOnTop (true);
dialog.setModalityType (ModalityType.APPLICATION_MODAL);
代码示例来源:origin: eugener/oxbow
public void setModalityType( ModalityType modalityType ) {
dlg.setModalityType(modalityType);
}
代码示例来源:origin: org.bidib.org.oxbow/swingbits
public void setModalityType(ModalityType modalityType) {
dlg.setModalityType(modalityType);
}
代码示例来源:origin: stackoverflow.com
// rename frame variable to dialog for clarity
final JDialog dialog = new JDialog();
dialog.setModalityType(ModalityType.APPLICATION_MODAL);
代码示例来源:origin: stackoverflow.com
JDialog d=new JDialog((Window)null);
d.setModalityType(ModalityType.TOOLKIT_MODAL);
d.setVisible(true);
代码示例来源:origin: stackoverflow.com
JFrame frame = new JFrame();
JDialog window = new JDialog(frame); // the frame is the parent
window.setModalityType(ModalityType.APPLICATION_MODAL);
window.setVisible(true); // must set modality first before making visible
代码示例来源:origin: stackoverflow.com
JOptionPane pane = new JOptionPane("dialog 2", JOptionPane.INFORMATION_MESSAGE);
JDialog dialog = pane.createDialog("Message");
dialog.setModalityType(Dialog.ModalityType.DOCUMENT_MODAL);
dialog.setVisible(true);
代码示例来源:origin: stackoverflow.com
if (source == DwellMenuItem) {
System.out.println("calling dwell");
SqlValuesInHorizantal ob = new SqlValuesInHorizantal(); //
Window parentWindow = SwingUtilities.getWindowAncestor(this);
JDialog dialog = new JDialog(parentWindow, "Dialog Title");
dialog.setModalityType(ModalityType.MODELESS); //!! or make this modal if desired
dialog.getContentPane().add(ob);
dialog.pack();
dialog.setLocationRelativeTo(null);
dialog.setVisible(true);
// getAppletContext().showDocument(order1);
}
代码示例来源:origin: stackoverflow.com
JFrame frame = new JFrame();
frame.setBounds(0,0,400,200);
frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
// Special attention to this line, do not use same JFrame, create a dummy JFrame
// If you want to save memory you can also use new JDialog((JFrame)null)
JDialog jd = new JDialog(new JFrame());
jd.setModalityType(Dialog.ModalityType.MODELESS);
jd.setBounds(0,0,100, 100);
jd.setVisible(true);
代码示例来源:origin: stackoverflow.com
JDialog dialog = new JDialog ();
dialog.setModal (true);
dialog.setAlwaysOnTop (true);
dialog.setModalityType (ModalityType.APPLICATION_MODAL);
代码示例来源:origin: ontop/ontop
private void cmdAddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmdAddActionPerformed
// Open a save dialog if it is a new query
JDialog saveDialog = new JDialog();
saveDialog.setTitle("New Query");
saveDialog.setModalityType(ModalityType.MODELESS);
SaveQueryPanel savePanel = new SaveQueryPanel("", saveDialog, queryController);
saveDialog.getContentPane().add(savePanel, java.awt.BorderLayout.CENTER);
saveDialog.pack();
DialogUtils.centerDialogWRTParent(this, saveDialog);
DialogUtils.installEscapeCloseOperation(saveDialog);
saveDialog.setVisible(true);
}//GEN-LAST:event_cmdAddActionPerformed
代码示例来源:origin: UNIVALI-LITE/Portugol-Studio
private void configuraLoader() {
boolean usandoTemaDark = Configuracoes.getInstancia().isTemaDark();
String caminhoIcone = String.format("/br/univali/ps/ui/icones/%s/grande/load.gif", usandoTemaDark ? "Dark" : "Portugol");
Icon icone = new ImageIcon(getClass().getResource(caminhoIcone));
indicadorProgresso = new JDialog();
indicadorProgresso.setUndecorated(true);
JPanel painel = new JPanel();
painel.setLayout(new BoxLayout(painel, BoxLayout.Y_AXIS));
painel.setBackground(ColorController.FUNDO_CLARO);
painel.add(new JLabel(icone, JLabel.CENTER));
JLabel instalando = new JLabel("Baixando...", JLabel.CENTER);
instalando.setForeground(ColorController.COR_LETRA);
instalando.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
painel.add(instalando);
indicadorProgresso.add(painel);
indicadorProgresso.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
indicadorProgresso.pack();
indicadorProgresso.setLocationRelativeTo(Lancador.getInstance().getJFrame());
}
代码示例来源:origin: UNIVALI-LITE/Portugol-Studio
private void configuraLoader() {
boolean usandoTemaDark = Configuracoes.getInstancia().isTemaDark();
String caminhoIcone = String.format("/br/univali/ps/ui/icones/%s/grande/load.gif", usandoTemaDark ? "Dark" : "Portugol");
Icon icone = new ImageIcon(getClass().getResource(caminhoIcone));
indicadorProgresso = new JDialog();
indicadorProgresso.setUndecorated(true);
JPanel painel = new JPanel();
painel.setLayout(new BoxLayout(painel, BoxLayout.Y_AXIS));
painel.setBackground(ColorController.FUNDO_CLARO);
painel.add(new JLabel(icone, JLabel.CENTER));
JLabel instalando = new JLabel("Instalando...", JLabel.CENTER);
instalando.setForeground(ColorController.COR_LETRA);
instalando.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
painel.add(instalando);
indicadorProgresso.add(painel);
indicadorProgresso.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
indicadorProgresso.pack();
indicadorProgresso.setLocationRelativeTo(Lancador.getInstance().getJFrame());
}
代码示例来源:origin: FellowTraveler/otapij
@Override
public String GetPasswordImageFromUser(String string) {
JDialog j = new GetPasswordImageDialog();
j.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
j.setAlwaysOnTop(true);
j.setVisible(true);
return GetPasswordImageDialog.GetPasswordImagePath();
}
代码示例来源:origin: com.quinsoft.zeidon/zeidon-joe
public static final void sysMessageBox( String msgTitle, String msgText )
{
//JOptionPane.showMessageDialog( null, msgText, msgTitle, JOptionPane.PLAIN_MESSAGE );
JOptionPane pane = new JOptionPane(msgText, JOptionPane.INFORMATION_MESSAGE);
JDialog dialog = pane.createDialog(msgTitle);
dialog.setModalityType(ModalityType.MODELESS);
dialog.setAlwaysOnTop(true);
dialog.setVisible(true);
}
代码示例来源:origin: net.sf.doolin/doolin-gui
/**
* Creates a {@link JDialog}.
*
* @see SwingUtils#createWindow(Class, java.awt.Component)
*/
@Override
protected JDialog buildWindow() {
JDialog dialog = SwingUtils.createWindow(JDialog.class,
getActionContext().getComponent());
dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
dialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
return dialog;
}
代码示例来源:origin: FellowTraveler/otapij
@Override
public void runOne(String szDisplay, OTPassword theOutput) {
if (null == theOutput) {
System.out.println("JavaCallback.runOne: Failure: theOutput variable (for password to be returned) is null!");
return;
}
if (!Utility.VerifyStringVal(szDisplay)) {
System.out.println("JavaCallback.runOne: Failure: strDisplay string (telling you what password to type) is null!");
return;
}
JDialog j = new OTPasswordDialog(null, true, szDisplay);
j.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
j.setAlwaysOnTop(true);
j.setVisible(true);
OTPasswordDialog.getPassword(theOutput);
}
代码示例来源:origin: FellowTraveler/otapij
@Override
public void runTwo(String szDisplay, OTPassword theOutput) {
if (null == theOutput) {
System.out.println("JavaCallback.runTwo: Failure: theOutput variable (for password to be returned) is null!");
return;
}
if (!Utility.VerifyStringVal(szDisplay)) {
System.out.println("JavaCallback.runOne: Failure: strDisplay string (telling you what password to type) is null!");
return;
}
JDialog j = new OTPwdConfirmDialog(null, true, szDisplay);
j.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
j.setAlwaysOnTop(true);
j.setVisible(true);
OTPwdConfirmDialog.getPassword(theOutput);
}
}
代码示例来源:origin: com.synaptix.toast/toast-tk-automation-client
public static void main(String[] args) {
String style = "body{line-height: 1.6em;font-family: \"Lucida Sans Unicode\", \"Lucida Grande\", \"Sans-Serif\";font-size: 12px;padding-left: 1em;}table{font-size: 12px;text-align: left;color: black;border: 3px solid darkgray;margin-top: 8px;margin-bottom: 12px;}th{font-size: 14px;font-weight: normal;padding: 6px 4px;border: 1px solid darkgray;}td{border: 1px solid darkgray;padding: 4px 4px;}h3{margin-top: 24pt;}div{margin: 0px;}.summary {text-align: justify;letter-spacing: 1px;padding: 2em;background-color: darkgray;color: white;} .resultSuccess {background-color:green;} .resultFailure {background-color:red;} .resultInfo {background-color:lightblue;} .resultError {background-color: orange;}.noResult {background-color: white;}.message {font-weight: bold;}";
String html = "<html><head>"+
"<style>"+style+"</style>"+
"</head><body><div class='summary'>Test</div></body></html>";
final BrowserPane swingbox = new BrowserPane();
swingbox.setText(html);
JDialog dialog = new JDialog();
dialog.setSize(500,300);
dialog.setTitle("Execution report..");
dialog.setLayout(new BorderLayout());
dialog.setModalityType(ModalityType.APPLICATION_MODAL);
JScrollPane panel = new JScrollPane();
panel.getViewport().add(swingbox);
dialog.add(panel);
dialog.setVisible(true);
}
代码示例来源:origin: FellowTraveler/otapij
@Override
public String GetJavaPathFromUser(String message) {
if (!bHaveTriedConfigPath) {
bHaveTriedConfigPath = true;
String pathFromConfig = configBean.getConfig(ConfigBean.Keys.JavaPath);
if (!pathFromConfig.isEmpty()) {
return pathFromConfig;
}
}
JDialog j = new GetJavaPath();
GetJavaPath.SetDisplayMessage(message);
j.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
j.setAlwaysOnTop(true);
j.setVisible(true);
String pathFromUser = GetJavaPath.GetJavaPath();
configBean.setConfig(ConfigBean.Keys.JavaPath, pathFromUser);
return pathFromUser;
}
内容来源于网络,如有侵权,请联系作者删除!