/** * Shows the dialog. * @return OK_OPTION or CANCEL_OPTION. */ public int showDialog() { pack(); setVisible(true); return returnCode; }
public void actionPerformed(ActionEvent e) { returnCode = OK_OPTION; chosenPath = textField.getText(); dispose(); } }
/** * Creates a new URIChooser. * @param d the parent dialog */ public URIChooser(JDialog d) { super(d); initialize(); }
public void actionPerformed(ActionEvent e) { if (uriChooser == null) { uriChooser = new URIChooser(JSVGViewerFrame.this); uriChooser.setFileFilter(new SVGFileFilter()); uriChooser.pack(); Rectangle fr = getBounds(); Dimension sd = uriChooser.getSize(); uriChooser.setLocation(fr.x + (fr.width - sd.width) / 2, fr.y + (fr.height - sd.height) / 2); if (uriChooser.showDialog() == URIChooser.OK_OPTION) { String s = uriChooser.getText(); if (s == null) return; int i = s.indexOf( '#' );
/** * Initializes the dialog */ protected void initialize() { setModal(true); listeners.put("BrowseButtonAction", new BrowseButtonAction()); listeners.put("OKButtonAction", new OKButtonAction()); listeners.put("CancelButtonAction", new CancelButtonAction()); listeners.put("ClearButtonAction", new ClearButtonAction()); setTitle(resources.getString("Dialog.title")); buttonFactory = new ButtonFactory(bundle, this); getContentPane().add( createURISelectionPanel(), BorderLayout.NORTH ); getContentPane().add( createButtonsPanel(), BorderLayout.SOUTH ); }
public void actionPerformed(ActionEvent e) { if (uriChooser == null) { uriChooser = new URIChooser(JSVGViewerFrame.this); uriChooser.setFileFilter(new SVGFileFilter()); uriChooser.pack(); Rectangle fr = getBounds(); Dimension sd = uriChooser.getSize(); uriChooser.setLocation(fr.x + (fr.width - sd.width) / 2, fr.y + (fr.height - sd.height) / 2); if (uriChooser.showDialog() == URIChooser.OK_OPTION) { String s = uriChooser.getText(); if (s == null) return; int i = s.indexOf( '#' );
/** * Initializes the dialog */ protected void initialize() { setModal(true); listeners.put("BrowseButtonAction", new BrowseButtonAction()); listeners.put("OKButtonAction", new OKButtonAction()); listeners.put("CancelButtonAction", new CancelButtonAction()); listeners.put("ClearButtonAction", new ClearButtonAction()); setTitle(resources.getString("Dialog.title")); buttonFactory = new ButtonFactory(bundle, this); getContentPane().add( createURISelectionPanel(), BorderLayout.NORTH ); getContentPane().add( createButtonsPanel(), BorderLayout.SOUTH ); }
/** * Shows the dialog. * @return OK_OPTION or CANCEL_OPTION. */ public int showDialog() { pack(); setVisible(true); return returnCode; }
/** * Creates a new URIChooser. * @param f the parent frame */ public URIChooser(JFrame f) { super(f); initialize(); }
public void actionPerformed(ActionEvent e) { returnCode = CANCEL_OPTION; dispose(); textField.setText(chosenPath); } }
/** * Creates a new URIChooser. * @param f the parent frame */ public URIChooser(JFrame f) { super(f); initialize(); }
public void actionPerformed(ActionEvent e) { returnCode = OK_OPTION; chosenPath = textField.getText(); dispose(); } }
/** * Creates a new URIChooser. * @param d the parent dialog */ public URIChooser(JDialog d) { super(d); initialize(); }
public void actionPerformed(ActionEvent e) { returnCode = CANCEL_OPTION; dispose(); textField.setText(chosenPath); } }