Example usage for javax.swing DefaultListModel DefaultListModel

List of usage examples for javax.swing DefaultListModel DefaultListModel

Introduction

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

Prototype

DefaultListModel

Source Link

Usage

From source file:org.rimudb.editor.DescriptorEditor.java

/**
 * Build the panel// w w  w. j a va2  s.c om
 */
private JPanel createColumnTablePanel() {
    JPanel columnPanel = new JPanel();
    columnPanel.setLayout(new BoxLayout(columnPanel, BoxLayout.Y_AXIS));

    // Create the property table panel
    propertyModel = new PropertyTableModel();

    // Add a listener to set the changed state
    propertyModel.addTableModelListener(new TableModelListener() {
        public void tableChanged(TableModelEvent e) {
            markChanged();

            if (e instanceof PropertyTableModelEvent) {
                PropertyTableModelEvent ptme = (PropertyTableModelEvent) e;

                // If the columnName column was changed then check it isn't
                // a PK
                if (ptme.getColumn() == 1) {

                    String beforeColumnName = (String) ptme.getBeforeValue();
                    String afterColumnName = (String) ptme.getAfterValue();

                    // Is the field entry in the list of primary keys?
                    for (int i = 0; i < pkListModel.getSize(); i++) {
                        String pkColumnName = (String) pkListModel.get(i);
                        // If it's found then remove it
                        if (beforeColumnName.equals(pkColumnName)) {
                            pkListModel.set(i, afterColumnName);
                            break;
                        }
                    }

                }

            }
        }
    });

    table = new ATable(getPropertyModel());
    table.setName("ColumnTable");
    table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    table.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
        public void valueChanged(ListSelectionEvent e) {
            int selectedRowCount = table.getSelectedRowCount();
            removeColumnBtn.setEnabled(selectedRowCount > 0);
            moveUpBtn.setEnabled(selectedRowCount > 0);
            moveDownBtn.setEnabled(selectedRowCount > 0);
        }
    });
    table.setTransferHandler(new TransferHandler() {

        public int getSourceActions(JComponent c) {
            return COPY;
        }

        protected Transferable createTransferable(JComponent c) {
            ATable columnTable = (ATable) c;
            int row = columnTable.getSelectedRow();
            String columnName = getPropertyModel().getRow(row).getColumnName();
            return new StringSelection(columnName);
        }
    });
    table.setDragEnabled(true);

    JScrollPane sp = new JScrollPane(table);
    sp.setMaximumSize(new Dimension(Short.MAX_VALUE, 325));
    sp.setPreferredSize(new Dimension(Short.MAX_VALUE, 325));
    sp.setMinimumSize(new Dimension(Short.MAX_VALUE, 325));

    JComboBox typeCB = new JComboBox(DatabaseTypes.getAllTypes());
    typeCB.setEditable(false);

    javax.swing.table.TableColumn typeColumn = table.getColumnModel().getColumn(2);
    typeColumn.setCellEditor(new DefaultCellEditor(typeCB));

    // Create the popup menu and set it on the table
    propertyPopup = new TablePopupMenu(this, table);
    table.addMouseListener(propertyPopup);
    sp.addMouseListener(propertyPopup);
    sp.setAlignmentX(LEFT_ALIGNMENT);

    columnPanel.add(sp);

    columnPanel.add(Box.createVerticalStrut(10));

    JLabel pkLabel = new JLabel("Primary Key Columns", SwingConstants.LEFT);
    pkLabel.setAlignmentX(LEFT_ALIGNMENT);
    columnPanel.add(pkLabel);

    pkListModel = new DefaultListModel();
    pkListModel.addListDataListener(new ListDataListener() {
        public void intervalRemoved(ListDataEvent e) {
            markChanged();
        }

        public void intervalAdded(ListDataEvent e) {
            markChanged();
        }

        public void contentsChanged(ListDataEvent e) {
            markChanged();
        }
    });

    pkList = new JList(pkListModel);
    pkList.setName("pkList");
    pkList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    pkList.addListSelectionListener(new ListSelectionListener() {
        public void valueChanged(ListSelectionEvent e) {
            int selectedRowCount = pkList.getSelectedIndex();
            removePkBtn.setEnabled(selectedRowCount > -1);
        }
    });
    pkList.setTransferHandler(new TransferHandler() {

        public boolean canImport(TransferHandler.TransferSupport info) {
            // we only import Strings
            if (!info.isDataFlavorSupported(DataFlavor.stringFlavor)) {
                return false;
            }

            JList.DropLocation dl = (JList.DropLocation) info.getDropLocation();
            if (dl.getIndex() == -1) {
                return false;
            }
            return true;
        }

        public boolean importData(TransferHandler.TransferSupport info) {
            if (!info.isDrop()) {
                return false;
            }

            // Check for String flavor
            if (!info.isDataFlavorSupported(DataFlavor.stringFlavor)) {
                displayDropLocation("List doesn't accept a drop of this type.");
                return false;
            }

            JList.DropLocation dl = (JList.DropLocation) info.getDropLocation();
            DefaultListModel listModel = (DefaultListModel) pkList.getModel();
            int index = dl.getIndex();

            // Get the string that is being dropped.
            Transferable t = info.getTransferable();
            String data;
            try {
                data = (String) t.getTransferData(DataFlavor.stringFlavor);
            } catch (Exception e) {
                return false;
            }

            // If this is a copy action then check we don't already have that String
            if (info.getDropAction() == COPY && listModel.indexOf(data) > -1) {
                displayDropLocation("The column " + data + " is already a primary key");
                return false;
            }

            // Perform the actual import. 
            if (dl.isInsert()) {
                int oldIndex = listModel.indexOf(data);
                if (oldIndex < index) {
                    listModel.add(index, data);
                    listModel.remove(oldIndex);
                } else {
                    listModel.remove(oldIndex);
                    listModel.add(index, data);
                }
            } else {
                // Don't handle replacements
            }
            return true;
        }

        public int getSourceActions(JComponent c) {
            return MOVE;
        }

        protected Transferable createTransferable(JComponent c) {
            JList list = (JList) c;
            Object[] values = list.getSelectedValues();

            StringBuffer buff = new StringBuffer();

            for (int i = 0; i < values.length; i++) {
                Object val = values[i];
                buff.append(val == null ? "" : val.toString());
                if (i != values.length - 1) {
                    buff.append("\n");
                }
            }
            return new StringSelection(buff.toString());
        }
    });
    pkList.setDropMode(DropMode.INSERT);
    pkList.setDragEnabled(true);

    JScrollPane pkScrollPanel = new JScrollPane(pkList);
    pkScrollPanel.setMaximumSize(new Dimension(Short.MAX_VALUE, 100));
    pkScrollPanel.setAlignmentX(LEFT_ALIGNMENT);

    columnPanel.add(pkScrollPanel);

    return columnPanel;
}

From source file:org.shaman.rpg.editor.dialog.DialogVisualElement.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  w  w w. java2  s  . co m*/
 */
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    scrollPane = new javax.swing.JScrollPane();
    jLabel1 = new javax.swing.JLabel();
    nameTextField = new javax.swing.JTextField();
    jLabel2 = new javax.swing.JLabel();
    jScrollPane1 = new javax.swing.JScrollPane();
    personsList = new javax.swing.JList();
    addButton = new javax.swing.JButton();
    removeButton = new javax.swing.JButton();

    org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle
            .getMessage(DialogVisualElement.class, "DialogVisualElement.jLabel1.text")); // NOI18N

    nameTextField.setText(org.openide.util.NbBundle.getMessage(DialogVisualElement.class,
            "DialogVisualElement.nameTextField.text")); // NOI18N

    org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle
            .getMessage(DialogVisualElement.class, "DialogVisualElement.jLabel2.text")); // NOI18N

    personsList.setModel(new DefaultListModel());
    personsList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
    personsList.setToolTipText(org.openide.util.NbBundle.getMessage(DialogVisualElement.class,
            "DialogVisualElement.personsList.toolTipText")); // NOI18N
    personsList.setLayoutOrientation(javax.swing.JList.VERTICAL_WRAP);
    personsList.setVisibleRowCount(-1);
    jScrollPane1.setViewportView(personsList);

    org.openide.awt.Mnemonics.setLocalizedText(addButton, org.openide.util.NbBundle
            .getMessage(DialogVisualElement.class, "DialogVisualElement.addButton.text")); // NOI18N
    addButton.setToolTipText(org.openide.util.NbBundle.getMessage(DialogVisualElement.class,
            "DialogVisualElement.addButton.toolTipText")); // NOI18N
    addButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            addButtonEvent(evt);
        }
    });

    org.openide.awt.Mnemonics.setLocalizedText(removeButton, org.openide.util.NbBundle
            .getMessage(DialogVisualElement.class, "DialogVisualElement.removeButton.text")); // NOI18N
    removeButton.setToolTipText(org.openide.util.NbBundle.getMessage(DialogVisualElement.class,
            "DialogVisualElement.removeButton.toolTipText")); // NOI18N
    removeButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            removeButtonEvent(evt);
        }
    });

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addComponent(jLabel1)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(nameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 100,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(jLabel2)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 217, Short.MAX_VALUE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(removeButton, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(addButton, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
            .addComponent(scrollPane));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel1)
                                    .addComponent(nameTextField, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel2))
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 61,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(layout.createSequentialGroup().addComponent(addButton)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(removeButton)))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(scrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 296, Short.MAX_VALUE)));
}

From source file:org.sleuthkit.autopsy.experimental.autoingest.FileExporterSettingsPanel.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   w ww.ja va 2  s  .  c om*/
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    mainPanel = new javax.swing.JPanel();
    tbRootDirectory = new javax.swing.JTextField();
    pnEditRule = new javax.swing.JPanel();
    comboBoxMimeValue = new javax.swing.JComboBox<String>();
    cbMimeType = new javax.swing.JCheckBox();
    spFileSizeValue = new javax.swing.JSpinner();
    comboBoxFileSizeUnits = new javax.swing.JComboBox<String>();
    cbFileSize = new javax.swing.JCheckBox();
    comboBoxFileSizeComparison = new javax.swing.JComboBox<String>();
    comboBoxMimeTypeComparison = new javax.swing.JComboBox<String>();
    tbRuleName = new javax.swing.JTextField();
    bnSaveRule = new javax.swing.JButton();
    comboBoxArtifactName = new javax.swing.JComboBox<String>();
    comboBoxAttributeName = new javax.swing.JComboBox<String>();
    comboBoxAttributeComparison = new javax.swing.JComboBox<String>();
    tbAttributeValue = new javax.swing.JTextField();
    bnAddAttribute = new javax.swing.JButton();
    comboBoxValueType = new javax.swing.JComboBox<String>();
    cbAttributeType = new javax.swing.JCheckBox();
    dateTimePicker = new DateTimePicker(null, timeSettings);
    lbArtifact = new javax.swing.JLabel();
    lbAttribute = new javax.swing.JLabel();
    bnDeleteAttribute = new javax.swing.JButton();
    jScrollPane1 = new javax.swing.JScrollPane();
    lsAttributeList = new javax.swing.JList<String>();
    lbRuleName = new javax.swing.JLabel();
    lbSaveRuleHelper = new javax.swing.JLabel();
    bnBrowseReportDirectory = new javax.swing.JButton();
    tbReportDirectory = new javax.swing.JTextField();
    ruleListScrollPane = new javax.swing.JScrollPane();
    trRuleList = new javax.swing.JTree();
    lbFiles = new javax.swing.JLabel();
    lbReports = new javax.swing.JLabel();
    bnBrowseRootDirectory = new javax.swing.JButton();
    cbEnableFileExport = new javax.swing.JCheckBox();
    bnNewRule = new javax.swing.JButton();
    bnDeleteRule = new javax.swing.JButton();
    bnClose = new javax.swing.JButton();
    lbExplanation = new javax.swing.JLabel();

    setBorder(javax.swing.BorderFactory.createEtchedBorder());
    setName(org.openide.util.NbBundle.getMessage(FileExporterSettingsPanel.class,
            "FileExporterSettingsPanel.Title")); // NOI18N

    mainPanel.setAutoscrolls(true);
    mainPanel.setPreferredSize(new java.awt.Dimension(657, 425));

    tbRootDirectory.setToolTipText(org.openide.util.NbBundle.getMessage(FileExporterSettingsPanel.class,
            "FileExporterSettingsPanel.RuleOutputTooltip_1")); // NOI18N
    tbRootDirectory.setMaximumSize(new java.awt.Dimension(2000, 2000));

    pnEditRule.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    pnEditRule.setAutoscrolls(true);

    comboBoxMimeValue.setEditable(true);
    comboBoxMimeValue.setMaximumRowCount(30);
    comboBoxMimeValue.setToolTipText(org.openide.util.NbBundle.getMessage(FileExporterSettingsPanel.class,
            "FileExporterSettingsPanel.MimetypeTooltip_1")); // NOI18N
    comboBoxMimeValue.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            comboBoxMimeValueActionPerformed(evt);
        }
    });

    cbMimeType.setText(org.openide.util.NbBundle.getMessage(FileExporterSettingsPanel.class,
            "FileExporterSettingsPanel.MimetypeText")); // NOI18N
    cbMimeType.setToolTipText(org.openide.util.NbBundle.getMessage(FileExporterSettingsPanel.class,
            "FileExporterSettingsPanel.MimetypeCheckboxTooltip_1")); // NOI18N
    cbMimeType.addItemListener(new java.awt.event.ItemListener() {
        public void itemStateChanged(java.awt.event.ItemEvent evt) {
            checkButtonItemStateChanged(evt);
        }
    });

    spFileSizeValue.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(1024), Integer.valueOf(0), null,
            Integer.valueOf(1)));
    spFileSizeValue.setToolTipText(org.openide.util.NbBundle.getMessage(FileExporterSettingsPanel.class,
            "FileExporterSettingsPanel.FileSizeValueToolTip_1")); // NOI18N

    comboBoxFileSizeUnits.setToolTipText(org.openide.util.NbBundle.getMessage(FileExporterSettingsPanel.class,
            "FileExporterSettingsPanel.FileSizeUnitToolTip_1")); // NOI18N

    cbFileSize.setText(org.openide.util.NbBundle.getMessage(FileExporterSettingsPanel.class,
            "FileExporterSettingsPanel.FileSize")); // NOI18N
    cbFileSize.setToolTipText(org.openide.util.NbBundle.getMessage(FileExporterSettingsPanel.class,
            "FileExporterSettingsPanel.FileSize_1")); // NOI18N
    cbFileSize.addItemListener(new java.awt.event.ItemListener() {
        public void itemStateChanged(java.awt.event.ItemEvent evt) {
            checkButtonItemStateChanged(evt);
        }
    });

    comboBoxFileSizeComparison.setToolTipText(org.openide.util.NbBundle.getMessage(
            FileExporterSettingsPanel.class, "FileExporterSettingsPanel.FileSizeComparisonTooltip_1")); // NOI18N
    comboBoxFileSizeComparison.setMinimumSize(new java.awt.Dimension(32, 20));

    comboBoxMimeTypeComparison.setToolTipText(org.openide.util.NbBundle.getMessage(
            FileExporterSettingsPanel.class, "FileExporterSettingsPanel.MimeTypeComparisonTooltip_1")); // NOI18N
    comboBoxMimeTypeComparison.setMinimumSize(new java.awt.Dimension(32, 20));

    tbRuleName.setToolTipText(org.openide.util.NbBundle.getMessage(FileExporterSettingsPanel.class,
            "FileExporterSettingsPanel.CurrentlySelectedRuleNameTooltip_1")); // NOI18N
    tbRuleName.setMaximumSize(new java.awt.Dimension(10, 1000));
    tbRuleName.setPreferredSize(new java.awt.Dimension(733, 20));
    tbRuleName.addKeyListener(new java.awt.event.KeyAdapter() {
        public void keyTyped(java.awt.event.KeyEvent evt) {
            tbRuleNameKeyTyped(evt);
        }
    });

    bnSaveRule.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/org/sleuthkit/autopsy/experimental/images/save-icon.png"))); // NOI18N
    bnSaveRule.setText(org.openide.util.NbBundle.getMessage(FileExporterSettingsPanel.class,
            "FileExporterSettingsPanel.SaveText")); // NOI18N
    bnSaveRule.setToolTipText(org.openide.util.NbBundle.getMessage(FileExporterSettingsPanel.class,
            "FileExporterSettingsPanel.SaveTooltip_1")); // NOI18N
    bnSaveRule.setEnabled(false);
    bnSaveRule.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            bnSaveRuleActionPerformed(evt);
        }
    });

    comboBoxArtifactName.setEditable(true);
    comboBoxArtifactName.setMaximumRowCount(30);
    comboBoxArtifactName.setToolTipText("The Artifact to match");
    comboBoxArtifactName.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            comboBoxArtifactNameActionPerformed(evt);
        }
    });

    comboBoxAttributeName.setEditable(true);
    comboBoxAttributeName.setMaximumRowCount(30);
    comboBoxAttributeName.setToolTipText("The attribute of the artifact to match");
    comboBoxAttributeName.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            comboBoxAttributeNameActionPerformed(evt);
        }
    });

    comboBoxAttributeComparison.setToolTipText("Select the conditional operator");
    comboBoxAttributeComparison.setMinimumSize(new java.awt.Dimension(32, 23));

    tbAttributeValue.setToolTipText("Type a value here");
    tbAttributeValue.setMinimumSize(new java.awt.Dimension(6, 23));
    tbAttributeValue.setPreferredSize(new java.awt.Dimension(6, 23));

    bnAddAttribute.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/org/sleuthkit/autopsy/experimental/images/left-arrow-16-icon.png"))); // NOI18N
    bnAddAttribute.setText("Add Attribute");
    bnAddAttribute.setToolTipText("Click to add an attribute to the current rule");
    bnAddAttribute.setEnabled(false);
    bnAddAttribute.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            bnAddAttributeActionPerformed(evt);
        }
    });

    comboBoxValueType
            .setToolTipText("Select the data type of attribute. This will affect how values are compared.");
    comboBoxValueType.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            comboBoxValueTypeActionPerformed(evt);
        }
    });

    cbAttributeType.setText("Attributes");
    cbAttributeType.setToolTipText("Select to include artifact/attribute pairs in the rule");
    cbAttributeType.addItemListener(new java.awt.event.ItemListener() {
        public void itemStateChanged(java.awt.event.ItemEvent evt) {
            cbAttributeTypeItemStateChanged(evt);
        }
    });

    dateTimePicker.setToolTipText("Choose a date and time");

    lbArtifact.setText("Artifact");

    lbAttribute.setText("Attribute");

    bnDeleteAttribute.setText("Delete Attribute");
    bnDeleteAttribute.setToolTipText("Click to remove the selected attribute");
    bnDeleteAttribute.setEnabled(false);
    bnDeleteAttribute.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            bnDeleteAttributeActionPerformed(evt);
        }
    });

    lsAttributeList.setModel(new DefaultListModel<String>());
    lsAttributeList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
    lsAttributeList.setToolTipText("The attributes for the selected rule");
    jScrollPane1.setViewportView(lsAttributeList);

    lbRuleName.setText("Rule Name");

    lbSaveRuleHelper.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
    lbSaveRuleHelper.setText("To save, a rule must have a name and at least one condition.");

    javax.swing.GroupLayout pnEditRuleLayout = new javax.swing.GroupLayout(pnEditRule);
    pnEditRule.setLayout(pnEditRuleLayout);
    pnEditRuleLayout.setHorizontalGroup(pnEditRuleLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnEditRuleLayout.createSequentialGroup().addContainerGap().addGroup(pnEditRuleLayout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnEditRuleLayout.createSequentialGroup().addGap(21, 21, 21)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 198,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(10, 10, 10)
                            .addGroup(pnEditRuleLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnEditRuleLayout
                                            .createSequentialGroup()
                                            .addComponent(lbSaveRuleHelper,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(bnSaveRule, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    101, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(pnEditRuleLayout.createSequentialGroup()
                                            .addComponent(comboBoxAttributeComparison,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(dateTimePicker,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 306,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(tbAttributeValue,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, 158, Short.MAX_VALUE))
                                    .addGroup(pnEditRuleLayout.createSequentialGroup().addGroup(pnEditRuleLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(pnEditRuleLayout.createSequentialGroup()
                                                    .addGroup(pnEditRuleLayout
                                                            .createParallelGroup(
                                                                    javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addComponent(comboBoxArtifactName,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(lbArtifact))
                                                    .addGap(18, 18, 18)
                                                    .addGroup(pnEditRuleLayout
                                                            .createParallelGroup(
                                                                    javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addGroup(pnEditRuleLayout.createSequentialGroup()
                                                                    .addComponent(comboBoxAttributeName,
                                                                            javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                    .addPreferredGap(
                                                                            javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                                    .addComponent(comboBoxValueType,
                                                                            javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                                                            .addComponent(lbAttribute)))
                                            .addGroup(pnEditRuleLayout.createSequentialGroup()
                                                    .addComponent(bnAddAttribute,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE, 117,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(
                                                            javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                    .addComponent(bnDeleteAttribute)))
                                            .addGap(0, 0, Short.MAX_VALUE))))
                    .addGroup(pnEditRuleLayout.createSequentialGroup()
                            .addGroup(pnEditRuleLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(cbMimeType).addComponent(cbFileSize)
                                    .addComponent(cbAttributeType))
                            .addGap(89, 89, 89)
                            .addGroup(
                                    pnEditRuleLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(pnEditRuleLayout.createSequentialGroup()
                                                    .addComponent(comboBoxMimeTypeComparison,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE,
                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addGap(18, 18, 18).addComponent(comboBoxMimeValue,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE, 240,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addGroup(pnEditRuleLayout.createSequentialGroup()
                                                    .addComponent(comboBoxFileSizeComparison,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE,
                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addGap(18, 18, 18)
                                                    .addComponent(spFileSizeValue,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE, 105,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addGap(18, 18, 18).addComponent(comboBoxFileSizeUnits,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE,
                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(pnEditRuleLayout.createSequentialGroup().addComponent(lbRuleName)
                            .addGap(18, 18, 18).addComponent(tbRuleName, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    1, Short.MAX_VALUE)))
                    .addContainerGap()));
    pnEditRuleLayout.setVerticalGroup(pnEditRuleLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnEditRuleLayout.createSequentialGroup().addGap(14, 14, 14).addGroup(pnEditRuleLayout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tbRuleName, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lbRuleName)).addGap(26, 26, 26)
                    .addGroup(pnEditRuleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(cbMimeType)
                            .addComponent(comboBoxMimeTypeComparison, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(comboBoxMimeValue, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(pnEditRuleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(pnEditRuleLayout.createSequentialGroup().addGap(78, 78, 78)
                                    .addComponent(lbAttribute).addGap(8, 8, 8)
                                    .addGroup(pnEditRuleLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addGroup(pnEditRuleLayout.createSequentialGroup()
                                                    .addGroup(pnEditRuleLayout
                                                            .createParallelGroup(
                                                                    javax.swing.GroupLayout.Alignment.BASELINE)
                                                            .addComponent(comboBoxAttributeName,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(comboBoxArtifactName,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(comboBoxValueType,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                                                    .addPreferredGap(
                                                            javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                    .addGroup(pnEditRuleLayout
                                                            .createParallelGroup(
                                                                    javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addComponent(tbAttributeValue,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(dateTimePicker,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE)))
                                            .addComponent(comboBoxAttributeComparison,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(pnEditRuleLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(bnAddAttribute).addComponent(bnDeleteAttribute))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addGroup(pnEditRuleLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(bnSaveRule).addComponent(lbSaveRuleHelper)))
                            .addGroup(pnEditRuleLayout.createSequentialGroup().addGap(26, 26, 26)
                                    .addGroup(pnEditRuleLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(cbFileSize)
                                            .addComponent(spFileSizeValue,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(comboBoxFileSizeUnits,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(comboBoxFileSizeComparison,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGap(26, 26, 26)
                                    .addGroup(pnEditRuleLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(cbAttributeType).addComponent(lbArtifact))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 187,
                                            Short.MAX_VALUE)))
                    .addContainerGap()));

    bnBrowseReportDirectory.setText(org.openide.util.NbBundle.getMessage(FileExporterSettingsPanel.class,
            "FileExporterSettingsPanel.BrowseText")); // NOI18N
    bnBrowseReportDirectory.setToolTipText(org.openide.util.NbBundle.getMessage(FileExporterSettingsPanel.class,
            "FileExporterSettingsPanel.BrowseReportTooltip_1")); // NOI18N
    bnBrowseReportDirectory.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            bnBrowseReportDirectoryActionPerformed(evt);
        }
    });

    tbReportDirectory.setToolTipText(org.openide.util.NbBundle.getMessage(FileExporterSettingsPanel.class,
            "FileExporterSettingsPanel.ReportOutputFolderTooltip_1")); // NOI18N
    tbReportDirectory.setMaximumSize(new java.awt.Dimension(2000, 2000));

    javax.swing.tree.DefaultMutableTreeNode treeNode1 = new javax.swing.tree.DefaultMutableTreeNode("root");
    trRuleList.setModel(new javax.swing.tree.DefaultTreeModel(treeNode1));
    trRuleList.setToolTipText("This tree shows the rules to collect files for automatic file export");
    trRuleList.setName("trRuleList"); // NOI18N
    trRuleList.setShowsRootHandles(true);
    ruleListScrollPane.setViewportView(trRuleList);
    trRuleList.getAccessibleContext().setAccessibleParent(ruleListScrollPane);

    lbFiles.setText("Files Folder");

    lbReports.setText("Reports Folder");

    bnBrowseRootDirectory.setText(org.openide.util.NbBundle.getMessage(FileExporterSettingsPanel.class,
            "FileExporterSettingsPanel.BrowseText")); // NOI18N
    bnBrowseRootDirectory.setToolTipText(org.openide.util.NbBundle.getMessage(FileExporterSettingsPanel.class,
            "FileExporterSettingsPanel.BrowseRootOutputFolder_1")); // NOI18N
    bnBrowseRootDirectory.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            bnBrowseRootDirectoryActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
    mainPanel.setLayout(mainPanelLayout);
    mainPanelLayout.setHorizontalGroup(mainPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(mainPanelLayout.createSequentialGroup()
                                    .addGroup(mainPanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(lbFiles).addComponent(lbReports))
                                    .addGap(18, 18, 18)
                                    .addGroup(mainPanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(tbRootDirectory, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(tbReportDirectory,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addGroup(mainPanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(bnBrowseReportDirectory,
                                                    javax.swing.GroupLayout.Alignment.TRAILING,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 93,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(bnBrowseRootDirectory,
                                                    javax.swing.GroupLayout.Alignment.TRAILING,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 93,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(mainPanelLayout.createSequentialGroup()
                                    .addComponent(ruleListScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            278, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(pnEditRule, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))));
    mainPanelLayout.setVerticalGroup(mainPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
                    .addGap(1, 1, 1)
                    .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(tbRootDirectory, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lbFiles).addComponent(bnBrowseRootDirectory))
                    .addGap(6, 6, 6)
                    .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(bnBrowseReportDirectory)
                            .addComponent(tbReportDirectory, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lbReports))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(ruleListScrollPane).addComponent(pnEditRule,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE))
                    .addContainerGap()));

    cbEnableFileExport.setText("Enable File Export");
    cbEnableFileExport.setToolTipText("Select to enable File Export");
    cbEnableFileExport.addItemListener(new java.awt.event.ItemListener() {
        public void itemStateChanged(java.awt.event.ItemEvent evt) {
            cbEnableFileExportItemStateChanged(evt);
        }
    });

    bnNewRule.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/org/sleuthkit/autopsy/experimental/images/plus-icon.png"))); // NOI18N
    bnNewRule.setText(org.openide.util.NbBundle.getMessage(FileExporterSettingsPanel.class,
            "FileExporterSettingsPanel.NewText")); // NOI18N
    bnNewRule.setToolTipText(org.openide.util.NbBundle.getMessage(FileExporterSettingsPanel.class,
            "FileExporterSettingsPanel.NewRuleTooltip_1")); // NOI18N
    bnNewRule.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            bnNewRuleActionPerformed(evt);
        }
    });

    bnDeleteRule.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/org/sleuthkit/autopsy/experimental/images/minus-icon.png"))); // NOI18N
    bnDeleteRule.setText(org.openide.util.NbBundle.getMessage(FileExporterSettingsPanel.class,
            "FileExporterSettingsPanel.DeleteText")); // NOI18N
    bnDeleteRule.setToolTipText(org.openide.util.NbBundle.getMessage(FileExporterSettingsPanel.class,
            "FileExporterSettingsPanel.DeleteTooltip_1")); // NOI18N
    bnDeleteRule.setEnabled(false);
    bnDeleteRule.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            bnDeleteRuleActionPerformed(evt);
        }
    });

    bnClose.setText("Close");
    bnClose.setToolTipText("Close the settings panel");
    bnClose.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            bnCloseActionPerformed(evt);
        }
    });

    lbExplanation.setText(
            "File Export occurs after ingest has completed, automatically exporting files matching the rules specified below. Individual components of the rule are ANDed together.");

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addContainerGap().addComponent(cbEnableFileExport)
                    .addGap(39, 39, 39).addComponent(lbExplanation)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(layout.createSequentialGroup().addGap(36, 36, 36)
                    .addComponent(bnNewRule, javax.swing.GroupLayout.PREFERRED_SIZE, 101,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(bnDeleteRule)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(bnClose, javax.swing.GroupLayout.PREFERRED_SIZE, 101,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(21, 21, 21))
            .addGroup(layout.createSequentialGroup()
                    .addComponent(mainPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 1051, Short.MAX_VALUE)
                    .addContainerGap()));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(cbEnableFileExport).addComponent(lbExplanation))
                    .addGap(7, 7, 7)
                    .addComponent(mainPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 455, Short.MAX_VALUE)
                    .addGap(1, 1, 1)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(bnDeleteRule).addComponent(bnNewRule).addComponent(bnClose))
                    .addContainerGap()));
}

From source file:org.stanwood.nwn2.gui.MainWindow.java

private void createComponents(JPanel panel1) {
    BorderLayout layout = new BorderLayout(5, 5);
    panel1.setLayout(layout);/*w w  w .  j av  a 2 s  . co m*/
    JLabel lblList = new JLabel("Neverwinter Nights 2 GUI XML files:");
    panel1.add(lblList, BorderLayout.NORTH);

    JPanel panel = new JPanel();
    panel.setLayout(new BorderLayout(5, 5));

    guiFileListModel = new DefaultListModel();
    guiFileList = new JList(guiFileListModel);
    guiFileList.addListSelectionListener(new ListSelectionListener() {
        @Override
        public void valueChanged(ListSelectionEvent e) {
            updateEnabledState();
        }
    });

    JScrollPane pane = new JScrollPane(guiFileList);

    JPanel buttonPanel1 = new JPanel();
    buttonPanel1.setLayout(new BorderLayout());
    panel.add(buttonPanel1, BorderLayout.EAST);

    JPanel buttonPanel2 = new JPanel();
    buttonPanel1.add(buttonPanel2, BorderLayout.NORTH);

    buttonPanel2.setLayout(new GridLayout(4, 1, 5, 5));

    JButton cmdAdd = new JButton(
            IconManager.getInstance().getIcon(IconManager.SIZE_22, IconManager.ICON_LIST_ADD));
    cmdAdd.setToolTipText("Add a XML GUI file to the list");
    cmdAdd.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            addNewGUIFile();
        }

    });

    buttonPanel2.add(cmdAdd);
    cmdRemove = new JButton(
            IconManager.getInstance().getIcon(IconManager.SIZE_22, IconManager.ICON_LIST_REMOVE));
    cmdRemove.setToolTipText("Remove the selected XML GUI file from the list");
    cmdRemove.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            guiFileListModel.remove(guiFileList.getSelectedIndex());
            updateEnabledState();
            saveChanges();
        }
    });

    buttonPanel2.add(cmdRemove);
    cmdDisplay = new JButton(
            IconManager.getInstance().getIcon(IconManager.SIZE_22, IconManager.ICON_LIST_VIEW));
    cmdDisplay.setToolTipText("Render the selected XML GUI file");
    cmdDisplay.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            displayGUIFile();
        }
    });
    buttonPanel2.add(cmdDisplay);

    cmdEdit = new JButton(
            IconManager.getInstance().getIcon(IconManager.SIZE_22, IconManager.ICON_ACCESSORIES_TEXT_EDITOR));
    cmdEdit.setToolTipText("Open the selected XML GUI file in a editor");
    cmdEdit.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            File guiFile = getSelectedFile();
            try {
                Desktop.getDesktop().edit(guiFile);
            } catch (IOException e1) {
                JOptionPane.showMessageDialog(MainWindow.this, e1.getMessage(), "NWN2GUI Error",
                        JOptionPane.ERROR_MESSAGE);
                log.error(e1.getMessage(), e1);
            } catch (UnsupportedOperationException e1) {
                //TODO add support for other platforms
                JOptionPane.showMessageDialog(MainWindow.this, "Unable to find the systems default editor",
                        "NWN2GUI Error", JOptionPane.ERROR_MESSAGE);
            }
        }
    });
    buttonPanel2.add(cmdEdit);

    panel.add(pane, BorderLayout.CENTER);
    panel1.add(panel, BorderLayout.CENTER);
}

From source file:org.tio.examples.im.client.ui.JFrameMain.java

/**
 * Creates new form JFrameMain//  w w w .j  a  v  a  2  s  . c  o  m
 */
private JFrameMain() {
    listModel = new DefaultListModel<ClientChannelContext<ImSessionContext, ImPacket, Object>>();
    initComponents();

    Config conf = ConfigFactory.load("app.conf");

    serverip.setText(conf.getString("server"));
    port.setText(conf.getString("port"));
    loginnameSufEndField.setText(conf.getString("client.count"));
    groupField.setText(conf.getString("group"));
    msgField.setText(conf.getString("chat.content"));
    loopcountField.setText(conf.getString("send.count"));

    //#2ecc71 OK
    //##f1c40f warn
    Color okColor = new Color(0x2e, 0xcc, 0x71);
    Color warnColor = new Color(0xe7, 0x4c, 0x3c);
    clients.setCellRenderer(new ImListCellRenderer(okColor, warnColor));
    try {
        imClientStarter = new ImClientStarter();
    } catch (IOException e) {
        throw new RuntimeException(e);
    }

    new Thread(new Runnable() {
        @Override
        public void run() {
            while (true) {
                long currTime = SystemTimer.currentTimeMillis();
                long iv = currTime - lastupdateTime;
                if (iv > 2000) {
                    isNeedUpdateConnectionCount = true;
                    isNeedUpdateReceivedCount = true;
                    isNeedUpdateSentCount = true;
                    isNeedUpdateList = true;
                    lastupdateTime = SystemTimer.currentTimeMillis();
                }

                try {
                    updateConnectionCount();
                    //Thread.sleep(2);
                    updateReceivedLabel();
                    //Thread.sleep(2);
                    updateSentLabel();
                    //Thread.sleep(2);
                } catch (Exception e1) {
                    log.error(e1.toString(), e1);
                }

                try {
                    Thread.sleep(50L);
                } catch (InterruptedException e) {
                    log.error(e.toString(), e);
                }
            }
        }

    }, "update ui task").start();
}

From source file:org.trzcinka.intellitrac.view.toolwindow.tickets.ticket_editor.BaseTicketEditorForm.java

private void createUIComponents() {
    constantToolbarForm = new ConstantToolbarForm();
    componentComboBoxModel = new DefaultComboBoxModel();
    priorityComboBoxModel = new DefaultComboBoxModel();
    typeComboBoxModel = new DefaultComboBoxModel();
    milestoneComboBoxModel = new DefaultComboBoxModel();
    versionComboBoxModel = new DefaultComboBoxModel();
    resolutionsComboBoxModel = new DefaultComboBoxModel();
    attachmentsListModel = new DefaultListModel();

    componentComboBox = new JComboBox(componentComboBoxModel);
    priorityComboBox = new JComboBox(priorityComboBoxModel);
    typeComboBox = new JComboBox(typeComboBoxModel);
    milestoneComboBox = new JComboBox(milestoneComboBoxModel);
    versionComboBox = new JComboBox(versionComboBoxModel);
    resolutionsComboBox = new JComboBox(resolutionsComboBoxModel);

    attachmentsList = new JList(attachmentsListModel);
    attachmentsList.setCellRenderer(new AttachmentsListCellRenderer());
}

From source file:org.vpac.voms.view.swing.VomsesManagementDialog.java

/**
 * @param owner/*from   w w w.  j  ava  2s  .  c  o m*/
 */
public VomsesManagementDialog(Frame owner) {
    super(owner);

    this.activeModel = new DefaultListModel();
    for (File file : new File(active_vomses_dir).listFiles()) {
        this.activeModel.addElement(file.getName());
    }

    this.availableModel = new DefaultListModel();
    for (File file : new File(available_vomses_dir).listFiles()) {
        boolean in_active = false;
        for (Object active : activeModel.toArray()) {
            if (((String) active).equals(file.getName())) {
                in_active = true;
                break;
            }
        }
        if (!in_active)
            this.availableModel.addElement(file.getName());
    }

    listTransferHandler = new ArrayListTransferHandler();
    initialize();
}

From source file:org.yccheok.jstock.gui.IndicatorPanel.java

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

    toolButtonGroup = new javax.swing.ButtonGroup();
    jPanel10 = new javax.swing.JPanel();
    jScrollPane2 = new javax.swing.JScrollPane();
    jList2 = new javax.swing.JList();
    jComboBox1 = new AutoCompleteJComboBox();
    jSplitPane1 = new javax.swing.JSplitPane();
    jPanel4 = new javax.swing.JPanel();
    scrollPane = new javax.swing.JScrollPane();
    view = new org.jhotdraw.draw.DefaultDrawingView();
    jPanel1 = new javax.swing.JPanel();
    creationToolbar = new javax.swing.JToolBar();
    jSplitPane2 = new javax.swing.JSplitPane();
    jPanel2 = new javax.swing.JPanel();
    jPanel3 = new javax.swing.JPanel();
    jButton1 = new javax.swing.JButton();
    jButton5 = new javax.swing.JButton();
    jButton2 = new javax.swing.JButton();
    jTabbedPane1 = new javax.swing.JTabbedPane();
    jPanel11 = new javax.swing.JPanel();
    jScrollPane1 = new javax.swing.JScrollPane();
    jList1 = new javax.swing.JList();
    jPanel5 = new javax.swing.JPanel();
    jPanel6 = new javax.swing.JPanel();
    jButton4 = new javax.swing.JButton();
    jButton6 = new javax.swing.JButton();
    jPanel7 = new javax.swing.JPanel();
    objectInspectorJPanel = new ObjectInspectorJPanel(new MutableStock(
            org.yccheok.jstock.engine.Utils.getEmptyStock(Code.newInstance(""), Symbol.newInstance(""))));

    jPanel10.setLayout(new java.awt.BorderLayout());

    jList2.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
    this.jList2.setModel(new DefaultListModel());
    this.jList2.addMouseListener(new JListPopupListener());
    jList2.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
        public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
            jList2ValueChanged(evt);
        }
    });
    jScrollPane2.setViewportView(jList2);

    jPanel10.add(jScrollPane2, java.awt.BorderLayout.CENTER);

    jComboBox1.setEditable(true);
    jComboBox1.setPreferredSize(new java.awt.Dimension(150, 24));
    ((AutoCompleteJComboBox) jComboBox1).attachStockInfoObserver(this.getStockInfoObserver());
    ((AutoCompleteJComboBox) jComboBox1).attachDispObserver(this.getDispObserver());

    setLayout(new java.awt.BorderLayout());

    // Priority give to left component.
    jSplitPane1.setResizeWeight(0.9);

    java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/yccheok/jstock/data/gui"); // NOI18N
    jPanel4.setBorder(
            javax.swing.BorderFactory.createTitledBorder(bundle.getString("IndicatorPanel_StockIndicator"))); // NOI18N
    jPanel4.setLayout(new java.awt.BorderLayout(5, 5));

    scrollPane.setViewportView(view);

    jPanel4.add(scrollPane, java.awt.BorderLayout.CENTER);

    jPanel1.setLayout(new java.awt.GridBagLayout());

    creationToolbar.setFloatable(false);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    jPanel1.add(creationToolbar, gridBagConstraints);

    jPanel4.add(jPanel1, java.awt.BorderLayout.SOUTH);

    jSplitPane1.setLeftComponent(jPanel4);

    jSplitPane2.setDividerLocation(305);
    jSplitPane2.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
    jSplitPane2.setMinimumSize(new java.awt.Dimension(300, 261));
    jSplitPane2.setPreferredSize(new java.awt.Dimension(150, 368));

    jPanel2.setBorder(
            javax.swing.BorderFactory.createTitledBorder(bundle.getString("IndicatorPanel_Database"))); // NOI18N
    jPanel2.setLayout(new java.awt.BorderLayout(5, 5));

    jPanel3.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 0, 5, 5));

    jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/16x16/filenew.png"))); // NOI18N
    jButton1.setText(bundle.getString("New...")); // NOI18N
    jButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton1ActionPerformed(evt);
        }
    });
    jPanel3.add(jButton1);

    jButton5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/16x16/filesave.png"))); // NOI18N
    jButton5.setText(bundle.getString("Save")); // NOI18N
    jButton5.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton5ActionPerformed(evt);
        }
    });
    jPanel3.add(jButton5);

    jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/16x16/download.png"))); // NOI18N
    jButton2.setText(bundle.getString("Install...")); // NOI18N
    jButton2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton2ActionPerformed(evt);
        }
    });
    jPanel3.add(jButton2);

    jPanel2.add(jPanel3, java.awt.BorderLayout.SOUTH);

    jPanel11.setLayout(new java.awt.BorderLayout());

    jList1.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
    this.jList1.setModel(new DefaultListModel());
    this.jList1.addMouseListener(new JListPopupListener());
    jList1.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
        public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
            jList1ValueChanged(evt);
        }
    });
    jScrollPane1.setViewportView(jList1);

    jPanel11.add(jScrollPane1, java.awt.BorderLayout.CENTER);

    jTabbedPane1.addTab(bundle.getString("IndicatorPanel_AlertIndicator"),
            new javax.swing.ImageIcon(getClass().getResource("/images/16x16/bell.png")), jPanel11); // NOI18N

    jPanel2.add(jTabbedPane1, java.awt.BorderLayout.CENTER);

    jSplitPane2.setTopComponent(jPanel2);

    jPanel5.setBorder(
            javax.swing.BorderFactory.createTitledBorder(bundle.getString("IndicatorPanel_StockSampleData"))); // NOI18N
    jPanel5.setLayout(new java.awt.BorderLayout(5, 5));

    jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/16x16/player_play.png"))); // NOI18N
    jButton4.setText(bundle.getString("IndicatorPanel_Simulate")); // NOI18N
    jButton4.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton4ActionPerformed(evt);
        }
    });
    jPanel6.add(jButton4);

    jButton6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/16x16/stop.png"))); // NOI18N
    jButton6.setText(bundle.getString("IndicatorPanel_Stop")); // NOI18N
    jButton6.setEnabled(false);
    jButton6.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton6ActionPerformed(evt);
        }
    });
    jPanel6.add(jButton6);

    jPanel5.add(jPanel6, java.awt.BorderLayout.SOUTH);
    jPanel5.add(jPanel7, java.awt.BorderLayout.NORTH);
    jPanel5.add(objectInspectorJPanel, java.awt.BorderLayout.CENTER);

    jSplitPane2.setBottomComponent(jPanel5);

    jSplitPane1.setRightComponent(jSplitPane2);

    add(jSplitPane1, java.awt.BorderLayout.CENTER);
}

From source file:org.zaproxy.zap.extension.portscan.PortScanPanel.java

private void resetPortList() {
    getPortList().setModel(new DefaultListModel());
}

From source file:Panels.LocationPanel.java

public LocationPanel() throws IOException, ParserConfigurationException, SAXException {//create LocationPanel object and set parameters

    this.locationfromInternetIcon = new ImageIcon(getClass().getResource(locationInternetIconSetting));//location from internet label icon
    this.loaderIcon = new ImageIcon(getClass().getResource(loaderSettingsPath));
    this.setLayout(null);
    this.setVisible(true);
    this.setSize(400, 340);
    this.color = Color.WHITE;
    this.setOpaque(false);

    this.locationFromInternet = new JLabel();
    this.countriesLabel = new JLabel(PropertiesHandler.getSingleton().getValue(1049));
    this.citiesLabel = new JLabel(PropertiesHandler.getSingleton().getValue(1050));
    this.longitudeLabel = new JLabel(PropertiesHandler.getSingleton().getValue(1051));
    this.latitudeLabel = new JLabel(PropertiesHandler.getSingleton().getValue(1052));
    this.timezoneLabel = new JLabel(PropertiesHandler.getSingleton().getValue(1053));
    this.longitudeValue = new JLabel();
    this.latitudeValue = new JLabel();
    this.timezoneValue = new JLabel();
    this.getLocationFromInternet = new JLabel(PropertiesHandler.getSingleton().getValue(1105));
    this.getLocationFromInternet.setFont(new Font("TimesRoman", Font.ROMAN_BASELINE, 13));
    this.applyButton = new JButton(PropertiesHandler.getSingleton().getValue(1054));
    this.applyButton.setEnabled(false);
    this.applyButton.addActionListener(new ActionListener() {

        @Override//from  ww w. jav a 2 s  .  c om
        public void actionPerformed(ActionEvent e) {//Applay button click handler
            try {
                applyButtonListener(e);
            } catch (Exception e1) {
                try {
                    JOptionPane.showMessageDialog(null, PropertiesHandler.getSingleton().getValue(1070),
                            PropertiesHandler.getSingleton().getValue(1069), JOptionPane.ERROR_MESSAGE);
                } catch (Exception e2) {
                }
            }
        }
    });

    if (UserConfig.getSingleton().getLanguage().equalsIgnoreCase(ar)) {
        this.getLocationFromInternet.setBounds(50, 20, 280, 20);
        this.locationFromInternet.setBounds(10, 10, 30, 30);
    } else if (UserConfig.getSingleton().getLanguage().equalsIgnoreCase(eng)) {
        this.getLocationFromInternet.setBounds(10, 20, 280, 20);
        this.locationFromInternet.setBounds(280, 10, 30, 30);
    } else {
        this.getLocationFromInternet.setBounds(10, 20, 280, 20);
        this.locationFromInternet.setBounds(250, 10, 30, 30);
    }

    this.locationFromInternet.setIcon(locationfromInternetIcon);
    this.locationFromInternet.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(final MouseEvent e) {
            new Thread(new Runnable() {
                @Override
                public void run() {
                    if (locationFromInternet.isEnabled()) {
                        locationFromInternet.setEnabled(false);
                        locationFromInternet.setIcon(loaderIcon);
                        locationFromInternetLabelMouseClicked(e);
                    }
                }
            }).start();
        }
    });

    this.countriesLabel.setForeground(color);
    this.citiesLabel.setForeground(color);
    this.longitudeLabel.setForeground(color);
    this.latitudeLabel.setForeground(color);
    this.timezoneLabel.setForeground(color);
    this.longitudeValue.setForeground(color);
    this.latitudeValue.setForeground(color);
    this.timezoneValue.setForeground(color);
    this.getLocationFromInternet.setForeground(color);

    this.countriesLabel.setBounds(5, 50, 100, 25);
    this.citiesLabel.setBounds(195, 50, 100, 25);

    this.longitudeLabel.setBounds(10, 240, 120, 30);
    this.latitudeLabel.setBounds(140, 240, 120, 30);
    this.timezoneLabel.setBounds(260, 240, 120, 30);
    this.longitudeValue.setBounds(20, 265, 120, 30);
    this.latitudeValue.setBounds(150, 265, 120, 30);
    this.timezoneValue.setBounds(270, 265, 60, 30);
    this.applyButton.setBounds(125, 300, 150, 30);

    this.countriesModel = new DefaultListModel();
    this.citiesModel = new DefaultListModel();

    this.countriesList = new JList();
    this.countriesList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    this.countriesList.setSelectedIndex(0);

    this.countriesList.setSelectionBackground(Color.GRAY);
    this.countriesList.setSelectionForeground(Color.WHITE);

    this.citiesList = new JList();
    this.citiesList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    this.citiesList.setSelectedIndex(0);

    this.citiesList.setSelectionBackground(Color.GRAY);
    this.citiesList.setSelectionForeground(Color.WHITE);

    this.countriesList.setModel(countriesModel);
    this.citiesList.setModel(citiesModel);

    this.arrayCountries = new ArrayList<Country>();
    this.arrayCountries = XmlHandler.getSingleton().getAllCountries();//get all countries names from country xml file 
    this.arrayCities = new ArrayList<City>();
    this.arrayCities = XmlHandler.getSingleton().getAllCities(arrayCountries.get(0).getName());//get all cities for first country from xml file

    for (Country country : arrayCountries) {
        countriesModel.addElement(country.getName());//set all countries names to countries model
    }

    this.countriesList.addListSelectionListener(new ListSelectionListener() {

        @Override
        public void valueChanged(ListSelectionEvent e) {
            if (!country.equalsIgnoreCase("") && countriesList.getSelectedIndex() == 0) {

            } else {
                citiesModel.clear();
                try {
                    arrayCities2 = XmlHandler.getSingleton()
                            .getAllCities((String) countriesList.getSelectedValue());
                } catch (Exception e1) {
                    try {
                        JOptionPane.showMessageDialog(null, PropertiesHandler.getSingleton().getValue(1070),
                                PropertiesHandler.getSingleton().getValue(1069), JOptionPane.ERROR_MESSAGE);
                    } catch (Exception e2) {
                    }
                }
                for (City city : arrayCities2) {
                    citiesModel.addElement(city.getName());//set all cities names to cities model for selected country
                }
            }
        }
    });

    for (City city : arrayCities) {
        citiesModel.addElement(city.getName());//set all cities names to cities model
    }

    this.citiesList.addListSelectionListener(new ListSelectionListener() {//set longitude , latitude and time zone from selected city

        @Override
        public void valueChanged(ListSelectionEvent e) {
            if (!city.equalsIgnoreCase("") && citiesList.getSelectedIndex() == 0) {
            } else {
                applyButton.setEnabled(true);
                if (arrayCities2 != null && arrayCities2.size() >= 1) {
                    if (citiesList != null && citiesList.getSelectedIndex() >= 0) {
                        City city = arrayCities2.get(citiesList.getSelectedIndex());
                        longitudeValue.setText(String.valueOf(Double.valueOf(city.getLongitude()) / 10000));
                        latitudeValue.setText(String.valueOf(Double.valueOf(city.getLatitude()) / 10000));
                        timezoneValue.setText(String.valueOf(Double.valueOf(city.getTimezone()) / 100));
                    }
                }
            }
        }
    });

    //set longitude , latitude and time zone values to labels from selected city
    this.longitudeValue.setText(String.valueOf(Double.valueOf(arrayCities.get(0).getLongitude()) / 10000));
    this.latitudeValue.setText(String.valueOf(Double.valueOf(arrayCities.get(0).getLatitude()) / 10000));
    this.timezoneValue.setText(String.valueOf(Double.valueOf(arrayCities.get(0).getTimezone()) / 100));

    this.countriesListScrollPane = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
            JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    this.countriesListScrollPane.setViewportView(countriesList);
    this.countriesListScrollPane.setBounds(5, 80, 180, 150);

    this.citiesListScrollPane = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
            JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    this.citiesListScrollPane.setViewportView(citiesList);
    this.citiesListScrollPane.setBounds(195, 80, 180, 150);

    this.add(countriesLabel);
    this.add(citiesLabel);
    this.add(countriesListScrollPane);
    this.add(citiesListScrollPane);
    this.add(longitudeLabel);
    this.add(longitudeValue);
    this.add(latitudeLabel);
    this.add(latitudeValue);
    this.add(timezoneLabel);
    this.add(timezoneValue);
    this.add(applyButton);
    this.add(locationFromInternet);
    this.add(getLocationFromInternet);

    this.setVisible(true);
}