Package javax.swing

Examples of javax.swing.JDialog


        init(title);
    }

    private void init(String title) {
        diag = new JDialog(frame, title, false);

        int activePreview = Globals.prefs.getInt("activePreview");
        preview = new PreviewPanel(null, new MetaData(),
                activePreview == 0 ? Globals.prefs.get("preview0") : Globals.prefs.get("preview1"));
View Full Code Here


            putValue(SHORT_DESCRIPTION, Globals.lang("Automatically set file links for this entry")
                    +" (Alt-F)");
        }

        public void actionPerformed(ActionEvent event) {
            JDialog diag = new JDialog(frame, true);
            final FileListTableModel tableModel = new FileListTableModel();
            tableModel.setContent(entry.getField(GUIGlobals.FILE_FIELD));
            FileListEditor.autoSetLinks(entry, tableModel, panel.metaData(), new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    if (e.getID() > 0) {
View Full Code Here

            e.printStackTrace();
        }

        lpd.dispose();
        if (!lpd.abort()) {
            JDialog dialog = new JDialog(dialogParent, LangageManager
                    .getProperty("statistic.statistic"));
            JTabbedPane tab = new JTabbedPane();
            SummaryPanel panel = new SummaryPanel();
            panel.getValidFileCountLabel().setText(
                    collector.getStatistic().getValidFileCount() + "");
            panel.getInvalidFileCountLabel().setText(
                    collector.getStatistic().getInvalidFileCount() + "");
            panel.getTotalMusicTimeLabel().setText(
                    collector.getStatistic().getTotalDuration());
            panel.getTotalFileSize().setText(
                    collector.getStatistic().getTotalFileSize());
            tab.addTab(LangageManager
                    .getProperty("statistic.summary"), panel);
            tab.addTab(LangageManager
                    .getProperty("statistic.codecs"), CategoryPanelCreator.createFor(collector
                    .getStatistic(), Statistic.MAP_CODEC, LangageManager
                    .getProperty("statistic.categorydescription.codec")));
            tab.addTab(LangageManager
                    .getProperty("statistic.bitrate"), CategoryPanelCreator
                    .createBitratePanel(collector.getStatistic()));
            tab.addTab(LangageManager
                    .getProperty("statistic.sampling"), CategoryPanelCreator.createFor(collector
                    .getStatistic(), Statistic.MAP_SAMPLING, LangageManager
                    .getProperty("statistic.categorydescription.sampling")));
            dialog.getContentPane().add(tab);
            dialog.pack();
      // Center dialog.
      dialog.setLocationRelativeTo(null);
            dialog.setVisible(true);
        }
    }
View Full Code Here

  protected JDialog presetsFrame = null; // persistent popup

  protected TabbedSettingsPanel presetsPanel = null;

  protected void setupPresetsPanel() {
    presetsFrame = new JDialog(TreeViewFrame.this, "Presets", true);
    presetsPanel = new TabbedSettingsPanel();

    UrlPresetsEditor presetEditor = new UrlPresetsEditor(
        getGeneUrlPresets());
    presetEditor.setTitle("Gene Url Presets");
View Full Code Here

            .getSingleton())), BorderLayout.CENTER);
        LogBuffer buffer = LogBuffer.getSingleton();
        buffer.setLog(true);
        inner.add(new LogSettingsPanel(buffer),
            BorderLayout.SOUTH);
        final JDialog top = new JDialog(TreeViewFrame.this,
            "JTV Messages", false);
        top.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        top.setContentPane(inner);
        top.pack();
        top.setLocationRelativeTo(TreeViewFrame.this);
        top.setVisible(true);
      }
    });
    menubar.setMnemonic(KeyEvent.VK_M);

    menubar.addMenuItem("Documentation...", new ActionListener() {
View Full Code Here

        colorButton = new JButton(language.getText("colorButton"));
        colorButton.setBackground(selectedTasks[0].getColor());
        final String colorChooserTitle = language.getText("selectColor");
        colorButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                JDialog dialog;
                dialog = JColorChooser.createDialog(GanttTaskPropertiesBean.this, colorChooserTitle,
                        true, GanttDialogProperties.colorChooser,
                        new ActionListener() {
                            public void actionPerformed(ActionEvent e) {
                                colorButton
                                        .setBackground(GanttDialogProperties.colorChooser
                                                .getColor());
                                isColorChanged = true;
                            }
                        }

                        , new ActionListener() {
                            public void actionPerformed(ActionEvent e) {
                                // nothing to do for "Cancel"
                            }
                        });

                /*
                 * AbstractColorChooserPanel[] panels =
                 * GanttDialogProperties.colorChooser.getChooserPanels();
                 * GanttDialogProperties.colorChooser.removeChooserPanel(panels[0]);
                 * GanttDialogProperties.colorChooser.addChooserPanel(panels[0]);
                 */

                GanttDialogProperties.colorChooser.setColor(colorButton
                        .getBackground());
                dialog.show();
            }
        });

        colorSpace = new JButton(language.getText("defaultColor"));
        colorSpace.setBackground(GanttGraphicArea.taskDefaultColor);
View Full Code Here

   * This is the default constructor
   */
  public JPanel_AjoutDossier(Frame owner) {
    super();
    initialize();
    dialog = new JDialog(owner,true);
    dialog.add(this);
    dialog.setSize(400,400);
    dialog.setTitle("S�lectionner un dossier...");
    dialog.setResizable(false);
    dialog.setLocationRelativeTo(this.getParent());
View Full Code Here

                ActionListener onCancelPressing = new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        // nothing to do for "Cancel"
                    }
                };
                JDialog dialog = JColorChooser.createDialog(myParentComponent,
                        myi18n.getColorChooserTitle(option), true,
                        ourColorChooser, onOkPressing, onCancelPressing);
                ourColorChooser.setColor(colorButton.getBackground());
                dialog.setVisible(true);
            };
        };
        colorButton.setAction(action);
        colorButton.setBackground(option.getValue());
        return colorButton;
View Full Code Here

import javax.swing.JDialog;

import edu.stanford.genetics.treeview.app.LinkedViewApp;
public class ButtonTest {
  public static final void main(final String[] argv) {
    JDialog jd = new JDialog();
    JButton but = new JButton("Push Me");
    but.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        LinkedViewApp.main(argv);
      }
    });
    jd.add(but);
    jd.setVisible(true);
  }
View Full Code Here

    public void showDialog(Component content, Action[] buttonActions) {
      showDialog(content, buttonActions, "");
    }
    public void showDialog(Component content, Action[] buttonActions, String title) {
        JDialog result = new JDialog(myMainFrame, true);
        result.setTitle(title);
        final Commiter commiter = new Commiter();
        Action okAction = null;
        Action cancelAction = null;
        Box buttonBox = Box.createHorizontalBox();
        for (int i = 0; i < buttonActions.length; i++) {
            Action nextAction = buttonActions[i];
            JButton nextButton = null;
            if (nextAction instanceof OkAction) {
                nextAction = createOkAction(nextAction, result, commiter);
                okAction = nextAction;
                nextButton = new JButton(nextAction);
                result.getRootPane().setDefaultButton(nextButton);
            }
            if (nextAction instanceof CancelAction) {
                nextAction = createCancelAction(nextAction, result, commiter);
                cancelAction = nextAction;
                result.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
                        KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0),
                        nextAction.getValue(Action.NAME));
                result.getRootPane().getActionMap().put(
                        nextAction.getValue(Action.NAME), nextAction);
            }
            if (nextButton == null) {
                nextButton = new JButton(nextAction);
            }
            buttonBox.add(nextButton);
            if (i < buttonActions.length - 1) {
                buttonBox.add(Box.createHorizontalStrut(5));
            }
        }
        result.getContentPane().setLayout(new BorderLayout());
        result.getContentPane().add(content, BorderLayout.CENTER);
        //
        JPanel buttonPanel = new JPanel(new BorderLayout());
        buttonPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 5));
        buttonPanel.add(buttonBox, BorderLayout.EAST);
        result.getContentPane().add(buttonPanel, BorderLayout.SOUTH);
        //
        result.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        final Action localOkAction = okAction;
        final Action localCancelAction = cancelAction;
        result.addWindowListener(new WindowAdapter() {
            public void windowClosed(WindowEvent e) {
                if (localCancelAction != null && !commiter.isCommited()) {
                    localCancelAction.actionPerformed(null);
                }
            }
        });
        result.pack();
        // setSize(300, 300);
        DialogAligner.center(result, myMainFrame);
        result.setVisible(true);
    }
View Full Code Here

TOP

Related Classes of javax.swing.JDialog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.