List of usage examples for javax.swing JDialog isVisible
@Transient public boolean isVisible()
From source file:org.myrobotlab.service.MarySpeech.java
private void showProgressPanel(List<ComponentDescription> comps, boolean install) { final ProgressPanel pp = new ProgressPanel(comps, install); final JOptionPane optionPane = new JOptionPane(pp, JOptionPane.PLAIN_MESSAGE, JOptionPane.DEFAULT_OPTION, null, new String[] { "Abort" }, "Abort"); // optionPane.setPreferredSize(new Dimension(640,480)); final JDialog dialog = new JDialog((Frame) null, "Progress", false); dialog.setContentPane(optionPane);//from ww w .jav a 2 s.c om optionPane.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { String prop = e.getPropertyName(); if (dialog.isVisible() && (e.getSource() == optionPane) && (prop.equals(JOptionPane.VALUE_PROPERTY))) { pp.requestExit(); dialog.setVisible(false); } } }); dialog.pack(); dialog.setVisible(true); new Thread(pp).start(); }