Example usage for javax.swing JDialog invalidate

List of usage examples for javax.swing JDialog invalidate

Introduction

In this page you can find the example usage for javax.swing JDialog invalidate.

Prototype

@Override
public void invalidate() 

Source Link

Document

Invalidates the container.

Usage

From source file:pl.otros.vfs.browser.JOtrosVfsBrowserDialog.java

protected JDialog createDialog(Component parent) throws HeadlessException {
    Frame toUse = (Frame) SwingUtilities.getAncestorOfClass(Frame.class, parent);
    final JDialog dialog = new JDialog(toUse);

    dialog.getContentPane().add(vfsBrowser);
    dialog.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
            cancelSelection();/*from w  ww.  java 2 s. c  o  m*/
        }
    });
    vfsBrowser.setApproveAction(new AbstractAction(Messages.getMessage("general.openButtonText")) {
        @Override
        public void actionPerformed(ActionEvent actionEvent) {
            returnValue = ReturnValue.Approve;
            dialog.dispose();
        }
    });
    vfsBrowser.setCancelAction(new AbstractAction(Messages.getMessage("general.cancelButtonText")) {
        @Override
        public void actionPerformed(ActionEvent actionEvent) {
            cancelSelection();
            dialog.dispose();
        }
    });
    dialog.setModal(true);
    dialog.invalidate();
    dialog.repaint();
    return dialog;
}