Example usage for javax.swing JCheckBox JCheckBox

List of usage examples for javax.swing JCheckBox JCheckBox

Introduction

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

Prototype

public JCheckBox() 

Source Link

Document

Creates an initially unselected check box button with no text, no icon.

Usage

From source file:biomine.bmvis2.pipeline.NodeLabelOperation.java

public JComponent getSettingsComponent(final SettingsChangeCallback v, VisualGraph graph) {
    JPanel ret = new JPanel();
    ret.setLayout(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
    c.fill = GridBagConstraints.HORIZONTAL;
    c.weightx = 1;//from  w  ww  . java  2 s. c  om
    c.weighty = 0;
    c.gridy = 0;
    final Set<String> avail = graph.getAvailableNodeLabels();

    for (final String str : avail) {
        final JCheckBox box = new JCheckBox();
        box.setSelected(enabledLabels.contains(str));
        box.setAction(new AbstractAction(str) {
            public void actionPerformed(ActionEvent arg0) {
                if (box.isSelected() != enabledLabels.contains(str)) {
                    if (box.isSelected())
                        enabledLabels.add(str);
                    else
                        enabledLabels.remove(str);
                    v.settingsChanged(false);
                }
            }
        });
        ret.add(box, c);
        c.gridy++;
    }

    return ret;
}

From source file:cz.lidinsky.editor.TableCellEditor.java

/**
 *  Initialize all of the components// w  w  w . j a  v a 2 s  .  com
 */
public TableCellEditor() {
    // color chooser
    button = new JButton();
    button.setActionCommand("edit");
    button.addActionListener(this);
    button.setBorderPainted(false);
    button.addFocusListener(this);
    colorChooser = new JColorChooser();
    colorChooser.addChooserPanel(new AliasChooser());
    colorChooser.addFocusListener(this);
    dialog = JColorChooser.createDialog(button, "Pick a Color", true, colorChooser, this, null);
    // text editor
    textField = new JTextField();
    textField.addFocusListener(this);
    // combo chooser
    comboBox = new JComboBox();
    comboBox.addFocusListener(this);
    // check box
    checkBox = new JCheckBox();
    checkBox.addFocusListener(this);
}

From source file:REDemo.java

/** Construct the REDemo object including its GUI */
public REDemo() {
    super();//www .j a v  a2  s . c om

    JPanel top = new JPanel();
    top.add(new JLabel("Pattern:", JLabel.RIGHT));
    patternTF = new JTextField(20);
    patternTF.getDocument().addDocumentListener(new PatternListener());
    top.add(patternTF);
    top.add(new JLabel("Syntax OK?"));
    compiledOK = new JCheckBox();
    top.add(compiledOK);

    ChangeListener cl = new ChangeListener() {
        public void stateChanged(ChangeEvent ce) {
            tryMatch();
        }
    };
    JPanel switchPane = new JPanel();
    ButtonGroup bg = new ButtonGroup();
    match = new JRadioButton("Match");
    match.setSelected(true);
    match.addChangeListener(cl);
    bg.add(match);
    switchPane.add(match);
    find = new JRadioButton("Find");
    find.addChangeListener(cl);
    bg.add(find);
    switchPane.add(find);
    findAll = new JRadioButton("Find All");
    findAll.addChangeListener(cl);
    bg.add(findAll);
    switchPane.add(findAll);

    JPanel strPane = new JPanel();
    strPane.add(new JLabel("String:", JLabel.RIGHT));
    stringTF = new JTextField(20);
    stringTF.getDocument().addDocumentListener(new StringListener());
    strPane.add(stringTF);
    strPane.add(new JLabel("Matches:"));
    matchesTF = new JTextField(3);
    strPane.add(matchesTF);

    setLayout(new GridLayout(0, 1, 5, 5));
    add(top);
    add(strPane);
    add(switchPane);
}

From source file:MyData.java

public QuestionCellEditor() {
    super(new JCheckBox());
}

From source file:net.sf.mzmine.util.dialogs.AxesSetupDialog.java

/**
 * Constructor//from   w w w.  j a v a2  s . co m
 */
public AxesSetupDialog(XYPlot plot) {

    // Make dialog modal
    super(MZmineCore.getDesktop().getMainWindow(), true);

    xAxis = plot.getDomainAxis();
    yAxis = plot.getRangeAxis();

    NumberFormat defaultFormatter = NumberFormat.getNumberInstance();
    NumberFormat xAxisFormatter = defaultFormatter;
    if (xAxis instanceof NumberAxis)
        xAxisFormatter = ((NumberAxis) xAxis).getNumberFormatOverride();
    NumberFormat yAxisFormatter = defaultFormatter;
    if (yAxis instanceof NumberAxis)
        yAxisFormatter = ((NumberAxis) yAxis).getNumberFormatOverride();

    // Create labels and fields
    JLabel lblXTitle = new JLabel(xAxis.getLabel());
    JLabel lblXAutoRange = new JLabel("Auto range");
    JLabel lblXMin = new JLabel("Minimum");
    JLabel lblXMax = new JLabel("Maximum");
    JLabel lblXAutoTick = new JLabel("Auto tick size");
    JLabel lblXTick = new JLabel("Tick size");

    JLabel lblYTitle = new JLabel(yAxis.getLabel());
    JLabel lblYAutoRange = new JLabel("Auto range");
    JLabel lblYMin = new JLabel("Minimum");
    JLabel lblYMax = new JLabel("Maximum");
    JLabel lblYAutoTick = new JLabel("Auto tick size");
    JLabel lblYTick = new JLabel("Tick size");

    checkXAutoRange = new JCheckBox();
    checkXAutoRange.addActionListener(this);
    checkXAutoTick = new JCheckBox();
    checkXAutoTick.addActionListener(this);
    fieldXMin = new JFormattedTextField(xAxisFormatter);
    fieldXMax = new JFormattedTextField(xAxisFormatter);
    fieldXTick = new JFormattedTextField(xAxisFormatter);

    checkYAutoRange = new JCheckBox();
    checkYAutoRange.addActionListener(this);
    checkYAutoTick = new JCheckBox();
    checkYAutoTick.addActionListener(this);
    fieldYMin = new JFormattedTextField(yAxisFormatter);
    fieldYMax = new JFormattedTextField(yAxisFormatter);
    fieldYTick = new JFormattedTextField(yAxisFormatter);

    // Create a panel for labels and fields
    JPanel pnlLabelsAndFields = new JPanel(new GridLayout(0, 2));

    pnlLabelsAndFields.add(lblXTitle);
    pnlLabelsAndFields.add(new JPanel());
    pnlLabelsAndFields.add(lblXAutoRange);
    pnlLabelsAndFields.add(checkXAutoRange);
    pnlLabelsAndFields.add(lblXMin);
    pnlLabelsAndFields.add(fieldXMin);
    pnlLabelsAndFields.add(lblXMax);
    pnlLabelsAndFields.add(fieldXMax);
    if (xAxis instanceof NumberAxis) {
        pnlLabelsAndFields.add(lblXAutoTick);
        pnlLabelsAndFields.add(checkXAutoTick);
        pnlLabelsAndFields.add(lblXTick);
        pnlLabelsAndFields.add(fieldXTick);
    }

    // Empty row
    pnlLabelsAndFields.add(new JPanel());
    pnlLabelsAndFields.add(new JPanel());

    pnlLabelsAndFields.add(lblYTitle);
    pnlLabelsAndFields.add(new JPanel());
    pnlLabelsAndFields.add(lblYAutoRange);
    pnlLabelsAndFields.add(checkYAutoRange);
    pnlLabelsAndFields.add(lblYMin);
    pnlLabelsAndFields.add(fieldYMin);
    pnlLabelsAndFields.add(lblYMax);
    pnlLabelsAndFields.add(fieldYMax);
    if (yAxis instanceof NumberAxis) {
        pnlLabelsAndFields.add(lblYAutoTick);
        pnlLabelsAndFields.add(checkYAutoTick);
        pnlLabelsAndFields.add(lblYTick);
        pnlLabelsAndFields.add(fieldYTick);
    }

    // Create buttons
    JPanel pnlButtons = new JPanel();
    btnOK = new JButton("OK");
    btnOK.addActionListener(this);
    btnApply = new JButton("Apply");
    btnApply.addActionListener(this);
    btnCancel = new JButton("Cancel");
    btnCancel.addActionListener(this);

    pnlButtons.add(btnOK);
    pnlButtons.add(btnApply);
    pnlButtons.add(btnCancel);

    // Put everything into a main panel
    JPanel pnlAll = new JPanel(new BorderLayout());
    pnlAll.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
    add(pnlAll);

    pnlAll.add(pnlLabelsAndFields, BorderLayout.CENTER);
    pnlAll.add(pnlButtons, BorderLayout.SOUTH);

    pack();

    setTitle("Please set ranges for axes");
    setResizable(false);
    setLocationRelativeTo(MZmineCore.getDesktop().getMainWindow());

    getValuesToControls();

}

From source file:guineu.util.dialogs.AxesSetupDialog.java

/**
 * Constructor// w ww . j ava 2 s.c  om
 */
public AxesSetupDialog(XYPlot plot) {

    // Make dialog modal
    super(GuineuCore.getDesktop().getMainFrame(), true);

    xAxis = plot.getDomainAxis();
    yAxis = plot.getRangeAxis();

    NumberFormat defaultFormatter = NumberFormat.getNumberInstance();
    NumberFormat xAxisFormatter = defaultFormatter;
    if (xAxis instanceof NumberAxis) {
        xAxisFormatter = ((NumberAxis) xAxis).getNumberFormatOverride();
    }
    NumberFormat yAxisFormatter = defaultFormatter;
    if (yAxis instanceof NumberAxis) {
        yAxisFormatter = ((NumberAxis) yAxis).getNumberFormatOverride();
    }

    // Create labels and fields
    JLabel lblXTitle = new JLabel(xAxis.getLabel());
    JLabel lblXAutoRange = new JLabel("Auto range");
    JLabel lblXMin = new JLabel("Minimum");
    JLabel lblXMax = new JLabel("Maximum");
    JLabel lblXAutoTick = new JLabel("Auto tick size");
    JLabel lblXTick = new JLabel("Tick size");

    JLabel lblYTitle = new JLabel(yAxis.getLabel());
    JLabel lblYAutoRange = new JLabel("Auto range");
    JLabel lblYMin = new JLabel("Minimum");
    JLabel lblYMax = new JLabel("Maximum");
    JLabel lblYAutoTick = new JLabel("Auto tick size");
    JLabel lblYTick = new JLabel("Tick size");

    checkXAutoRange = new JCheckBox();
    checkXAutoRange.addActionListener(this);
    checkXAutoTick = new JCheckBox();
    checkXAutoTick.addActionListener(this);
    fieldXMin = new JFormattedTextField(xAxisFormatter);
    fieldXMax = new JFormattedTextField(xAxisFormatter);
    fieldXTick = new JFormattedTextField(xAxisFormatter);

    checkYAutoRange = new JCheckBox();
    checkYAutoRange.addActionListener(this);
    checkYAutoTick = new JCheckBox();
    checkYAutoTick.addActionListener(this);
    fieldYMin = new JFormattedTextField(yAxisFormatter);
    fieldYMax = new JFormattedTextField(yAxisFormatter);
    fieldYTick = new JFormattedTextField(yAxisFormatter);

    // Create a panel for labels and fields
    JPanel pnlLabelsAndFields = new JPanel(new GridLayout(0, 2));

    pnlLabelsAndFields.add(lblXTitle);
    pnlLabelsAndFields.add(new JPanel());
    pnlLabelsAndFields.add(lblXAutoRange);
    pnlLabelsAndFields.add(checkXAutoRange);
    pnlLabelsAndFields.add(lblXMin);
    pnlLabelsAndFields.add(fieldXMin);
    pnlLabelsAndFields.add(lblXMax);
    pnlLabelsAndFields.add(fieldXMax);
    if (xAxis instanceof NumberAxis) {
        pnlLabelsAndFields.add(lblXAutoTick);
        pnlLabelsAndFields.add(checkXAutoTick);
        pnlLabelsAndFields.add(lblXTick);
        pnlLabelsAndFields.add(fieldXTick);
    }

    // Empty row
    pnlLabelsAndFields.add(new JPanel());
    pnlLabelsAndFields.add(new JPanel());

    pnlLabelsAndFields.add(lblYTitle);
    pnlLabelsAndFields.add(new JPanel());
    pnlLabelsAndFields.add(lblYAutoRange);
    pnlLabelsAndFields.add(checkYAutoRange);
    pnlLabelsAndFields.add(lblYMin);
    pnlLabelsAndFields.add(fieldYMin);
    pnlLabelsAndFields.add(lblYMax);
    pnlLabelsAndFields.add(fieldYMax);
    if (yAxis instanceof NumberAxis) {
        pnlLabelsAndFields.add(lblYAutoTick);
        pnlLabelsAndFields.add(checkYAutoTick);
        pnlLabelsAndFields.add(lblYTick);
        pnlLabelsAndFields.add(fieldYTick);
    }

    // Create buttons
    JPanel pnlButtons = new JPanel();
    btnOK = new JButton("OK");
    btnOK.addActionListener(this);
    btnApply = new JButton("Apply");
    btnApply.addActionListener(this);
    btnCancel = new JButton("Cancel");
    btnCancel.addActionListener(this);

    pnlButtons.add(btnOK);
    pnlButtons.add(btnApply);
    pnlButtons.add(btnCancel);

    // Put everything into a main panel
    JPanel pnlAll = new JPanel(new BorderLayout());
    pnlAll.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
    add(pnlAll);

    pnlAll.add(pnlLabelsAndFields, BorderLayout.CENTER);
    pnlAll.add(pnlButtons, BorderLayout.SOUTH);

    pack();

    setTitle("Please set ranges for axes");
    setResizable(false);
    setLocationRelativeTo(GuineuCore.getDesktop().getMainFrame());

    getValuesToControls();

}

From source file:gtu._work.ui.DownloadMoveUI.java

private void initGUI() {
    try {//from ww w  .  j a va  2s  . c  o  m
        configProp = configUtil.loadConfig();

        BorderLayout thisLayout = new BorderLayout();
        getContentPane().setLayout(thisLayout);
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        {
            jTabbedPane1 = new JTabbedPane();
            getContentPane().add(jTabbedPane1, BorderLayout.CENTER);
            {
                jPanel1 = new JPanel();
                jTabbedPane1.addTab("jPanel1", null, jPanel1, null);
                {
                    isDeleteBox = new JCheckBox();
                    jPanel1.add(isDeleteBox);
                    isDeleteBox.setText("\u662f\u5426\u522a\u9664\u642c\u51fa\u7684\u76ee\u9304");
                    isDeleteBox.setPreferredSize(new java.awt.Dimension(383, 21));
                }
                {
                    jLabel4 = new JLabel();
                    jPanel1.add(jLabel4);
                    jLabel4.setText("\u4fdd\u7559\u7684\u526f\u6a94\u540d");
                }
                {
                    subFileNameText = new JTextField();
                    jPanel1.add(subFileNameText);
                    subFileNameText
                            .setText(".avi,.wmv,.mp4,.srt,.sub,.mkv,.rar,.rmvb,.idx,.zip,.7z,.flv,.asf,.ass");
                    subFileNameText.setPreferredSize(new java.awt.Dimension(304, 24));

                    if (configProp.containsKey(SUBFILENAME)) {
                        subFileNameText.setText(configProp.get(SUBFILENAME));
                    }
                }
                {
                    jLabel3 = new JLabel();
                    jPanel1.add(jLabel3);
                    jLabel3.setText("\u7b26\u5408\u7684\u6a94\u6848\u5927\u5c0f(KB)");
                }
                {
                    fileSizeText = new JTextField();
                    jPanel1.add(fileSizeText);
                    fileSizeText.setText("5000");
                    fileSizeText.setPreferredSize(new java.awt.Dimension(276, 24));

                    if (configProp.containsKey(FILESIZE)) {
                        fileSizeText.setText(configProp.get(FILESIZE));
                    }
                }
                {
                    jLabel2 = new JLabel();
                    jPanel1.add(jLabel2);
                    jLabel2.setText("\u672a\u5b8c\u6210\u526f\u6a94\u540d");
                }
                {
                    unCompleteFileSubNameText = new JTextField();
                    jPanel1.add(unCompleteFileSubNameText);
                    unCompleteFileSubNameText.setText(".td");
                    unCompleteFileSubNameText.setPreferredSize(new java.awt.Dimension(315, 24));

                    if (configProp.containsKey(UNCOMPLETEFILESUBNAME)) {
                        unCompleteFileSubNameText.setText(configProp.get(UNCOMPLETEFILESUBNAME));
                    }
                }
                {
                    jLabel1 = new JLabel();
                    jPanel1.add(jLabel1);
                    jLabel1.setText("\u4e0b\u8f09\u76ee\u9304");
                }
                {
                    downloadDirText = new JTextField();
                    JCommonUtil.jTextFieldSetFilePathMouseEvent(downloadDirText, true);
                    jPanel1.add(downloadDirText);
                    downloadDirText.setText("D:/TDDOWNLOAD");
                    downloadDirText.setPreferredSize(new java.awt.Dimension(328, 24));

                    if (configProp.containsKey(DOWNLOADDIR)) {
                        downloadDirText.setText(configProp.get(DOWNLOADDIR));
                    }
                }
                {
                    executeBtn = new JButton();
                    jPanel1.add(executeBtn);
                    executeBtn.setText("\u57f7\u884c");
                    {
                        newConfigBtn = new JButton("");
                        newConfigBtn.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent arg0) {
                                configUtil.next();
                                configProp = configUtil.loadConfig();
                                if (configProp.containsKey(SUBFILENAME)) {
                                    subFileNameText.setText(configProp.get(SUBFILENAME));
                                }
                                if (configProp.containsKey(FILESIZE)) {
                                    fileSizeText.setText(configProp.get(FILESIZE));
                                }
                                if (configProp.containsKey(UNCOMPLETEFILESUBNAME)) {
                                    unCompleteFileSubNameText.setText(configProp.get(UNCOMPLETEFILESUBNAME));
                                }
                                if (configProp.containsKey(DOWNLOADDIR)) {
                                    downloadDirText.setText(configProp.get(DOWNLOADDIR));
                                }
                            }
                        });
                        jPanel1.add(newConfigBtn);
                    }
                    executeBtn.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            executeBtnAction();
                            saveConfig();
                        }
                    });
                }
            }
            {
                jPanel2 = new JPanel();
                BorderLayout jPanel2Layout = new BorderLayout();
                jPanel2.setLayout(jPanel2Layout);
                jTabbedPane1.addTab("jPanel2", null, jPanel2, null);
                {
                    jScrollPane1 = new JScrollPane();
                    jPanel2.add(jScrollPane1, BorderLayout.CENTER);
                    jScrollPane1.setPreferredSize(new java.awt.Dimension(411, 262));
                    {
                        logArea = new JTextArea();
                        jScrollPane1.setViewportView(logArea);
                    }
                }
            }
        }
        pack();
        this.setSize(432, 329);
    } catch (Exception e) {
        //add your error handling code here
        e.printStackTrace();
    }
}

From source file:net.sf.jhylafax.SendDialog.java

public SendDialog(JFrame owner) {
    super(owner);

    moreDocumentsAction = new MoreDocumentsAction();
    previewCoverAction = new PreviewCoverAction();

    addNumberTextField();/*from   ww w .  j  a va 2  s  .  co m*/

    addDocumentsPanel();

    builder.append("", Builder.createButton(moreDocumentsAction));
    builder.nextLine();

    addDateControls();

    includeCoverCheckBox = new JCheckBox();
    includeCoverLabel = builder.append("", includeCoverCheckBox);
    builder.nextLine();

    initializeCoverPanel();
    coverPanel.setVisible(false);
    previewCoverAction.setEnabled(false);
    includeCoverCheckBox.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            coverPanel.setVisible(includeCoverCheckBox.isSelected());
            previewCoverAction.setEnabled(includeCoverCheckBox.isSelected());
            pack();
        }
    });

    getButtonPanel().add(Builder.createButton(previewCoverAction), 0);

    FaxJob job = new FaxJob();
    HylaFAXClientHelper.initializeFromSettings(job);
    setJob(job);

    updateLabels();
    pack();
}

From source file:gtu.log.finder.ExceptionLogFinderUI.java

private void initGUI() {
    try {// w  w w .j ava  2 s .c om
        JCommonUtil.defaultLookAndFeel();
        BorderLayout thisLayout = new BorderLayout();
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        getContentPane().setLayout(thisLayout);
        {
            jTabbedPane1 = new JTabbedPane();
            getContentPane().add(jTabbedPane1, BorderLayout.CENTER);
            {
                jPanel1 = new JPanel();
                BorderLayout jPanel1Layout = new BorderLayout();
                jPanel1.setLayout(jPanel1Layout);
                jTabbedPane1.addTab("?log", null, jPanel1, null);
                {
                    jPanel4 = new JPanel();
                    jPanel1.add(jPanel4, BorderLayout.NORTH);
                    jPanel4.setPreferredSize(new java.awt.Dimension(689, 115));
                    {
                        isExceptionLogChkBox = new JCheckBox();
                        jPanel4.add(isExceptionLogChkBox);
                        isExceptionLogChkBox.setText("\u53ea\u627e\u932f\u8aa4");
                    }
                    {
                        jLabel1 = new JLabel();
                        jPanel4.add(jLabel1);
                        jLabel1.setText("\u8cbc\u4e0alog\u6a94\u8def\u5f91");
                    }
                    {
                        srcFilePathText = new JTextField();
                        jPanel4.add(srcFilePathText);
                        srcFilePathText.setPreferredSize(new java.awt.Dimension(292, 22));
                        srcFilePathText.addMouseListener(new MouseAdapter() {
                            public void mouseClicked(MouseEvent evt) {
                                srcFilePathTextSetFileAction(evt);
                            }
                        });
                    }
                    {
                        jLabel3 = new JLabel();
                        jPanel4.add(jLabel3);
                        jLabel3.setText("\u524d\u7f6e\u884c\u6578");
                    }
                    {
                        preLineText = new JTextField();
                        jPanel4.add(preLineText);
                        preLineText.setText("5");
                        preLineText.setPreferredSize(new java.awt.Dimension(33, 22));
                    }
                    {
                        executeBtn = new JButton();
                        jPanel4.add(executeBtn);
                        executeBtn.setText("\u57f7\u884c\u89e3\u6790");
                        executeBtn.setPreferredSize(new java.awt.Dimension(107, 22));
                        executeBtn.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent evt) {
                                executeBtnAction();
                            }
                        });
                    }
                    {
                        jLabel4 = new JLabel();
                        jPanel4.add(jLabel4);
                        jLabel4.setText("\u76f4\u63a5\u8a2d\u5b9a\u89e3\u6790\u6a94\u8def\u5f91");
                        jLabel4.setPreferredSize(new java.awt.Dimension(119, 15));
                    }
                    {
                        setParseFileText = new JTextField();
                        jPanel4.add(setParseFileText);
                        setParseFileText.setPreferredSize(new java.awt.Dimension(507, 22));
                        setParseFileText.addMouseListener(new MouseAdapter() {
                            public void mouseClicked(MouseEvent evt) {
                                setParseFileBtnAction(evt);
                            }
                        });
                    }
                    {
                        jLabel2 = new JLabel();
                        jPanel4.add(jLabel2);
                        jLabel2.setText("\u641c\u5c0b\u95dc\u9375\u5b57");
                    }
                    {
                        searchText = new JTextField();
                        jPanel4.add(searchText);
                        searchText.setPreferredSize(new java.awt.Dimension(355, 22));
                    }
                    {
                        ignoreCaseCheckBox = new JCheckBox();
                        jPanel4.add(ignoreCaseCheckBox);
                        ignoreCaseCheckBox.setText("\u7121\u8996\u5927\u5c0f\u5beb");
                        ignoreCaseCheckBox.setSelected(true);
                    }
                    {
                        searchTextBtn = new JButton();
                        jPanel4.add(searchTextBtn);
                        searchTextBtn.setText("?");
                        searchTextBtn.setPreferredSize(new java.awt.Dimension(118, 22));
                        searchTextBtn.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent evt) {
                                searchTextBtnAction();
                            }
                        });
                    }
                    {
                        jLabel5 = new JLabel();
                        jPanel4.add(jLabel5);
                        jLabel5.setText(
                                "\u4ee5\u958b\u59cb\u7d50\u675f\u95dc\u9375\u5b57\u89e3\u6790\u6587\u4ef6");
                        jLabel5.setPreferredSize(new java.awt.Dimension(155, 15));
                    }
                    {
                        startStrText = new JTextField();
                        jPanel4.add(startStrText);
                        startStrText.setPreferredSize(new java.awt.Dimension(229, 22));
                    }
                    {
                        endStrText = new JTextField();
                        jPanel4.add(endStrText);
                        endStrText.setPreferredSize(new java.awt.Dimension(244, 22));
                    }
                }
                {
                    jScrollPane1 = new JScrollPane();
                    jPanel1.add(jScrollPane1, BorderLayout.CENTER);
                    jScrollPane1.setPreferredSize(new java.awt.Dimension(689, 391));
                    {
                        DefaultListModel searchMatchListModel = new DefaultListModel();
                        searchMatchList = new JList();
                        jScrollPane1.setViewportView(searchMatchList);
                        searchMatchList.setModel(searchMatchListModel);
                        searchMatchList.addMouseListener(new MouseAdapter() {
                            public void mouseClicked(MouseEvent evt) {
                                searchMatchListMouseAction(evt);
                            }
                        });
                    }
                }
            }
            {
                jPanel2 = new JPanel();
                BorderLayout jPanel2Layout = new BorderLayout();
                jPanel2.setLayout(jPanel2Layout);
                jTabbedPane1.addTab("", null, jPanel2, null);
                {
                    jScrollPane2 = new JScrollPane();
                    jPanel2.add(jScrollPane2, BorderLayout.CENTER);
                    jScrollPane2.setPreferredSize(new java.awt.Dimension(689, 484));
                    {
                        logDetailTextArea = new JTextArea();
                        jScrollPane2.setViewportView(logDetailTextArea);
                    }
                }
            }
        }
        pack();
        this.setSize(702, 538);
    } catch (Exception e) {
        // add your error handling code here
        e.printStackTrace();
    }
}

From source file:sim.util.media.chart.TimeSeriesChartGenerator.java

public TimeSeriesChartGenerator() {
    super();/*from w  w w . j a v  a 2  s.  c  o m*/
    LabelledList globalAttribList = (LabelledList) (((DisclosurePanel) getGlobalAttribute(-2))
            .getDisclosedComponent());
    useCullingCheckBox = new JCheckBox();

    globalAttribList.add(new JLabel("Cull Data"), useCullingCheckBox);
    maxPointsPerSeriesTextField = new NumberTextField(1000) {
        public double newValue(final double val) {
            int max = (int) val;
            if (val < 2)
                return (int) getValue();
            dataCuller = new MinGapDataCuller(max);
            return max;
        }
    };
    useCullingCheckBox.setSelected(true);
    globalAttribList.add(new JLabel("... Over"), maxPointsPerSeriesTextField);
    maxPointsPerSeriesTextField.setToolTipText(
            "The maximum number of data points in a series before data culling gets triggered.");

    dataCuller = new MinGapDataCuller((int) maxPointsPerSeriesTextField.getValue());

    useCullingCheckBox.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            if (useCullingCheckBox.isSelected()) {
                maxPointsPerSeriesTextField.setEnabled(true);
                int maxPoints = (int) maxPointsPerSeriesTextField.getValue();
                dataCuller = new MinGapDataCuller(maxPoints);
            } else {
                maxPointsPerSeriesTextField.setEnabled(false);
                dataCuller = null;
            }
        }
    });
}