Example usage for java.awt.event ItemListener ItemListener

List of usage examples for java.awt.event ItemListener ItemListener

Introduction

In this page you can find the example usage for java.awt.event ItemListener ItemListener.

Prototype

ItemListener

Source Link

Usage

From source file:net.sourceforge.pmd.cpd.GUI.java

public GUI() {
    frame = new JFrame("PMD Duplicate Code Detector (v " + PMDVersion.VERSION + ')');

    timeField.setEditable(false);/*from  w w  w  . j ava  2 s. c  o m*/

    JMenu fileMenu = new JMenu("File");
    fileMenu.setMnemonic('f');

    addSaveOptionsTo(fileMenu);

    JMenuItem exitItem = new JMenuItem("Exit");
    exitItem.setMnemonic('x');
    exitItem.addActionListener(new CancelListener());
    fileMenu.add(exitItem);
    JMenu viewMenu = new JMenu("View");
    fileMenu.setMnemonic('v');
    JMenuItem trimItem = new JCheckBoxMenuItem("Trim leading whitespace");
    trimItem.addItemListener(new ItemListener() {
        @Override
        public void itemStateChanged(ItemEvent e) {
            AbstractButton button = (AbstractButton) e.getItem();
            GUI.this.trimLeadingWhitespace = button.isSelected();
        }
    });
    viewMenu.add(trimItem);
    JMenuBar menuBar = new JMenuBar();
    menuBar.add(fileMenu);
    menuBar.add(viewMenu);
    frame.setJMenuBar(menuBar);

    // first make all the buttons
    JButton browseButton = new JButton("Browse");
    browseButton.setMnemonic('b');
    browseButton.addActionListener(new BrowseListener());
    goButton = new JButton("Go");
    goButton.setMnemonic('g');
    goButton.addActionListener(new GoListener());
    cancelButton = new JButton("Cancel");
    cancelButton.addActionListener(new CancelListener());

    JPanel settingsPanel = makeSettingsPanel(browseButton, goButton, cancelButton);
    progressPanel = makeProgressPanel();
    JPanel resultsPanel = makeResultsPanel();

    adjustLanguageControlsFor((LanguageConfig) LANGUAGE_SETS[0][1]);

    frame.getContentPane().setLayout(new BorderLayout());
    JPanel topPanel = new JPanel();
    topPanel.setLayout(new BorderLayout());
    topPanel.add(settingsPanel, BorderLayout.NORTH);
    topPanel.add(progressPanel, BorderLayout.CENTER);
    setProgressControls(false); // not running now
    frame.getContentPane().add(topPanel, BorderLayout.NORTH);
    frame.getContentPane().add(resultsPanel, BorderLayout.CENTER);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.pack();
    frame.setVisible(true);
}

From source file:de.codesourcery.eve.skills.ui.components.AbstractComponent.java

protected void linkComponentEnabledStates(final JToggleButton parent, final Component... children) {

    final boolean selected = parent.isSelected();

    for (Component child : children) {
        child.setEnabled(selected);//  w ww.  j  ava  2  s .co  m
    }

    parent.addItemListener(new ItemListener() {

        @Override
        public void itemStateChanged(ItemEvent e) {

            final boolean selected = e.getStateChange() == ItemEvent.SELECTED;

            for (Component child : children) {
                child.setEnabled(selected);
            }
        }
    });

}

From source file:org.thelq.stackexchange.dbimport.gui.GUI.java

public GUI(Controller passedController) {
    //Initialize logger
    logAppender = new GUILogAppender(this);

    //Set our Look&Feel
    try {/*from  w  w w .  ja  va2s.c  om*/
        if (SystemUtils.IS_OS_WINDOWS)
            UIManager.setLookAndFeel(new WindowsLookAndFeel());
        else
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    } catch (Exception e) {
        log.warn("Defaulting to Swing L&F due to exception", e);
    }

    this.controller = passedController;
    frame = new JFrame();
    frame.setTitle("Unified StackExchange Data Dump Importer v" + Controller.VERSION);
    frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

    //Setup menu
    JMenuBar menuBar = new JMenuBar();
    menuAdd = new JMenuItem("Add Folders/Archives");
    menuAdd.setMnemonic(KeyEvent.VK_F);
    menuBar.add(menuAdd);
    frame.setJMenuBar(menuBar);

    //Primary panel
    FormLayout primaryLayout = new FormLayout("5dlu, pref:grow, 5dlu, 5dlu, pref",
            "pref, top:pref, pref, fill:140dlu:grow, pref, fill:80dlu");
    PanelBuilder primaryBuilder = new PanelBuilder(primaryLayout)
            .border(BorderFactory.createEmptyBorder(5, 5, 5, 5));

    //DB Config panel
    primaryBuilder.addSeparator("Database Configuration", CC.xyw(1, 1, 2));
    FormLayout configLayout = new FormLayout("pref, 3dlu, pref:grow, 6dlu, pref",
            "pref, pref:grow, 3dlu, pref:grow, 3dlu, pref:grow, 3dlu, pref:grow, 3dlu, pref:grow, 3dlu, pref:grow");
    configLayout.setHonorsVisibility(true);
    final PanelBuilder configBuilder = new PanelBuilder(configLayout);
    configBuilder.addLabel("Server", CC.xy(1, 2), dbType = new JComboBox<DatabaseOption>(), CC.xy(3, 2));
    configBuilder.add(dbAdvanced = new JCheckBox("Show advanced options"), CC.xy(5, 2));
    configBuilder.addLabel("JDBC Connection", CC.xy(1, 4), jdbcString = new JTextField(15), CC.xyw(3, 4, 3));
    configBuilder.addLabel("Username", CC.xy(1, 6), username = new JTextField(10), CC.xy(3, 6));
    configBuilder.addLabel("Password", CC.xy(1, 8), password = new JPasswordField(10), CC.xy(3, 8));
    configBuilder.add(importButton = new JButton("Import"), CC.xywh(5, 6, 1, 3));
    //Add hidden
    JLabel dialectLabel = new JLabel("Dialect");
    dialectLabel.setVisible(false);
    configBuilder.add(dialectLabel, CC.xy(1, 10), dialect = new JTextField(10), CC.xyw(3, 10, 3));
    dialect.setVisible(false);
    JLabel driverLabel = new JLabel("Driver");
    driverLabel.setVisible(false);
    configBuilder.add(driverLabel, CC.xy(1, 12), driver = new JTextField(10) {
        @Override
        public void setText(String text) {
            if (StringUtils.isBlank(text))
                log.debug("Text is blank", new RuntimeException("Text " + text + " is blank"));
            super.setText(text);
        }
    }, CC.xyw(3, 12, 3));
    driver.setVisible(false);
    primaryBuilder.add(configBuilder.getPanel(), CC.xy(2, 2));

    //Options
    primaryBuilder.addSeparator("Options", CC.xyw(4, 1, 2));
    FormLayout optionsLayout = new FormLayout("pref, 3dlu, pref:grow", "");
    DefaultFormBuilder optionsBuilder = new DefaultFormBuilder(optionsLayout);
    optionsBuilder.append(disableCreateTables = new JCheckBox("Disable Creating Tables"), 3);
    optionsBuilder.append("Global Table Prefix", globalTablePrefix = new JTextField(7));
    optionsBuilder.append("Threads", threads = new JSpinner());
    //Save a core for the database
    int numThreads = Runtime.getRuntime().availableProcessors();
    numThreads = (numThreads != 1) ? numThreads - 1 : numThreads;
    threads.setModel(new SpinnerNumberModel(numThreads, 1, 100, 1));
    optionsBuilder.append("Batch Size", batchSize = new JSpinner());
    batchSize.setModel(new SpinnerNumberModel(500, 1, 500000, 1));
    primaryBuilder.add(optionsBuilder.getPanel(), CC.xy(5, 2));

    //Locations
    primaryBuilder.addSeparator("Dump Locations", CC.xyw(1, 3, 5));
    FormLayout locationsLayout = new FormLayout("pref, 15dlu, pref, 5dlu, pref, 5dlu, pref:grow, 2dlu, pref",
            "");
    locationsBuilder = new DefaultFormBuilder(locationsLayout, new ScrollablePanel()).background(Color.WHITE)
            .lineGapSize(Sizes.ZERO);
    locationsPane = new JScrollPane(locationsBuilder.getPanel());
    locationsPane.getViewport().setBackground(Color.white);
    locationsPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    locationsPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    primaryBuilder.add(locationsPane, CC.xyw(2, 4, 4));

    //Logger
    primaryBuilder.addSeparator("Log", CC.xyw(1, 5, 5));
    loggerText = new JTextPane();
    loggerText.setEditable(false);
    JPanel loggerTextPanel = new JPanel(new BorderLayout());
    loggerTextPanel.add(loggerText);
    JScrollPane loggerPane = new JScrollPane(loggerTextPanel);
    loggerPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    loggerPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    JPanel loggerPanePanel = new JPanel(new BorderLayout());
    loggerPanePanel.add(loggerPane);
    primaryBuilder.add(loggerPanePanel, CC.xyw(2, 6, 4));

    menuAdd.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            //TODO: Allow 7z files but handle corner cases
            final JFileChooser fc = new JFileChooser();
            fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
            fc.setMultiSelectionEnabled(true);
            fc.setDialogTitle("Select Folders/Archives");
            fc.addChoosableFileFilter(new FileNameExtensionFilter("Archives", "7z", "zip"));
            fc.addChoosableFileFilter(new FileFilter() {
                @Getter
                protected String description = "Folders";

                @Override
                public boolean accept(File file) {
                    return file.isDirectory();
                }
            });

            if (fc.showOpenDialog(frame) != JFileChooser.APPROVE_OPTION)
                return;

            //Add files and folders in a seperate thread while updating gui in EDT
            importButton.setEnabled(false);
            for (File curFile : fc.getSelectedFiles()) {
                DumpContainer dumpContainer = null;
                try {
                    if (curFile.isDirectory())
                        dumpContainer = new FolderDumpContainer(curFile);
                    else
                        dumpContainer = new ArchiveDumpContainer(controller, curFile);
                    controller.addDumpContainer(dumpContainer);
                } catch (Exception ex) {
                    String type = (dumpContainer != null) ? dumpContainer.getType() : "";
                    LoggerFactory.getLogger(getClass()).error("Cannot open " + type, ex);
                    String location = (dumpContainer != null) ? Utils.getLongLocation(dumpContainer) : "";
                    showErrorDialog(ex, "Cannot open " + location, curFile.getAbsolutePath());
                    continue;
                }
            }
            updateLocations();
            importButton.setEnabled(true);
        }
    });

    //Add options (Could be in a map, but this is cleaner)
    dbType.addItem(new DatabaseOption().name("MySQL 5.5.3+")
            .jdbcString("jdbc:mysql://127.0.0.1:3306/stackexchange?rewriteBatchedStatements=true")
            .dialect("org.hibernate.dialect.MySQL5Dialect").driver("com.mysql.jdbc.Driver"));
    dbType.addItem(new DatabaseOption().name("PostgreSQL 8.1")
            .jdbcString("jdbc:postgresql://127.0.0.1:5432/stackexchange")
            .dialect("org.hibernate.dialect.PostgreSQL81Dialect").driver("org.postgresql.Driver"));
    dbType.addItem(new DatabaseOption().name("PostgreSQL 8.2+")
            .jdbcString("jdbc:postgresql://127.0.0.1:5432/stackexchange")
            .dialect("org.hibernate.dialect.PostgreSQL82Dialect").driver("org.postgresql.Driver"));
    dbType.addItem(new DatabaseOption().name("SQL Server")
            .jdbcString("jbdc:jtds:mssql://127.0.0.1:1433/stackexchange")
            .dialect("org.hibernate.dialect.SQLServerDialect").driver("net.sourceforge.jtds.jdbc.Driver"));
    dbType.addItem(new DatabaseOption().name("SQL Server 2005+")
            .jdbcString("jbdc:jtds:mssql://127.0.0.1:1433/stackexchange")
            .dialect("org.hibernate.dialect.SQLServer2005Dialect").driver("net.sourceforge.jtds.jdbc.Driver"));
    dbType.addItem(new DatabaseOption().name("SQL Server 2008+")
            .jdbcString("jbdc:jtds:mssql://127.0.0.1:1433/stackexchange")
            .dialect("org.hibernate.dialect.SQLServer2008Dialect").driver("net.sourceforge.jtds.jdbc.Driver"));
    dbType.addItem(new DatabaseOption().name("H2").jdbcString("jdbc:h2:stackexchange")
            .dialect("org.hibernate.dialect.H2Dialect").driver("org.h2.Driver"));
    dbType.setSelectedItem(null);
    dbType.addItemListener(new ItemListener() {
        boolean shownMysqlWarning = false;

        public void itemStateChanged(ItemEvent e) {
            //Don't run this twice for a single select
            if (e.getStateChange() == ItemEvent.DESELECTED)
                return;

            DatabaseOption selectedOption = (DatabaseOption) dbType.getSelectedItem();
            if (selectedOption.name().startsWith("MySQL") && !shownMysqlWarning) {
                //Hide popup so you don't have to click twice on the dialog 
                dbType.setPopupVisible(false);
                JOptionPane.showMessageDialog(frame,
                        "Warning: Your server must be configured with character_set_server=utf8mb4"
                                + "\nOtherwise, data dumps that contain 4 byte UTF-8 characters will fail",
                        "MySQL Warning", JOptionPane.WARNING_MESSAGE);
                shownMysqlWarning = true;
            }

            setDbOption(selectedOption);
        }
    });

    //Show and hide advanced options with checkbox
    dbAdvanced.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            boolean selected = ((JCheckBox) e.getSource()).isSelected();
            driver.setVisible(selected);
            ((JLabel) driver.getClientProperty("labeledBy")).setVisible(selected);
            dialect.setVisible(selected);
            ((JLabel) dialect.getClientProperty("labeledBy")).setVisible(selected);
        }
    });

    importButton.addActionListener(new ActionListener() {
        protected void showImportError(String error) {
            JOptionPane.showMessageDialog(frame, error, "Configuration Error", JOptionPane.ERROR_MESSAGE);
        }

        protected void showInputErrorDatabase(String error) {
            if (dbType.getSelectedItem() == null)
                showImportError("No dbType specified, " + StringUtils.uncapitalize(error));
            else
                showImportError(error);
        }

        public void actionPerformed(ActionEvent e) {
            boolean validationPassed = false;
            if (controller.getDumpContainers().isEmpty())
                showImportError("Please add dump folders/archives");
            else if (StringUtils.isBlank(jdbcString.getText()))
                showInputErrorDatabase("Must specify JDBC String");
            else if (StringUtils.isBlank(driver.getText()))
                showInputErrorDatabase("Must specify driver");
            else if (StringUtils.isBlank(dialect.getText()))
                showInputErrorDatabase("Must specify hibernate dialect");
            else
                validationPassed = true;

            if (!validationPassed)
                return;

            //Disable all GUI components so they can't change anything during processing
            setGuiEnabled(false);

            //Run in new thread
            controller.getGeneralThreadPool().execute(new Runnable() {
                public void run() {
                    try {
                        start();
                    } catch (final Exception e) {
                        //Show an error message box
                        SwingUtilities.invokeLater(new Runnable() {
                            public void run() {
                                LoggerFactory.getLogger(getClass()).error("Cannot import", e);
                                showErrorDialog(e, "Cannot import", null);
                            }
                        });
                    }
                    //Renable GUI
                    SwingUtilities.invokeLater(new Runnable() {
                        public void run() {
                            setGuiEnabled(true);
                        }
                    });
                }
            });
        }
    });

    //Done, init logger
    logAppender.init();
    log.info("Finished creating GUI");

    //Display
    frame.setContentPane(primaryBuilder.getPanel());
    frame.pack();
    frame.setMinimumSize(frame.getSize());

    frame.setVisible(true);
}

From source file:net.pandoragames.far.ui.swing.FindFilePanel.java

private void initContentSearchPanel(SwingConfig config, ComponentRepository componentRepository) {

    this.add(Box.createRigidArea(new Dimension(1, SwingConfig.PADDING)));

    String title = localizer.localize("label.content-pattern");
    contentSearchPanel = new ContentSearchPanel(title, dataModel, config, componentRepository);
    contentSearchPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
    browseButtonListener.addComponentToBeDisabledForSingleFiles(contentSearchPanel);
    componentRepository.getSearchBaseListener().addToBeEnabled(contentSearchPanel);
    componentRepository.getResetDispatcher().addToBeEnabled(contentSearchPanel);
    this.add(contentSearchPanel);

    inversionFlag = new JCheckBox(localizer.localize("label.exclude-matches"));
    inversionFlag.setAlignmentX(Component.LEFT_ALIGNMENT);
    inversionFlag.setSelected(dataModel.isInvertContentFilter());
    inversionFlag.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent event) {
            dataModel.setInvertContentFilter((ItemEvent.SELECTED == event.getStateChange()));
        }/*from  w w  w. jav  a 2  s. co  m*/
    });
    browseButtonListener.addComponentToBeDisabledForSingleFiles(inversionFlag);
    componentRepository.getSearchBaseListener().addToBeEnabled(inversionFlag);
    componentRepository.getResetDispatcher().addToBeEnabled(inversionFlag);
    contentSearchPanel.addFlag(inversionFlag);

    this.add(Box.createRigidArea(new Dimension(1, SwingConfig.PADDING)));
    this.add(Box.createVerticalGlue());

}

From source file:com.microsoft.azure.hdinsight.spark.ui.SparkSubmissionContentPanel.java

private void addSparkClustersLineItem() {
    JLabel sparkClusterLabel = new JLabel("Spark clusters(Linux only)");
    sparkClusterLabel.setToolTipText(//from   w ww.jav a2 s.c  o m
            "The HDInsight Spark cluster you want to submit your application to. Only Linux cluster is supported.");
    GridBagConstraints c11 = new GridBagConstraints();
    c11.gridx = 0;
    c11.gridy = 0;
    c11.insets = new Insets(margin, margin, 0, margin);
    add(sparkClusterLabel, new GridBagConstraints(0, displayLayoutCurrentRow, 1, 1, 0, 0,
            GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(margin, margin, 0, margin), 0, 0));

    clustersListComboBox = new ComboboxWithBrowseButton();
    clustersListComboBox.setButtonIcon(StreamUtil.getImageResourceFile(REFRESH_BUTTON_PATH));
    clustersListComboBox.getButton().setToolTipText("Refresh");
    clustersListComboBox.getButton().addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            Cursor cursor = getCursor();
            setCursor(new Cursor(Cursor.WAIT_CURSOR));
            List<IClusterDetail> clusterDetails = ClusterManagerEx.getInstance()
                    .getClusterDetails(submitModel.getProject());
            setCursor(cursor);
            submitModel.setClusterComboBoxModel(clusterDetails);
        }
    });
    clustersListComboBox.getComboBox().setToolTipText(
            "The HDInsight Spark cluster you want to submit your application to. Only Linux cluster is supported.");
    clustersListComboBox.getComboBox().addPropertyChangeListener(new PropertyChangeListener() {
        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            if (evt.getPropertyName() == "model" && evt.getNewValue() instanceof DefaultComboBoxModel) {
                int size = ((DefaultComboBoxModel) evt.getNewValue()).getSize();
                setVisibleForFixedErrorMessageLabel(ErrorMessageLabelTag.ClusterName.ordinal(), size <= 0);
            }
        }
    });

    add(clustersListComboBox,
            new GridBagConstraints(1, displayLayoutCurrentRow, 0, 1, 1, 0, GridBagConstraints.WEST,
                    GridBagConstraints.HORIZONTAL, new Insets(margin, margin, 0, margin), 0, 0));

    errorMessageLabels[ErrorMessageLabelTag.ClusterName.ordinal()] = new JLabel(
            "Cluster Name Should not be null");
    errorMessageLabels[ErrorMessageLabelTag.ClusterName.ordinal()]
            .setForeground(DarkThemeManager.getInstance().getErrorMessageColor());

    clustersListComboBox.getComboBox().addItemListener(new ItemListener() {
        @Override
        public void itemStateChanged(ItemEvent e) {
            setVisibleForFixedErrorMessageLabel(0, clustersListComboBox.getComboBox().getItemCount() == 0);
        }
    });

    add(errorMessageLabels[ErrorMessageLabelTag.ClusterName.ordinal()],
            new GridBagConstraints(1, ++displayLayoutCurrentRow, 0, 1, 1, 0, GridBagConstraints.WEST,
                    GridBagConstraints.NONE, new Insets(0, margin, 0, 0), 0, 0));
}

From source file:org.jax.maanova.test.gui.VolcanoPlotPanel.java

@SuppressWarnings("serial")
private JMenuBar createMenu() {
    JMenuBar menuBar = new JMenuBar();

    // the file menu
    JMenu fileMenu = new JMenu("File");
    fileMenu.add(this.saveGraphImageAction);
    menuBar.add(fileMenu);/*w w w. ja v a  2  s . c  om*/

    // the tools menu
    JMenu toolsMenu = new JMenu("Tools");
    JMenuItem configureGraphItem = new JMenuItem("Configure Graph...");
    configureGraphItem.addActionListener(new ActionListener() {
        /**
         * {@inheritDoc}
         */
        public void actionPerformed(ActionEvent e) {
            VolcanoPlotPanel.this.chartConfigurationDialog.setVisible(true);
        }
    });
    toolsMenu.add(configureGraphItem);
    toolsMenu.addSeparator();

    toolsMenu.add(new AbstractAction("Clear Selections") {
        /**
         * {@inheritDoc}
         */
        public void actionPerformed(ActionEvent e) {
            VolcanoPlotPanel.this.setSelectedIndices(new int[0]);
        }
    });
    toolsMenu.addSeparator();

    ButtonGroup dragButtonGroup = new ButtonGroup();
    JCheckBoxMenuItem selectModeCheckBox = new JCheckBoxMenuItem("Drag Cursor to Select");
    selectModeCheckBox.setSelected(true);
    this.dragToSelect = true;
    selectModeCheckBox.addItemListener(new ItemListener() {
        /**
         * {@inheritDoc}
         */
        public void itemStateChanged(ItemEvent e) {
            VolcanoPlotPanel.this.dragToSelect = e.getStateChange() == ItemEvent.SELECTED;
        }
    });
    dragButtonGroup.add(selectModeCheckBox);
    toolsMenu.add(selectModeCheckBox);

    JCheckBoxMenuItem zoomModeCheckBox = new JCheckBoxMenuItem("Drag Cursor to Zoom");
    zoomModeCheckBox.addItemListener(new ItemListener() {
        /**
         * {@inheritDoc}
         */
        public void itemStateChanged(ItemEvent e) {
            VolcanoPlotPanel.this.dragToZoom = e.getStateChange() == ItemEvent.SELECTED;
        }
    });
    dragButtonGroup.add(zoomModeCheckBox);
    toolsMenu.add(zoomModeCheckBox);
    toolsMenu.addSeparator();

    toolsMenu.add(new AbstractAction("Zoom Out") {
        /**
         * {@inheritDoc}
         */
        public void actionPerformed(ActionEvent e) {
            VolcanoPlotPanel.this.autoRangeChart();
        }
    });
    toolsMenu.addSeparator();

    JCheckBoxMenuItem showTooltipCheckbox = new JCheckBoxMenuItem("Show Info Popup for Nearest Point");
    showTooltipCheckbox.setSelected(true);
    this.showTooltip = true;
    showTooltipCheckbox.addItemListener(new ItemListener() {
        /**
         * {@inheritDoc}
         */
        public void itemStateChanged(ItemEvent e) {
            VolcanoPlotPanel.this.showTooltip = e.getStateChange() == ItemEvent.SELECTED;
            VolcanoPlotPanel.this.clearProbePopup();
        }
    });
    toolsMenu.add(showTooltipCheckbox);
    toolsMenu.addSeparator();

    toolsMenu.add(this.displayTestResultsAction);
    toolsMenu.addSeparator();

    toolsMenu.add(this.saveSelectedPointsMenuItem);

    JMenu selectPointsFromLisMenu = new JMenu("Select Points From Gene List");
    List<String> geneListNames = this.maanovaTestResult.getParentExperiment().getGeneListNames();
    if (geneListNames.isEmpty()) {
        JMenuItem noListsMenuItem = new JMenuItem("No Gene Lists Available");
        noListsMenuItem.setEnabled(false);
        selectPointsFromLisMenu.add(noListsMenuItem);
    } else {
        for (final String geneListName : geneListNames) {
            JMenuItem currGeneListMenuItem = new JMenuItem(
                    RUtilities.fromRIdentifierToReadableName(geneListName));
            currGeneListMenuItem.addActionListener(new ActionListener() {
                /**
                 * {@inheritDoc}
                 */
                public void actionPerformed(ActionEvent e) {
                    VolcanoPlotPanel.this.selectedIndicesFromGeneList(geneListName);
                }
            });
            selectPointsFromLisMenu.add(currGeneListMenuItem);
        }
    }
    toolsMenu.add(selectPointsFromLisMenu);

    menuBar.add(toolsMenu);

    // the help menu
    JMenu helpMenu = new JMenu("Help");
    JMenuItem helpMenuItem = new JMenuItem("Help...");
    Icon helpIcon = new ImageIcon(VolcanoPlotPanel.class.getResource("/images/action/help-16x16.png"));
    helpMenuItem.setIcon(helpIcon);
    helpMenuItem.addActionListener(new ActionListener() {
        /**
         * {@inheritDoc}
         */
        public void actionPerformed(ActionEvent e) {
            Maanova.getInstance().showHelp("volcano-plot", VolcanoPlotPanel.this);
        }
    });
    helpMenu.add(helpMenuItem);
    menuBar.add(helpMenu);

    return menuBar;
}

From source file:com.vladsch.idea.multimarkdown.settings.MultiMarkdownSettingsPanel.java

public MultiMarkdownSettingsPanel() {
    clearCustomCssButton.addActionListener(new ActionListener() {
        @Override// w  ww  .  j a  va  2s  .c om
        public void actionPerformed(ActionEvent e) {
            textCustomCss.setText("");
        }
    });

    btnLoadDefault.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            //String cssFileText = MultiMarkdownGlobalSettings.getInstance().getCssFileText(htmlThemeComboBox.getSelectedIndex());
            //String base64Css = Base64.encodeBase64URLSafeString(MultiMarkdownGlobalSettings.getInstance().getCssText().getBytes(Charset.forName("utf-8")));
            //String cssText = new String(Base64.decodeBase64(base64Css), Charset.forName("utf-8"));
            MultiMarkdownGlobalSettings settings = MultiMarkdownGlobalSettings.getInstance();
            textCustomCss.setText((useOldPreviewCheckBox.isSelected()
                    ? settings.getCssFileText(htmlThemeList.getSelectedIndex(), false)
                    : (includesColorsCheckBox.isSelected()
                            ? settings.getCssFileText(htmlThemeList.getSelectedIndex(), true)
                            : "")
                            + (includesLayoutCssCheckBox.isSelected() ? settings.getLayoutCssFileText() : "")
                            + (includesHljsCssCheckBox.isSelected() && useHighlightJsCheckBox.isSelected()
                                    ? settings.getHljsCssFileText(htmlThemeList.getSelectedIndex(), true)
                                    : "")));
        }
    });

    showHtmlTextCheckBox.addPropertyChangeListener(new PropertyChangeListener() {
        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            showHtmlTextStateChanged();
        }
    });

    showHtmlTextCheckBox.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            showHtmlTextStateChanged();
        }
    });

    focusEditorButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            textCustomCss.requestFocus();
        }
    });

    ItemListener itemListener1 = new ItemListener() {
        @Override
        public void itemStateChanged(ItemEvent e) {
            updateCustomCssControls();
        }
    };
    useCustomCssCheckBox.addItemListener(itemListener1);
    useHighlightJsCheckBox.addItemListener(itemListener1);

    textCustomCss.addDocumentListener(new DocumentAdapter() {
        @Override
        public void documentChanged(DocumentEvent e) {
            super.documentChanged(e);
            updateCustomCssControls();
        }
    });

    if (MultiMarkdownGlobalSettings.getInstance().fxPreviewFailedBuild.isFailedBuild()) {
        // set it and disable
        useOldPreviewCheckBox.setSelected(true);
        useOldPreviewCheckBox.setEnabled(false);
    }

    updateUseOldPreviewControls();
    ItemListener itemListener = new ItemListener() {
        @Override
        public void itemStateChanged(ItemEvent e) {
            updateUseOldPreviewControls();
        }
    };
    useOldPreviewCheckBox.addItemListener(itemListener);
    includesColorsCheckBox.addItemListener(itemListener);
    includesHljsCssCheckBox.addItemListener(itemListener);
    includesLayoutCssCheckBox.addItemListener(itemListener);

    if (htmlThemeComboBox instanceof ComboBox) {
        ((JComboBox) htmlThemeComboBox).addItemListener(new ItemListener() {
            @Override
            public void itemStateChanged(ItemEvent e) {
                if (((JComboBox) htmlThemeComboBox).getSelectedIndex() != htmlThemeList.getSelectedIndex()) {
                    htmlThemeList.setSelectedIndex(((JComboBox) htmlThemeComboBox).getSelectedIndex());
                }
            }
        });

        htmlThemeList.addListSelectionListener(new ListSelectionListener() {
            @Override
            public void valueChanged(ListSelectionEvent e) {
                if (((JComboBox) htmlThemeComboBox).getSelectedIndex() != htmlThemeList.getSelectedIndex()) {
                    ((JComboBox) htmlThemeComboBox).setSelectedIndex(htmlThemeList.getSelectedIndex());
                }
            }
        });
    }

    //tippingJarEditorPane.setText("" +
    //        "<html>\n" +
    //        "  <head>\n" +
    //        "  <style>\n" +
    //        "     td { text-align: right; margin 0; padding 0 10px !important; }\n" +
    //        "     td.pic { width: 0; }\n" +
    //        "     p, table, tr, body, div { margin: 0 !important; padding: 0 !important; }\n" +
    //        "     table { /*border: 1px solid black;*/ width: 100%; float: right !important; }\n" +
    //        "  </style>\n" +
    //        "  </head>\n" +
    //        "  <body>\n" +
    //        "      <table>\n" +
    //        "        <tr>\n" +
    //        "          <td><b>If you like my work then please feel free to tip me.<br>I will view it as a show of appreciation and as a reward for my effort.</b></td>\n" +
    //        "          <td class=\"pic\"><a href=\"http://flattr.com/thing/4603764/vschidea-multimarkdown-on-GitHub\" title=\"Donate monthly to vsch using Flattr\"><img src=\"https://raw.githubusercontent.com/vsch/idea-multimarkdown/master/assets/images/flattr-tips.png\" border=\"0\" width=\"43\" height=\"53\" alt=\"Donate monthly to vsch using Flattr\" /></a></td>\n" +
    //        "          <td class=\"pic\"><a href=\"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=NR7DAGTC8CXLU\" title=\"Donate once-off to vsch using Paypal\"><img src=\"https://raw.githubusercontent.com/vsch/idea-multimarkdown/master/assets/images/paypal-tips.png\" border=\"0\" width=\"43\" height=\"53\" alt=\"Donate once-off to vsch using Paypal\" /></a></td>\n" +
    //        "        </tr>\n" +
    //        "      </table>\n" +
    //        "  </body>\n" +
    //        "</html>\n" +
    //        "");

    String htmlText = "";
    try {
        htmlText = Resources.toString(getClass().getResource("/com/vladsch/idea/multimarkdown/NOTICE.html"),
                Charsets.UTF_8);
    } catch (IOException ex) {
        ex.printStackTrace();
    }

    MultiMarkdownPreviewEditor.setStyleSheet(noticesEditorPane);
    noticesEditorPane.setText(htmlText);

    //tippingJarEditorPane.addHyperlinkListener(listener);
    noticesEditorPane.addHyperlinkListener(SettingsPanelImpl.getHyperLinkListenerBrowseUrl());

    // we don't change these
    githubWikiLinksCheckBox.setEnabled(false);
    //githubWikiLinksLabel.setVisible(false);
}

From source file:br.edu.unifei.mestrado.view.GraphPartitioningVisualization.java

private JToggleButton getGroupCircleVertices() {
    if (groupCircleVertices == null) {
        groupCircleVertices = new JToggleButton("Group Circle Clusters");
        groupCircleVertices.addItemListener(new ItemListener() {
            public void itemStateChanged(ItemEvent e) {
                clusterAndRecolor(layout, e.getStateChange() == ItemEvent.SELECTED,
                        groupCircleVertices.isSelected());
                vv.repaint();/*  w  w w .j  a  v a 2 s . c  om*/
            }
        });
    }
    return groupCircleVertices;
}

From source file:net.openbyte.gui.CreateProjectFrame.java

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner Evaluation license - Gary Lee
    button1 = new JButton();
    textField1 = new JTextField();
    label1 = new JLabel();
    comboBox1 = new JComboBox<>();
    label2 = new JLabel();
    comboBox2 = new JComboBox<>();
    label3 = new JLabel();
    button2 = new JButton();

    //======== this ========
    setTitle("Project Creation");
    setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
    setResizable(false);/*from   w  ww .  j av  a 2s.c  o m*/
    Container contentPane = getContentPane();
    contentPane.setLayout(null);

    //---- button1 ----
    button1.setText("Create project");
    button1.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            button1ActionPerformed(e);
        }
    });
    contentPane.add(button1);
    button1.setBounds(new Rectangle(new Point(340, 170), button1.getPreferredSize()));
    contentPane.add(textField1);
    textField1.setBounds(10, 25, 245, textField1.getPreferredSize().height);

    //---- label1 ----
    label1.setText("Project Name");
    contentPane.add(label1);
    label1.setBounds(new Rectangle(new Point(10, 5), label1.getPreferredSize()));

    //---- comboBox1 ----
    comboBox1.setModel(new DefaultComboBoxModel<>(new String[] { "Minecraft Forge", "MCP", "Bukkit" }));
    comboBox1.addItemListener(new ItemListener() {
        @Override
        public void itemStateChanged(ItemEvent e) {
            comboBox1ItemStateChanged(e);
        }
    });
    contentPane.add(comboBox1);
    comboBox1.setBounds(10, 70, 245, comboBox1.getPreferredSize().height);

    //---- label2 ----
    label2.setText("Modification API");
    contentPane.add(label2);
    label2.setBounds(new Rectangle(new Point(10, 50), label2.getPreferredSize()));

    //---- comboBox2 ----
    comboBox2.setModel(new DefaultComboBoxModel<>(new String[] { "1.8.9", "1.7.10" }));
    contentPane.add(comboBox2);
    comboBox2.setBounds(10, 120, 245, comboBox2.getPreferredSize().height);

    //---- label3 ----
    label3.setText("Minecraft Version");
    contentPane.add(label3);
    label3.setBounds(new Rectangle(new Point(10, 100), label3.getPreferredSize()));

    //---- button2 ----
    button2.setText("Cancel");
    button2.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            button2ActionPerformed(e);
        }
    });
    contentPane.add(button2);
    button2.setBounds(new Rectangle(new Point(10, 170), button2.getPreferredSize()));

    { // compute preferred size
        Dimension preferredSize = new Dimension();
        for (int i = 0; i < contentPane.getComponentCount(); i++) {
            Rectangle bounds = contentPane.getComponent(i).getBounds();
            preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
            preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
        }
        Insets insets = contentPane.getInsets();
        preferredSize.width += insets.right;
        preferredSize.height += insets.bottom;
        contentPane.setMinimumSize(preferredSize);
        contentPane.setPreferredSize(preferredSize);
    }
    setSize(480, 240);
    setLocationRelativeTo(getOwner());
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
}

From source file:me.paddingdun.gen.code.gui.view.dbtable.TableView.java

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor.//from ww w.  j a  va  2  s .  c  o  m
 */
// <editor-fold defaultstate="collapsed" desc="Generated
// Code">//GEN-BEGIN:initComponents
private void initComponents() {

    setIconifiable(true);
    setMaximizable(true);
    setResizable(true);
    setTitle("?/");
    fileChooser = new javax.swing.JFileChooser();
    p = new javax.swing.JSplitPane();
    p0t = new javax.swing.JPanel();
    pt = new javax.swing.JSplitPane();
    ptt = new javax.swing.JScrollPane();
    ptb = new javax.swing.JScrollPane();
    ptba = new javax.swing.JPanel();
    pb = new javax.swing.JSplitPane();
    p0b = new javax.swing.JPanel();
    pbt = new javax.swing.JScrollPane();
    pbb = new javax.swing.JScrollPane();
    pbba = new javax.swing.JPanel();

    p.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
    pt.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
    pb.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);

    p.setTopComponent(p0t);
    p.setBottomComponent(p0b);

    p0t.setLayout(new BorderLayout());
    p0t.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), "?",
            TitledBorder.LEFT, TitledBorder.DEFAULT_POSITION, null, Color.BLACK));
    p0t.add(pt, BorderLayout.CENTER);
    p0t.addMouseListener(new MouseAdapter() {
        public void mouseClicked(MouseEvent e) {
            p.setDividerLocation(p.getHeight() - 40);
            EventQueue.invokeLater(new Runnable() {
                @Override
                public void run() {
                    pt.setDividerLocation(0.38);
                    EventQueue.invokeLater(new Runnable() {
                        @Override
                        public void run() {
                            pb.setDividerLocation(1.0d);
                        }
                    });
                }
            });
        }
    });

    p0b.setLayout(new BorderLayout());
    p0b.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), "",
            TitledBorder.LEFT, TitledBorder.DEFAULT_POSITION, null, Color.BLACK));
    p0b.add(pb, BorderLayout.CENTER);
    p0b.addMouseListener(new MouseAdapter() {
        public void mouseClicked(MouseEvent e) {
            p.setDividerLocation(30);
            EventQueue.invokeLater(new Runnable() {
                @Override
                public void run() {
                    pt.setDividerLocation(1.0d);

                    EventQueue.invokeLater(new Runnable() {
                        @Override
                        public void run() {
                            pb.setDividerLocation(0.38);
                        }
                    });
                }
            });
        }
    });

    pt.setTopComponent(ptt);
    pt.setBottomComponent(ptb);

    ptb.setViewportView(ptba);
    ptb.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);

    pb.setTopComponent(pbt);
    pb.setBottomComponent(pbb);

    pbb.setViewportView(pbba);
    pbb.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);

    tableColumnTable = new javax.swing.JTable() {
        public void editingStopped(ChangeEvent e) {
            TableCellEditor editor = this.getCellEditor();
            if (editor != null) {
                Object value = editor.getCellEditorValue();
                setTableColumnValue(value);
            }
            // System.out.println(MessageFormat.format("c:{0}-r:{1}",
            // this.getSelectedColumn(), this.getSelectedRow()));
            super.editingStopped(e);
        }
    };
    // ColumnModel?false;
    // table.setAutoCreateColumnsFromModel(false);
    ptt.setViewportView(tableColumnTable);

    /**
     * add by 2016422 ;
     */
    listColumnTable = new javax.swing.JTable() {
        public void editingStopped(ChangeEvent e) {
            TableCellEditor editor = this.getCellEditor();
            if (editor != null) {
                Object value = editor.getCellEditorValue();
                setListColumnValue(value);
            }
            // System.out.println(MessageFormat.format("c:{0}-r:{1}",
            // this.getSelectedColumn(), this.getSelectedRow()));
            super.editingStopped(e);
        }
    };
    listColumnTable.getTableHeader().addMouseListener(new MouseAdapter() {
        public void mouseClicked(MouseEvent e) {

        }
    });
    pbt.setViewportView(listColumnTable);

    jLabel1 = new javax.swing.JLabel();
    basePackageName = new javax.swing.JTextField();
    btnGen = new javax.swing.JButton();
    btnListColumnOk = new javax.swing.JButton();
    btnTableColumnOk = new javax.swing.JButton();
    jLabel2 = new javax.swing.JLabel();
    jcombo_sqlMapMarkUse = new javax.swing.JComboBox<Option<Integer>>();
    jLabel3 = new javax.swing.JLabel();
    jLabel4 = new javax.swing.JLabel();
    jLabel5 = new javax.swing.JLabel();
    jLabel6 = new javax.swing.JLabel();
    jLabel7 = new javax.swing.JLabel();
    jLabel8 = new javax.swing.JLabel();
    jLabel9 = new javax.swing.JLabel();
    jLabel10 = new javax.swing.JLabel();
    jLabel11 = new javax.swing.JLabel();
    jLabel12 = new javax.swing.JLabel();
    jLabel13 = new javax.swing.JLabel();
    jLabel14 = new javax.swing.JLabel();
    jLabel15 = new javax.swing.JLabel();
    jLabel16 = new javax.swing.JLabel();
    columnTitle = new javax.swing.JTextField();
    listTitle = new javax.swing.JTextField();
    jcombo_showGsonAnnotation = new javax.swing.JComboBox<Option<Boolean>>();
    jcombo_queryRenderShow = new javax.swing.JComboBox<Option<Boolean>>();
    jcombo_listRenderShow = new javax.swing.JComboBox<Option<Boolean>>();
    jcombo_editRenderShow = new javax.swing.JComboBox<Option<Boolean>>();
    jcombo_queryRenderWay = new javax.swing.JComboBox<Option<Integer>>();
    jcombo_listRenderWay = new javax.swing.JComboBox<Option<Integer>>();
    jcombo_editRenderWay = new javax.swing.JComboBox<Option<Integer>>();
    saveMethodPrefix = new javax.swing.JTextField();
    updateMethodPrefix = new javax.swing.JTextField();
    getMethodPrefix = new javax.swing.JTextField();
    deleteMethodPrefix = new javax.swing.JTextField();
    queryMethodPrefix = new javax.swing.JTextField();
    queryPagingMethodPrefix = new javax.swing.JTextField();

    queryColumnJson = new javax.swing.JTextArea(1, 10);
    javax.swing.JScrollPane cqpc = new javax.swing.JScrollPane(queryColumnJson);
    // customQueryProperty.setAutoscrolls(true);

    editValueGenWayJson = new javax.swing.JTextArea(1, 10);
    javax.swing.JScrollPane cevfw = new javax.swing.JScrollPane(editValueGenWayJson);

    //      editValidateJson = new javax.swing.JTextArea(1, 10);
    //      javax.swing.JScrollPane evj = new javax.swing.JScrollPane(editValidateJson);

    editValidateEasyuiString = new javax.swing.JTextArea(1, 10);
    javax.swing.JScrollPane evj = new javax.swing.JScrollPane(editValidateEasyuiString);

    jLabel1.setText("??");

    btnGen.setText("?");
    btnTableColumnOk.setText("Ok");
    btnListColumnOk.setText("Ok");

    jLabel2.setText("SQL??");

    // sqlMapMarkUse.setModel(null);

    jLabel3.setText("??");

    jLabel4.setText("?");

    jLabel5.setText("??");

    jLabel6.setText("?");

    jLabel7.setText("?");

    jLabel8.setText("?");

    jLabel9.setText("?gosn");

    jLabel10.setText("?");
    jLabel11.setText("?");

    jLabel12.setText("?");
    jLabel13.setText("?");

    jLabel14.setText("?");
    jLabel15.setText("?");

    jLabel16.setText("");

    TableLayout tableLayout_ptba = new TableLayout();
    double border = 2; // 0 1 2 3 4 5 6
    tableLayout_ptba.setColumn(new double[] { border, 50, 50, 80, -1, 50, 70, border });
    tableLayout_ptba.setRow(new double[] { border, 30, 30, 30, 130, 130, 130, border });
    ptba.setLayout(tableLayout_ptba);

    queryRenderShow.addElement(CollectionHelper.option("", Boolean.TRUE));
    queryRenderShow.addElement(CollectionHelper.option("?", Boolean.FALSE));
    jcombo_queryRenderShow.setModel(queryRenderShow);

    listRenderShow.addElement(CollectionHelper.option("", Boolean.TRUE));
    listRenderShow.addElement(CollectionHelper.option("?", Boolean.FALSE));
    jcombo_listRenderShow.setModel(listRenderShow);

    editRenderShow.addElement(CollectionHelper.option("", Boolean.TRUE));
    editRenderShow.addElement(CollectionHelper.option("?", Boolean.FALSE));
    jcombo_editRenderShow.setModel(editRenderShow);

    CollectionHelper.renderWayOption(queryRenderWay, "query");
    jcombo_queryRenderWay.setModel(queryRenderWay);

    CollectionHelper.renderWayOption(listRenderWay, "list");
    jcombo_listRenderWay.setModel(listRenderWay);

    CollectionHelper.renderWayOption(editRenderWay, "edit");
    jcombo_editRenderWay.setModel(editRenderWay);
    jcombo_editRenderWay.addItemListener(new ItemListener() {

        @SuppressWarnings("unchecked")
        @Override
        public void itemStateChanged(ItemEvent e) {
            if (e.getStateChange() == ItemEvent.SELECTED) { //??   
                Option<Integer> o = (Option<Integer>) e.getItem();
                String s = EditValueGenWayHelper.toEditValueShowWayJson(o.getValue());
                editRenderWayJson.setText(s);
            }
        }
    });

    int row = 1;
    ptba.add(new JLabel(""), MessageFormat.format("1,{0},2,{0}", row));
    ptba.add(columnTitle, MessageFormat.format("3,{0},4,{0}", row));
    ptba.add(btnTableColumnOk, MessageFormat.format("6,{0}", row));
    row++;
    ptba.add(jLabel14, MessageFormat.format("1,{0},2,{0}", row));
    ptba.add(jcombo_editRenderShow, MessageFormat.format("3,{0},4,{0}", row));
    ptba.add(btnListColumnOk, MessageFormat.format("6,{0}", row));
    row++;
    ptba.add(jLabel15, MessageFormat.format("1,{0},2,{0}", row));
    ptba.add(jcombo_editRenderWay, MessageFormat.format("3,{0},4,{0}", row));
    row++;
    ptba.add(new JLabel("?"), MessageFormat.format("1,{0},2,{0}", row));
    editRenderWayJson = new javax.swing.JTextArea(1, 10);
    editRenderWayJson.setLineWrap(true);
    editRenderWayJson.setWrapStyleWord(true);
    javax.swing.JScrollPane erwjj = new javax.swing.JScrollPane(editRenderWayJson);
    ptba.add(erwjj, MessageFormat.format("3,{0},6,{0}", row));
    row++;
    JLabel j1 = new JLabel("?");
    j1.setToolTipText("<html>\n" + "<table border=\"1\">\n" + "<tr>\n" + "   <th>?</th>\n"
            + "   <th>??</th>\n" + "</tr>\n" + "<tr>\n" + "   <td>new</td>\n"
            + "   <td>?,\"input\":, \"time\":??, \"nothing\":??</td>\n"
            + "</tr>\n" + "</table>\n" + "</html>");

    ptba.add(j1, MessageFormat.format("1,{0},2,{0}", row));
    ptba.add(cevfw, MessageFormat.format("3,{0},6,{0}", row));
    row++;
    ptba.add(new JLabel("JS?"), MessageFormat.format("1,{0},2,{0}", row));
    ptba.add(evj, MessageFormat.format("3,{0},6,{0}", row));

    // showGsonAnnotation.setModel(null);

    btnGen.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnGenActionPerformed(evt);
        }
    });

    btnListColumnOk.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnListColumnOkActionPerformed(evt);
        }
    });

    btnTableColumnOk.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnTableColumnOkActionPerformed(evt);
        }
    });

    TableLayout tableLayout_pbba = new TableLayout();
    // double border = 2; //0 1 2 3 4 5 6
    tableLayout_pbba.setColumn(new double[] { border, 50, 50, 80, -1, 50, 70, border });
    tableLayout_pbba.setRow(new double[] { border, 30, 30, 30, 30, 30, 130, border });
    pbba.setLayout(tableLayout_pbba);

    row = 1;
    pbba.add(jLabel16, MessageFormat.format("1,{0},2,{0}", row));
    pbba.add(listTitle, MessageFormat.format("3,{0},4,{0}", row));
    pbba.add(btnListColumnOk, MessageFormat.format("6,{0}", row));

    row++;
    pbba.add(jLabel12, MessageFormat.format("1,{0},2,{0}", row));
    pbba.add(jcombo_listRenderShow, MessageFormat.format("3,{0},4,{0}", row));
    row++;
    pbba.add(jLabel13, MessageFormat.format("1,{0},2,{0}", row));
    pbba.add(jcombo_listRenderWay, MessageFormat.format("3,{0},4,{0}", row));

    row++;
    pbba.add(jLabel10, MessageFormat.format("1,{0},2,{0}", row, row));
    pbba.add(jcombo_queryRenderShow, MessageFormat.format("3,{0},4,{0}", row));
    row++;
    pbba.add(jLabel11, MessageFormat.format("1,{0},2,{0}", row));
    pbba.add(jcombo_queryRenderWay, MessageFormat.format("3,{0},4,{0}", row));
    row++;
    pbba.add(new JLabel(""), MessageFormat.format("1,{0},2,{0}", row));
    pbba.add(cqpc, MessageFormat.format("3,{0},6,{0}", row));

    // TableLayout tableLayout_pba = new TableLayout();
    //// double border = 2; //0 1 2 3 4 5 6
    // tableLayout_pba.setColumn(new double[]{border, 50, 50, 80, -1, 50,
    // 70, border});
    // tableLayout_pba.setRow(new double[]{border,30, 30, 30, 30, 30, 30,
    // 30, 30, 30, 30, border});
    // pba.setLayout(tableLayout_pba);
    //
    // pba.add(jLabel1, "1,1,2,1");
    // pba.add(basePackageName, "3,1,5,1");
    // pba.add(btnGen, "6,1");
    //
    // pba.add(jLabel2, "1,2,2,2");
    // pba.add(jcombo_sqlMapMarkUse, "3,2,4,2");
    //
    // pba.add(jLabel9, "1,3,2,3");
    // pba.add(jcombo_showGsonAnnotation, "3,3,4,3");
    //
    // pba.add(jLabel3, "1,4,2,4");
    // pba.add(saveMethodPrefix, "3,4,4,4");
    //
    // pba.add(jLabel4, "1,5,2,5");
    // pba.add(updateMethodPrefix, "3,5,4,5");
    //
    // pba.add(jLabel5, "1,6,2,6");
    // pba.add(getMethodPrefix, "3,6,4,6");
    //
    // pba.add(jLabel6, "1,7,2,7");
    // pba.add(deleteMethodPrefix, "3,7,4,7");
    //
    // pba.add(jLabel7, "1,8,2,8");
    // pba.add(queryMethodPrefix, "3,8,4,8");
    //
    // pba.add(jLabel8, "1,9,2,9");
    // pba.add(queryPagingMethodPrefix, "3,9,4,9");

    sqlMapMarkUse.addElement(CollectionHelper.option("??", 1));
    sqlMapMarkUse.addElement(CollectionHelper.option("??", 2));
    jcombo_sqlMapMarkUse.setModel(sqlMapMarkUse);

    showGsonAnnotation.addElement(CollectionHelper.option("", Boolean.TRUE));
    showGsonAnnotation.addElement(CollectionHelper.option("?", Boolean.FALSE));
    jcombo_showGsonAnnotation.setModel(showGsonAnnotation);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(p, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE,
                    470, Short.MAX_VALUE));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(
            p, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 446,
            Short.MAX_VALUE));

    this.addComponentListener(new java.awt.event.ComponentAdapter() {
        public void componentShown(java.awt.event.ComponentEvent evt) {
            afterShow(evt);
        }
    });

    pack();
}