Example usage for javax.swing GroupLayout PREFERRED_SIZE

List of usage examples for javax.swing GroupLayout PREFERRED_SIZE

Introduction

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

Prototype

int PREFERRED_SIZE

To view the source code for javax.swing GroupLayout PREFERRED_SIZE.

Click Source Link

Document

Indicates the preferred size from the component or gap should be used for a particular range value.

Usage

From source file:at.nhmwien.schema_mapping_tool.ProcessMappingWindow.java

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

    progressPanel = new javax.swing.JPanel();
    progressBar = new javax.swing.JProgressBar();
    progressBarLabel = new javax.swing.JLabel();
    abortButton = new javax.swing.JButton();
    processButton = new javax.swing.JButton();
    typeSelectTabbedPanel = new javax.swing.JTabbedPane();
    optionsPanel = new javax.swing.JPanel();
    inputFileFormatLabel = new javax.swing.JLabel();
    outputFileFormatLabel = new javax.swing.JLabel();
    inputFileFormatComboBox = new javax.swing.JComboBox();
    outputFileFormatComboBox = new javax.swing.JComboBox();
    ifEncodingLabel = new javax.swing.JLabel();
    ifEncodingComboBox = new javax.swing.JComboBox();
    ofEncodingLabel = new javax.swing.JLabel();
    ofEncodingComboBox = new javax.swing.JComboBox();
    cooButton = new javax.swing.JButton();
    cioButton = new javax.swing.JButton();
    inputIDPrefixLabel = new javax.swing.JLabel();
    inputIDPrefixTextField = new javax.swing.JTextField();
    countThresholdLabel = new javax.swing.JLabel();
    countThresholdTextField = new javax.swing.JFormattedTextField();
    menuToolBar = new javax.swing.JToolBar();
    loadSettingsButton = new javax.swing.JButton();
    saveSettingsButton = new javax.swing.JButton();

    setTitle("Process Mapping");
    setResizable(false);

    progressPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Mapping Progress",
            javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
            javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 1, 12),
            new java.awt.Color(1, 1, 1))); // NOI18N

    progressBarLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    progressBarLabel.setText("Progress");

    javax.swing.GroupLayout progressPanelLayout = new javax.swing.GroupLayout(progressPanel);
    progressPanel.setLayout(progressPanelLayout);
    progressPanelLayout.setHorizontalGroup(
            progressPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(
                    javax.swing.GroupLayout.Alignment.TRAILING,
                    progressPanelLayout.createSequentialGroup().addContainerGap()
                            .addGroup(progressPanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(progressBarLabel, javax.swing.GroupLayout.Alignment.LEADING,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, 657, Short.MAX_VALUE)
                                    .addComponent(progressBar, javax.swing.GroupLayout.Alignment.LEADING,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, 657, Short.MAX_VALUE))
                            .addContainerGap()));
    progressPanelLayout.setVerticalGroup(progressPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, progressPanelLayout.createSequentialGroup()
                    .addComponent(progressBarLabel)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap()));

    abortButton.setText("Abort");
    abortButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            abortButtonActionPerformed(evt);
        }
    });

    processButton.setText("Process");
    processButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            processButtonActionPerformed(evt);
        }
    });

    optionsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Process Options",
            javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
            javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 1, 12),
            new java.awt.Color(1, 1, 1))); // NOI18N

    inputFileFormatLabel.setText("Input Format:");

    outputFileFormatLabel.setText("Output Format:");

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

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

    ifEncodingLabel.setText("Encoding:");

    ofEncodingLabel.setText("Encoding:");

    cooButton.setText("Output Order");
    cooButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            cooButtonActionPerformed(evt);
        }
    });

    cioButton.setText("Input Order");
    cioButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            cioButtonActionPerformed(evt);
        }
    });

    inputIDPrefixLabel.setText("Input ID Prefix:");

    countThresholdLabel.setText("New File every X entries:");

    countThresholdTextField.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(
            new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));
    countThresholdTextField.setText("0");

    javax.swing.GroupLayout optionsPanelLayout = new javax.swing.GroupLayout(optionsPanel);
    optionsPanel.setLayout(optionsPanelLayout);
    optionsPanelLayout.setHorizontalGroup(optionsPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(optionsPanelLayout.createSequentialGroup().addContainerGap().addGroup(optionsPanelLayout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(optionsPanelLayout.createSequentialGroup().addGroup(optionsPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(inputFileFormatLabel, javax.swing.GroupLayout.Alignment.LEADING,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE)
                            .addComponent(outputFileFormatLabel, javax.swing.GroupLayout.Alignment.LEADING,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE))
                            .addGap(18, 18, 18)
                            .addGroup(optionsPanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(optionsPanelLayout.createSequentialGroup()
                                            .addComponent(inputFileFormatComboBox,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(18, 18, 18).addComponent(ifEncodingLabel))
                                    .addGroup(optionsPanelLayout.createSequentialGroup()
                                            .addComponent(outputFileFormatComboBox,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(18, 18, 18).addComponent(ofEncodingLabel)))
                            .addGap(18, 18, 18)
                            .addGroup(optionsPanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(ofEncodingComboBox, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(ifEncodingComboBox, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(optionsPanelLayout.createSequentialGroup().addComponent(cioButton)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 434,
                                    Short.MAX_VALUE)
                            .addComponent(cooButton))
                    .addGroup(optionsPanelLayout.createSequentialGroup().addComponent(inputIDPrefixLabel)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(inputIDPrefixTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 552,
                                    Short.MAX_VALUE))
                    .addGroup(optionsPanelLayout.createSequentialGroup()
                            .addComponent(countThresholdLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 163,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(countThresholdTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 65,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addContainerGap()));
    optionsPanelLayout.setVerticalGroup(optionsPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(optionsPanelLayout.createSequentialGroup().addContainerGap().addGroup(optionsPanelLayout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(inputFileFormatLabel)
                    .addComponent(inputFileFormatComboBox, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ifEncodingLabel)
                    .addComponent(ifEncodingComboBox, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(optionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(outputFileFormatLabel)
                            .addComponent(outputFileFormatComboBox, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(ofEncodingLabel).addComponent(ofEncodingComboBox,
                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addGroup(optionsPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(inputIDPrefixLabel, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(inputIDPrefixTextField))
                    .addGap(18, 18, 18)
                    .addGroup(optionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(countThresholdLabel).addComponent(countThresholdTextField,
                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(optionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(cioButton).addComponent(cooButton))
                    .addContainerGap()));

    menuToolBar.setRollover(true);

    loadSettingsButton.setText("Load");
    loadSettingsButton.setFocusable(false);
    loadSettingsButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    loadSettingsButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    loadSettingsButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            loadSettingsButtonActionPerformed(evt);
        }
    });
    menuToolBar.add(loadSettingsButton);

    saveSettingsButton.setText("Save");
    saveSettingsButton.setFocusable(false);
    saveSettingsButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    saveSettingsButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    saveSettingsButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            saveSettingsButtonActionPerformed(evt);
        }
    });
    menuToolBar.add(saveSettingsButton);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(menuToolBar, javax.swing.GroupLayout.DEFAULT_SIZE, 715, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup().addContainerGap()
                    .addComponent(optionsPanel, javax.swing.GroupLayout.DEFAULT_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                    layout.createSequentialGroup().addContainerGap().addComponent(typeSelectTabbedPanel,
                            javax.swing.GroupLayout.DEFAULT_SIZE, 703, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                    layout.createSequentialGroup().addContainerGap()
                            .addComponent(progressPanel, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addContainerGap())
            .addGroup(layout.createSequentialGroup().addContainerGap().addComponent(abortButton)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 541, Short.MAX_VALUE)
                    .addComponent(processButton).addContainerGap()));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                    .addComponent(menuToolBar, javax.swing.GroupLayout.PREFERRED_SIZE, 25,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(optionsPanel, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(typeSelectTabbedPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 182,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(progressPanel, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(abortButton).addComponent(processButton))
                    .addContainerGap()));

    pack();
}

From source file:com.ga.forms.DailyLogAddUI.java

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

    group = new javax.swing.ButtonGroup();
    jPanel1 = new javax.swing.JPanel();
    mainTitleLbl = new javax.swing.JLabel();
    jSeparator1 = new javax.swing.JSeparator();
    exitButton = new javax.swing.JButton();
    viewButton = new javax.swing.JButton();
    dailyLogPanel = new javax.swing.JPanel();
    dateLbl = new javax.swing.JLabel();
    dateDisplayLbl = new javax.swing.JLabel();
    dayLbl = new javax.swing.JLabel();
    dayDisplayLbl = new javax.swing.JLabel();
    checkInLbl = new javax.swing.JLabel();
    checkoutLbl = new javax.swing.JLabel();
    breakLbl = new javax.swing.JLabel();
    checkInTimeCombo = new javax.swing.JComboBox();
    checkOutTimeCombo = new javax.swing.JComboBox();
    checkInOutButton = new javax.swing.JToggleButton();
    breakOptionPanel = new javax.swing.JPanel();
    yesRdButton = new javax.swing.JRadioButton();
    noRdButton = new javax.swing.JRadioButton();
    customRdButton = new javax.swing.JRadioButton();
    customBreakTimeTextField = new javax.swing.JTextField();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setTitle("Daily Log Manager");
    setBounds(new java.awt.Rectangle(0, 0, 395, 389));
    setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
    setMinimumSize(new java.awt.Dimension(395, 389));

    jPanel1.setMaximumSize(new java.awt.Dimension(395, 389));
    jPanel1.setMinimumSize(new java.awt.Dimension(395, 389));
    jPanel1.setPreferredSize(new java.awt.Dimension(464, 474));

    mainTitleLbl.setFont(new java.awt.Font("Arial", 0, 36)); // NOI18N
    mainTitleLbl.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    mainTitleLbl.setText("Daily Log Manager");
    mainTitleLbl.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);

    exitButton.setText("Exit");
    exitButton.setMaximumSize(new java.awt.Dimension(72, 29));
    exitButton.setMinimumSize(new java.awt.Dimension(72, 29));
    exitButton.setPreferredSize(new java.awt.Dimension(72, 29));
    exitButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            exitButtonActionPerformed(evt);
        }
    });

    viewButton.setText("View");
    viewButton.setMaximumSize(new java.awt.Dimension(72, 29));
    viewButton.setMinimumSize(new java.awt.Dimension(72, 29));
    viewButton.setPreferredSize(new java.awt.Dimension(72, 29));
    viewButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            viewButtonActionPerformed(evt);
        }
    });

    dailyLogPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Add Daily Log"));
    dailyLogPanel.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N
    dailyLogPanel.setName("Daily Log Entry"); // NOI18N
    dailyLogPanel.setPreferredSize(new java.awt.Dimension(240, 190));

    dateLbl.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N
    dateLbl.setText("Date");
    dateLbl.setPreferredSize(new java.awt.Dimension(56, 17));

    dateDisplayLbl.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N
    dateDisplayLbl.setEnabled(false);
    dateDisplayLbl.setMaximumSize(new java.awt.Dimension(144, 17));
    dateDisplayLbl.setMinimumSize(new java.awt.Dimension(144, 17));
    dateDisplayLbl.setPreferredSize(new java.awt.Dimension(144, 17));
    dateDisplayLbl.setRequestFocusEnabled(false);

    dayLbl.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N
    dayLbl.setText("Day");
    dayLbl.setPreferredSize(new java.awt.Dimension(56, 17));

    dayDisplayLbl.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N
    dayDisplayLbl.setEnabled(false);
    dayDisplayLbl.setMaximumSize(new java.awt.Dimension(144, 17));
    dayDisplayLbl.setMinimumSize(new java.awt.Dimension(144, 17));
    dayDisplayLbl.setPreferredSize(new java.awt.Dimension(144, 17));
    dayDisplayLbl.setRequestFocusEnabled(false);

    checkInLbl.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N
    checkInLbl.setText("In");
    checkInLbl.setPreferredSize(new java.awt.Dimension(56, 17));

    checkoutLbl.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N
    checkoutLbl.setText("Out");
    checkoutLbl.setPreferredSize(new java.awt.Dimension(56, 17));

    breakLbl.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N
    breakLbl.setText("Break");
    breakLbl.setVerticalAlignment(javax.swing.SwingConstants.TOP);
    breakLbl.setPreferredSize(new java.awt.Dimension(56, 17));

    checkInTimeCombo.setModel(
            new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
    checkInTimeCombo.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            checkInTimeComboActionPerformed(evt);
        }
    });

    checkOutTimeCombo.setModel(
            new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
    checkOutTimeCombo.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            checkOutTimeComboActionPerformed(evt);
        }
    });

    checkInOutButton.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N
    checkInOutButton.setText("Check In");
    checkInOutButton.setMaximumSize(new java.awt.Dimension(102, 29));
    checkInOutButton.setMinimumSize(new java.awt.Dimension(102, 29));
    checkInOutButton.setPreferredSize(new java.awt.Dimension(102, 29));
    checkInOutButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            checkInOutButtonActionPerformed(evt);
        }
    });

    breakOptionPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Options"));
    breakOptionPanel.setPreferredSize(new java.awt.Dimension(255, 98));

    yesRdButton.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N
    yesRdButton.setText("Yes");
    yesRdButton.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            yesRdButtonMouseClicked(evt);
        }
    });

    noRdButton.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N
    noRdButton.setSelected(true);
    noRdButton.setText("No");
    noRdButton.setPreferredSize(new java.awt.Dimension(51, 24));
    noRdButton.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            noRdButtonMouseClicked(evt);
        }
    });

    customRdButton.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N
    customRdButton.setText("Custom");
    customRdButton.addItemListener(new java.awt.event.ItemListener() {
        public void itemStateChanged(java.awt.event.ItemEvent evt) {
            customRdButtonItemStateChanged(evt);
        }
    });
    customRdButton.addChangeListener(new javax.swing.event.ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent evt) {
            customRdButtonStateChanged(evt);
        }
    });
    customRdButton.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            customRdButtonMouseClicked(evt);
        }
    });

    customBreakTimeTextField.setText("00:30");
    customBreakTimeTextField.setEnabled(false);

    javax.swing.GroupLayout breakOptionPanelLayout = new javax.swing.GroupLayout(breakOptionPanel);
    breakOptionPanel.setLayout(breakOptionPanelLayout);
    breakOptionPanelLayout.setHorizontalGroup(breakOptionPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(breakOptionPanelLayout.createSequentialGroup().addGap(5, 5, 5)
                    .addGroup(breakOptionPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(customBreakTimeTextField, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(breakOptionPanelLayout.createSequentialGroup().addComponent(yesRdButton)
                                    .addGap(5, 5, 5)
                                    .addComponent(noRdButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(5, 5, 5).addComponent(customRdButton)
                                    .addGap(0, 0, Short.MAX_VALUE)))
                    .addContainerGap()));
    breakOptionPanelLayout.setVerticalGroup(breakOptionPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(breakOptionPanelLayout.createSequentialGroup().addGap(5, 5, 5)
                    .addGroup(breakOptionPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(yesRdButton)
                            .addComponent(noRdButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(customRdButton))
                    .addGap(5, 5, 5).addComponent(customBreakTimeTextField,
                            javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                            javax.swing.GroupLayout.PREFERRED_SIZE)));

    yesRdButton.getAccessibleContext().setAccessibleName("breakRdButton");
    noRdButton.getAccessibleContext().setAccessibleName("breakRdButton");
    customRdButton.getAccessibleContext().setAccessibleName("breakRdButton");
    customBreakTimeTextField.getAccessibleContext().setAccessibleName("customBreakTimeTextField");

    javax.swing.GroupLayout dailyLogPanelLayout = new javax.swing.GroupLayout(dailyLogPanel);
    dailyLogPanel.setLayout(dailyLogPanelLayout);
    dailyLogPanelLayout.setHorizontalGroup(dailyLogPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dailyLogPanelLayout.createSequentialGroup().addContainerGap().addGroup(dailyLogPanelLayout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                            dailyLogPanelLayout.createSequentialGroup().addGroup(dailyLogPanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, dailyLogPanelLayout
                                            .createSequentialGroup()
                                            .addComponent(dayLbl, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(
                                                    javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(dayDisplayLbl, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    304, Short.MAX_VALUE))
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, dailyLogPanelLayout
                                            .createSequentialGroup()
                                            .addComponent(dateLbl, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(
                                                    javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(
                                                    dateDisplayLbl, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                                    .addGap(44, 44, 44))
                    .addGroup(dailyLogPanelLayout.createSequentialGroup().addGroup(dailyLogPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(dailyLogPanelLayout.createSequentialGroup()
                                    .addComponent(checkInLbl, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(checkInTimeCombo, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(dailyLogPanelLayout.createSequentialGroup().addGroup(dailyLogPanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(checkoutLbl, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(breakLbl, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(dailyLogPanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(checkOutTimeCombo,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(breakOptionPanel,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 220,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE))))
                            .addContainerGap(152, Short.MAX_VALUE))))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, dailyLogPanelLayout.createSequentialGroup()
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(checkInOutButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(21, 21, 21)));
    dailyLogPanelLayout.setVerticalGroup(dailyLogPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dailyLogPanelLayout.createSequentialGroup().addContainerGap()
                    .addGroup(dailyLogPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(dateLbl, javax.swing.GroupLayout.DEFAULT_SIZE, 18, Short.MAX_VALUE)
                            .addComponent(dateDisplayLbl, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(dailyLogPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(dayLbl, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(dayDisplayLbl, javax.swing.GroupLayout.PREFERRED_SIZE, 18,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(dailyLogPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(checkInTimeCombo).addComponent(checkInLbl,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(dailyLogPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(checkOutTimeCombo).addComponent(checkoutLbl,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(dailyLogPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(dailyLogPanelLayout.createSequentialGroup()
                                    .addComponent(breakLbl, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addGap(47, 47, 47))
                            .addGroup(dailyLogPanelLayout.createSequentialGroup()
                                    .addComponent(breakOptionPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 84,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, 40,
                                            Short.MAX_VALUE)
                                    .addComponent(checkInOutButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addContainerGap()))));

    dayLbl.getAccessibleContext().setAccessibleName("dayLbl");
    dayDisplayLbl.getAccessibleContext().setAccessibleName("dayDisplayLbl");
    checkInTimeCombo.getAccessibleContext().setAccessibleName("checkInTimeCombo");
    checkOutTimeCombo.getAccessibleContext().setAccessibleName("checkOutTimeCombo");
    checkInOutButton.getAccessibleContext().setAccessibleName("checkInOutButton");

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(dailyLogPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 452,
                                    Short.MAX_VALUE)
                            .addGroup(jPanel1Layout.createSequentialGroup().addGap(0, 287, Short.MAX_VALUE)
                                    .addComponent(viewButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(exitButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(mainTitleLbl, javax.swing.GroupLayout.Alignment.LEADING,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE))
                    .addContainerGap())
            .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.TRAILING));
    jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap()
                    .addComponent(mainTitleLbl, javax.swing.GroupLayout.PREFERRED_SIZE, 70,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(dailyLogPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 327, Short.MAX_VALUE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 6,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(exitButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(viewButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap()));

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE)
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 0, Short.MAX_VALUE)));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE)
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 0, Short.MAX_VALUE)));

    pack();
}

From source file:frames.consulta.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./*  w  w w.j a va 2 s.  com*/
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    grupoconsulta = new javax.swing.ButtonGroup();
    jPopupMenu1 = new javax.swing.JPopupMenu();
    mnModificar = new javax.swing.JMenuItem();
    mnVer = new javax.swing.JMenuItem();
    jPanel1 = new javax.swing.JPanel();
    jPanel2 = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();
    txtbuscar = new javax.swing.JTextField();
    btnbuscar = new javax.swing.JButton();
    jPanel3 = new javax.swing.JPanel();
    jScrollPane2 = new javax.swing.JScrollPane();
    tblconsulta = new javax.swing.JTable();
    cedula = new javax.swing.JRadioButton();
    apellido = new javax.swing.JRadioButton();
    jButton1 = new javax.swing.JButton();
    jLabel3 = new javax.swing.JLabel();
    jPanel4 = new javax.swing.JPanel();
    btnModificar = new javax.swing.JButton();
    btnver = new javax.swing.JButton();
    jLabel2 = new javax.swing.JLabel();
    jButton3 = new javax.swing.JButton();
    btneliminar = new javax.swing.JButton();
    jMenuBar1 = new javax.swing.JMenuBar();
    jMenu1 = new javax.swing.JMenu();
    jMenuItem1 = new javax.swing.JMenuItem();

    mnModificar.setText("Modificar");
    mnModificar.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            mnModificarActionPerformed(evt);
        }
    });
    jPopupMenu1.add(mnModificar);

    mnVer.setText("ver");
    mnVer.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            mnVerActionPerformed(evt);
        }
    });
    jPopupMenu1.add(mnVer);

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

    jPanel1.setBackground(new java.awt.Color(30, 51, 125));

    jPanel2.setBackground(new java.awt.Color(78, 131, 173));
    jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Consulta",
            javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
            javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11),
            new java.awt.Color(247, 237, 237))); // NOI18N
    jPanel2.setForeground(new java.awt.Color(245, 231, 231));

    jLabel1.setFont(new java.awt.Font("DejaVu Sans", 1, 14)); // NOI18N
    jLabel1.setForeground(new java.awt.Color(254, 238, 238));
    jLabel1.setText("Buscar");

    btnbuscar.setForeground(new java.awt.Color(254, 254, 254));
    btnbuscar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Search2.png"))); // NOI18N
    btnbuscar.setText("Buscar");
    btnbuscar.setContentAreaFilled(false);
    btnbuscar.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
    btnbuscar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    btnbuscar.setIconTextGap(-5);
    btnbuscar.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
    btnbuscar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    btnbuscar.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnbuscarActionPerformed(evt);
        }
    });

    jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Lista de Pacientes"));

    tblconsulta
            .setModel(new javax.swing.table.DefaultTableModel(new Object[][] { {}, {}, {}, {} }, new String[] {

    }));
    tblconsulta.setComponentPopupMenu(jPopupMenu1);
    jScrollPane2.setViewportView(tblconsulta);

    javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
    jPanel3.setLayout(jPanel3Layout);
    jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(jPanel3Layout
                    .createSequentialGroup().addContainerGap().addComponent(jScrollPane2).addContainerGap()));
    jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                    jPanel3Layout
                            .createSequentialGroup().addComponent(jScrollPane2,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, 530, Short.MAX_VALUE)
                            .addContainerGap()));

    cedula.setBackground(new java.awt.Color(254, 254, 254));
    grupoconsulta.add(cedula);
    cedula.setFont(new java.awt.Font("DejaVu Sans", 1, 14)); // NOI18N
    cedula.setForeground(new java.awt.Color(244, 236, 236));
    cedula.setText("Cdula");

    grupoconsulta.add(apellido);
    apellido.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
    apellido.setForeground(new java.awt.Color(248, 236, 236));
    apellido.setText("Apellido");

    jButton1.setForeground(new java.awt.Color(253, 251, 251));
    jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/consulgene.png"))); // NOI18N
    jButton1.setText("General");
    jButton1.setContentAreaFilled(false);
    jButton1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
    jButton1.setDoubleBuffered(true);
    jButton1.setFocusCycleRoot(true);
    jButton1.setFocusable(false);
    jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jButton1.setIconTextGap(-5);
    jButton1.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
    jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    jButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton1ActionPerformed(evt);
        }
    });

    jLabel3.setFont(new java.awt.Font("DejaVu Sans", 0, 18)); // NOI18N
    jLabel3.setForeground(new java.awt.Color(254, 254, 254));
    jLabel3.setText("Tipo de Bsqueda");

    javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(jPanel2Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap().addGroup(jPanel2Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.TRAILING,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                            Short.MAX_VALUE)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                            .addGroup(jPanel2Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(jPanel2Layout.createSequentialGroup()
                                            .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 54,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(txtbuscar, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    437, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel2Layout.createSequentialGroup()
                                            .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addGap(40, 40, 40).addComponent(cedula).addGap(58, 58, 58)
                                            .addComponent(apellido).addGap(133, 133, 133)))
                            .addComponent(btnbuscar, javax.swing.GroupLayout.PREFERRED_SIZE, 103,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 103,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(0, 0, Short.MAX_VALUE)))
                    .addContainerGap()));
    jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup().addGroup(jPanel2Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap()
                            .addGroup(jPanel2Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addGroup(jPanel2Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(apellido).addComponent(cedula)))
                            .addGap(37, 37, 37)
                            .addGroup(jPanel2Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(txtbuscar, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 36,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGap(38, 38, 38))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                            jPanel2Layout.createSequentialGroup().addGap(32, 32, 32).addGroup(jPanel2Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 94,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(btnbuscar)).addGap(18, 18, 18)))
                    .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(62, 62, 62)));

    jPanel4.setBackground(new java.awt.Color(234, 239, 242));

    btnModificar
            .setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/1466449409_Application.png"))); // NOI18N
    btnModificar.setText("Modificar ");
    btnModificar.setContentAreaFilled(false);
    btnModificar.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
    btnModificar.setDoubleBuffered(true);
    btnModificar.setFocusCycleRoot(true);
    btnModificar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    btnModificar.setIconTextGap(-1);
    btnModificar.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
    btnModificar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    btnModificar.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnModificarActionPerformed(evt);
        }
    });

    btnver.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/1466449365_PatientData.png"))); // NOI18N
    btnver.setText("Ver Historia");
    btnver.setContentAreaFilled(false);
    btnver.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
    btnver.setDoubleBuffered(true);
    btnver.setFocusCycleRoot(true);
    btnver.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    btnver.setIconTextGap(-10);
    btnver.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
    btnver.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    btnver.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnverActionPerformed(evt);
        }
    });

    jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/cropped-happy_tooth3.jpg"))); // NOI18N

    jButton3.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/images/1466451542_delete_unapprove_discard_remove_x_red.png"))); // NOI18N
    jButton3.setText("Salir");
    jButton3.setContentAreaFilled(false);
    jButton3.setDoubleBuffered(true);
    jButton3.setFocusCycleRoot(true);
    jButton3.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jButton3.setIconTextGap(5);
    jButton3.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
    jButton3.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    jButton3.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton3ActionPerformed(evt);
        }
    });

    btneliminar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/1466454184_free-27.png"))); // NOI18N
    btneliminar.setText("Eliminar");
    btneliminar.setContentAreaFilled(false);
    btneliminar.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
    btneliminar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    btneliminar.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
    btneliminar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    btneliminar.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btneliminarActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
    jPanel4.setLayout(jPanel4Layout);
    jPanel4Layout.setHorizontalGroup(jPanel4Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup().addGroup(jPanel4Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnver, javax.swing.GroupLayout.Alignment.TRAILING,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                            Short.MAX_VALUE)
                    .addGroup(jPanel4Layout.createSequentialGroup().addContainerGap().addGroup(jPanel4Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jButton3, javax.swing.GroupLayout.Alignment.TRAILING,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE)
                            .addGroup(jPanel4Layout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE)
                                    .addGroup(jPanel4Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
                                                    false)
                                            .addComponent(btnModificar,
                                                    javax.swing.GroupLayout.Alignment.TRAILING,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 172,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addComponent(btneliminar, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                    .addContainerGap()));
    jPanel4Layout
            .setVerticalGroup(
                    jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                    jPanel4Layout.createSequentialGroup()
                                            .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 199,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(29, 29, 29)
                                            .addComponent(btnModificar, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    139, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(18, 18, 18)
                                            .addComponent(btnver, javax.swing.GroupLayout.PREFERRED_SIZE, 125,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(18, 18, 18).addComponent(btneliminar).addGap(18, 18, 18)
                                            .addComponent(jButton3).addContainerGap(59, Short.MAX_VALUE)));

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup().addGap(30, 30, 30)
                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    jPanel1Layout
            .setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap()
                            .addGroup(jPanel1Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addContainerGap(24, Short.MAX_VALUE)));

    jMenu1.setText("Reportes");

    jMenuItem1.setText("Reportes de Pacientes");
    jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem1ActionPerformed(evt);
        }
    });
    jMenu1.add(jMenuItem1);

    jMenuBar1.add(jMenu1);

    setJMenuBar(jMenuBar1);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                    javax.swing.GroupLayout.PREFERRED_SIZE));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(
            jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
            javax.swing.GroupLayout.PREFERRED_SIZE));

    pack();
}

From source file:gtu._work.mvn.MavenRepositoryUI.java

private void initGUI() {
    try {/*from   w w w  .jav a  2  s. c o m*/
        {
        }
        BorderLayout thisLayout = new BorderLayout();
        getContentPane().setLayout(thisLayout);
        this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        {
            jTabbedPane1 = new JTabbedPane();
            getContentPane().add(jTabbedPane1, BorderLayout.CENTER);
            {
                jPanel1 = new JPanel();
                BorderLayout jPanel1Layout = new BorderLayout();
                jPanel1.setLayout(jPanel1Layout);
                scanList = new JList();
                jTabbedPane1.addTab("repository", null, jPanel1, null);
                {
                    scanText = new JTextField();
                    jPanel1.add(scanText, BorderLayout.NORTH);
                }
                {
                    jScrollPane1 = new JScrollPane();
                    jPanel1.add(jScrollPane1, BorderLayout.CENTER);
                    {
                        ListModel scanListModel = new DefaultListModel();
                        jScrollPane1.setViewportView(scanList);
                        scanList.setModel(scanListModel);
                        scanList.addMouseListener(new MouseAdapter() {
                            public void mouseClicked(MouseEvent evt) {
                                defaultJListClick(scanList, evt);
                            }
                        });
                    }
                }
            }
            {
                jPanel4 = new JPanel();
                BorderLayout jPanel4Layout = new BorderLayout();
                jPanel4.setLayout(jPanel4Layout);
                jTabbedPane1.addTab("repository only jar", null, jPanel4, null);
                jPanel4.setPreferredSize(new java.awt.Dimension(520, 298));
                {
                    scanText2 = new JTextField();
                    jPanel4.add(scanText2, BorderLayout.NORTH);
                }
                {
                    jScrollPane3 = new JScrollPane();
                    jPanel4.add(jScrollPane3, BorderLayout.CENTER);
                    {
                        scanList2 = new JList();
                        jScrollPane3.setViewportView(scanList2);
                        ListModel scanList2Model = new DefaultListModel();
                        scanList2.setModel(scanList2Model);
                        scanList2.addMouseListener(new MouseAdapter() {
                            public void mouseClicked(MouseEvent evt) {
                                defaultJListClick(scanList2, evt);
                            }
                        });
                    }
                }
                {
                }
            }
            {
                jPanel2 = new JPanel();
                BorderLayout jPanel2Layout = new BorderLayout();
                jPanel2.setLayout(jPanel2Layout);
                jTabbedPane1.addTab("jar find", null, jPanel2, null);
                {
                    jarFindText = new JTextField();
                    jPanel2.add(jarFindText, BorderLayout.NORTH);
                }
                {
                    jScrollPane2 = new JScrollPane();
                    jPanel2.add(jScrollPane2, BorderLayout.CENTER);
                    {
                        ListModel jarFindListModel = new DefaultListModel();
                        jarFindList = new JList();
                        jScrollPane2.setViewportView(jarFindList);
                        jarFindList.setModel(jarFindListModel);
                        jarFindList.addMouseListener(new MouseAdapter() {
                            public void mouseClicked(MouseEvent evt) {
                                defaultJListClick(jarFindList, evt);
                            }
                        });
                    }
                }
                {
                    jarFindExecute = new JButton();
                    jPanel2.add(jarFindExecute, BorderLayout.SOUTH);
                    jarFindExecute.setText("find");
                    jarFindExecute.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            String searchtext = jarFindText.getText();
                            if (StringUtils.isEmpty(searchtext) || searchtext.length() < 2) {
                                JOptionPaneUtil.newInstance().iconErrorMessage()
                                        .showMessageDialog("", "error");
                                return;
                            }
                            try {
                                DefaultListModel model = new DefaultListModel();
                                jarFindList.setModel(model);

                                searchtext = searchtext.trim();
                                searchtext = searchtext.replace('/', '.');
                                searchtext = searchtext.replace('\\', '.');

                                if (jarfinder == null) {
                                    jarfinder = JarFinder.newInstance();
                                } else {
                                    jarfinder.clear();
                                }

                                jarfinder.pattern(searchtext);

                                DefaultListModel scanModel = (DefaultListModel) scanList.getModel();
                                PomFile pomFile = null;
                                for (int ii = 0; ii < scanModel.getSize(); ii++) {
                                    pomFile = (PomFile) scanModel.getElementAt(ii);
                                    if (pomFile.jarFile == null) {
                                        continue;
                                    }
                                    jarfinder.setDir(pomFile.jarFile);
                                    if (!jarfinder.execute().isEmpty()) {
                                        model.addElement(pomFile);
                                    }
                                    jarfinder.getMap().clear();
                                }
                            } catch (Exception ex) {
                                JOptionPaneUtil.newInstance().iconErrorMessage()
                                        .showMessageDialog(ex.getMessage(), "error");
                                ex.printStackTrace();
                            }
                        }
                    });
                }
            }
            {
                jPanel5 = new JPanel();
                BorderLayout jPanel5Layout = new BorderLayout();
                jTabbedPane1.addTab("detail", null, jPanel5, null);
                jPanel5.setLayout(jPanel5Layout);
                {
                    jScrollPane4 = new JScrollPane();
                    jPanel5.add(jScrollPane4, BorderLayout.CENTER);
                    {
                        TableModel scanTableModel = new DefaultTableModel();
                        scanTable = new JTable();
                        BorderLayout scanTableLayout = new BorderLayout();
                        scanTable.setLayout(scanTableLayout);
                        jScrollPane4.setViewportView(scanTable);
                        scanTable.setModel(scanTableModel);
                        JTableUtil.defaultSetting(scanTable);

                        scanTable.addMouseListener(new MouseAdapter() {
                            public void mouseClicked(MouseEvent evt) {
                                tableMouseClicked(scanTable, 0, evt);
                            }
                        });
                    }
                }
            }
            {
                jPanel3 = new JPanel();
                jTabbedPane1.addTab("config", null, jPanel3, null);
                GroupLayout jPanel3Layout = new GroupLayout((JComponent) jPanel3);
                jPanel3.setLayout(jPanel3Layout);
                {
                    copyToDir = new JButton();
                    copyToDir.setText("set copy to dir");
                    copyToDir.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            File file = JFileChooserUtil.newInstance().selectDirectoryOnly().showOpenDialog()
                                    .getApproveSelectedFile();
                            if (file == null || !file.exists() || !file.isDirectory()) {
                                JOptionPaneUtil.newInstance().iconErrorMessage()
                                        .showMessageDialog("dir is not correct!, set default desktop", "error");
                                file = FileUtil.DESKTOP_DIR;
                            }
                            copyTo = file;
                            System.out.println("copyTo: " + copyTo);
                        }
                    });
                }
                {
                    resetM2Dir = new JButton();
                    resetM2Dir.setText("set .m2 dir");
                    resetM2Dir.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            File file = JFileChooserUtil.newInstance().selectDirectoryOnly().showOpenDialog()
                                    .getApproveSelectedFile();
                            if (file == null || !file.exists() || !file.isDirectory()) {
                                showErrorMsg();
                                repositoryDir = DEFAULT_REPOSITORY_DIR;
                                reloadRepositoryDir();
                                return;
                            }
                            File newRepository = new File(file, "repository");
                            File settings = new File(file, "settings.xml");
                            if (settings.exists() && settings.isFile() && newRepository.exists()
                                    && newRepository.isDirectory()) {
                                repositoryDir = newRepository;
                                reloadRepositoryDir();
                            } else {
                                showErrorMsg();
                            }
                        }

                        void showErrorMsg() {
                            JOptionPaneUtil.newInstance().iconErrorMessage()
                                    .showMessageDialog("dir is not correct!, set default .m2 dir", "error");
                        }
                    });
                }
                {
                    saveCurrentDataBtn = new JButton();
                    saveCurrentDataBtn.setText("save current data");
                    saveCurrentDataBtn.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            File cfgFile = new File(PropertiesUtil.getJarCurrentPath(MavenRepositoryUI.class),
                                    MavenRepositoryUI.class.getSimpleName() + "_" + DateFormatUtil
                                            .format(System.currentTimeMillis(), "yyyyMMdd_HHmmss") + ".cfg");
                            try {
                                ObjectOutputStream writer = new ObjectOutputStream(
                                        new FileOutputStream(cfgFile));
                                writer.writeObject(pomFileList);
                                writer.writeObject(pomFileJarList);
                                writer.writeObject(pomFileMap);
                                writer.flush();
                                writer.close();
                                JOptionPaneUtil.newInstance().iconInformationMessage()
                                        .showMessageDialog("save completed!\n" + cfgFile, "SUCCESS");
                            } catch (Exception ex) {
                                JCommonUtil.handleException(ex);
                                ex.printStackTrace();
                            }
                        }
                    });
                }
                {
                    loadConfigDataBtn = new JButton();
                    loadConfigDataBtn.setText("load config data");
                    loadConfigDataBtn.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            File cfgFile = JFileChooserUtil.newInstance().selectFileOnly()
                                    .addAcceptFile("cfg", ".cfg").showOpenDialog().getApproveSelectedFile();
                            if (cfgFile == null) {
                                JOptionPaneUtil.newInstance().iconErrorMessage()
                                        .showMessageDialog("file is not correct!", "ERROR");
                                return;
                            }
                            try {
                                ObjectInputStream reader = new ObjectInputStream(new FileInputStream(cfgFile));
                                pomFileList = (Set<PomFile>) reader.readObject();
                                pomFileJarList = (Set<PomFile>) reader.readObject();
                                pomFileMap = (Map<DependencyKey, PomFile>) reader.readObject();
                                reader.close();
                                resetUIStatus();
                                JOptionPaneUtil.newInstance().iconInformationMessage()
                                        .showMessageDialog("load completed!\n" + cfgFile, "SUCCESS");
                            } catch (Exception ex) {
                                JCommonUtil.handleException(ex);
                                ex.printStackTrace();
                            }
                        }
                    });

                }
                jPanel3Layout.setHorizontalGroup(jPanel3Layout.createSequentialGroup().addContainerGap(24, 24)
                        .addGroup(jPanel3Layout.createParallelGroup()
                                .addGroup(jPanel3Layout.createSequentialGroup().addComponent(loadConfigDataBtn,
                                        GroupLayout.PREFERRED_SIZE, 223, GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel3Layout.createSequentialGroup().addComponent(saveCurrentDataBtn,
                                        GroupLayout.PREFERRED_SIZE, 223, GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel3Layout.createSequentialGroup().addComponent(copyToDir,
                                        GroupLayout.PREFERRED_SIZE, 223, GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel3Layout.createSequentialGroup().addComponent(resetM2Dir,
                                        GroupLayout.PREFERRED_SIZE, 223, GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel3Layout.createSequentialGroup().addComponent(getJButton1(),
                                        GroupLayout.PREFERRED_SIZE, 223, GroupLayout.PREFERRED_SIZE)))
                        .addContainerGap(281, Short.MAX_VALUE));
                jPanel3Layout.setVerticalGroup(jPanel3Layout.createSequentialGroup().addContainerGap(25, 25)
                        .addComponent(copyToDir, GroupLayout.PREFERRED_SIZE, 30, GroupLayout.PREFERRED_SIZE)
                        .addGap(22)
                        .addComponent(resetM2Dir, GroupLayout.PREFERRED_SIZE, 30, GroupLayout.PREFERRED_SIZE)
                        .addGap(24)
                        .addComponent(saveCurrentDataBtn, GroupLayout.PREFERRED_SIZE, 31,
                                GroupLayout.PREFERRED_SIZE)
                        .addGap(25)
                        .addComponent(loadConfigDataBtn, GroupLayout.PREFERRED_SIZE, 31,
                                GroupLayout.PREFERRED_SIZE)
                        .addGap(28)
                        .addComponent(getJButton1(), GroupLayout.PREFERRED_SIZE, 31, GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(34, Short.MAX_VALUE));
            }
            {
                jPanel6 = new JPanel();
                BorderLayout jPanel6Layout = new BorderLayout();
                jPanel6.setLayout(jPanel6Layout);
                jTabbedPane1.addTab("pom dency", null, jPanel6, null);
                {
                    openPom = new JButton();
                    jPanel6.add(openPom, BorderLayout.NORTH);
                    openPom.setText("open");
                    openPom.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            File file = JFileChooserUtil.newInstance().selectFileAndDirectory()
                                    .showDialog("?pom,pom").getApproveSelectedFile();
                            if (file == null) {
                                JOptionPaneUtil.newInstance().iconErrorMessage()
                                        .showMessageDialog("file is not correct!!", "ERROR");
                                return;
                            }
                            List<File> pomList = new ArrayList<File>();
                            if (file.isFile()
                                    && (file.getName().endsWith(".xml") || file.getName().endsWith(".pom"))) {
                                pomList.add(file);
                            } else {
                                FileUtil.searchFileMatchs(file, "pom.xml", pomList);
                            }
                            Set<PomFile> poms = loadPomList(pomList);
                            resetUIStatus();

                            Map<DependencyKey, PomFile> map = new HashMap<DependencyKey, PomFile>();
                            Set<LoadPomListDependency.DependencyKey> errorSet = new HashSet<LoadPomListDependency.DependencyKey>();
                            for (PomFile p : poms) {
                                openPomFetchDependency(p.pom, map, errorSet);
                            }

                            PomFile pfile = null;
                            DefaultTableModel model = JTableUtil.createModel(true, "groupId", "artifactId",
                                    "jar", "pomFile");
                            for (DependencyKey key : map.keySet()) {
                                pfile = map.get(key);
                                model.addRow(new Object[] { pfile.pom.groupId, pfile.pom.artifactId,
                                        (pfile.jarFile == null ? "" : pfile.jarFile.getName()), pfile });
                            }
                            for (LoadPomListDependency.DependencyKey key : errorSet) {
                                model.addRow(new Object[] { key.groupId, key.artifactId, "ERROR" });
                            }
                            pomDenpendencyTable.setModel(model);
                        }
                    });
                }
                {
                    jScrollPane5 = new JScrollPane();
                    jPanel6.add(jScrollPane5, BorderLayout.CENTER);
                    {
                        TableModel pomDenpendencyTableModel = new DefaultTableModel();
                        pomDenpendencyTable = new JTable();
                        jScrollPane5.setViewportView(pomDenpendencyTable);
                        pomDenpendencyTable.setModel(pomDenpendencyTableModel);
                        pomDenpendencyTable.addMouseListener(new MouseAdapter() {
                            public void mouseClicked(MouseEvent evt) {
                                tableMouseClicked(pomDenpendencyTable, 3, evt);
                            }
                        });
                        JTableUtil.defaultSetting(pomDenpendencyTable);
                    }
                }
                {
                    jPanel7 = new JPanel();
                    FlowLayout jPanel7Layout = new FlowLayout();
                    jPanel7Layout.setAlignOnBaseline(true);
                    jPanel6.add(jPanel7, BorderLayout.SOUTH);
                    jPanel7.setLayout(jPanel7Layout);
                    jPanel7.setPreferredSize(new java.awt.Dimension(520, 36));
                    {
                        clipboardListJar = new JButton();
                        jPanel7.add(clipboardListJar);
                        clipboardListJar.setText("jar list to clipboard");
                        clipboardListJar.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent evt) {
                                List<File> list = fetchPomDependencyTableJarList();
                                StringBuilder sb = new StringBuilder();
                                for (File f : list) {
                                    sb.append(f + "\n");
                                }
                                ClipboardUtil.getInstance().setContents(sb);
                                JOptionPaneUtil.newInstance().iconInformationMessage()
                                        .showMessageDialog("clipboard set ok!", "SUCCESS");
                            }
                        });
                    }
                    {
                        pomOutputJarDir = new JButton();
                        jPanel7.add(pomOutputJarDir);
                        pomOutputJarDir.setText("set output jar dir");
                        pomOutputJarDir.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent evt) {
                                File file = JFileChooserUtil.newInstance().selectDirectoryOnly()
                                        .showDialog("?Jar").getApproveSelectedFile();
                                if (file == null) {
                                    JOptionPaneUtil.newInstance().iconErrorMessage()
                                            .showMessageDialog("dir is not correct!!", "ERROR");
                                    return;
                                }
                                pomOutputJarDir_ = file;
                            }
                        });
                    }
                    {
                        exportListJar = new JButton();
                        jPanel7.add(exportListJar);
                        exportListJar.setText("export list jar");
                        exportListJar.setPreferredSize(new java.awt.Dimension(113, 24));
                        exportListJar.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent evt) {
                                List<File> list = fetchPomDependencyTableJarList();
                                if (pomOutputJarDir_ == null || !pomOutputJarDir_.exists()
                                        || !pomOutputJarDir_.isDirectory()) {
                                    JOptionPaneUtil.newInstance().iconErrorMessage()
                                            .showMessageDialog("output dir is not correct!!", "ERROR");
                                    return;
                                }
                                if (JOptionPaneUtil.ComfirmDialogResult.YES_OK_OPTION == JOptionPaneUtil
                                        .newInstance().confirmButtonYesNo().iconWaringMessage()
                                        .showConfirmDialog("are you sure copy list jar count:(" + list.size()
                                                + ") to\n" + pomOutputJarDir_, "WARN")) {
                                    StringBuilder sb = new StringBuilder();
                                    StringBuilder fsb = new StringBuilder();
                                    sb.append("total : " + list.size() + "\n");
                                    int ok = 0;
                                    int noOk = 0;
                                    for (File f : list) {
                                        try {
                                            FileUtil.copyFile(f, new File(pomOutputJarDir_, f.getName()));
                                            ok++;
                                        } catch (IOException e) {
                                            e.printStackTrace();
                                            noOk++;
                                            fsb.append(f + "\n");
                                        }
                                    }
                                    sb.append("success : " + ok + "\n");
                                    sb.append("failed : " + noOk + "\n");
                                    sb.append("Failed jar :\n");
                                    sb.append(fsb);

                                    JOptionPaneUtil.newInstance().iconErrorMessage().showMessageDialog(sb,
                                            "COPY RESULT");
                                }

                            }
                        });
                    }
                }
            }
        }
        this.setSize(541, 365);

        reloadRepositoryDir();
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:multiplayer.pong.client.LobbyFrame.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./* w  ww  .j  av a  2s  . c o  m*/
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jScrollPane2 = new javax.swing.JScrollPane();
    jScrollPane2.setBackground(Color.WHITE);
    usernamesT = new javax.swing.JTable();
    usernamesT.setBackground(Color.WHITE);

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setBackground(new java.awt.Color(0, 0, 0));

    usernamesT.setModel(new javax.swing.table.DefaultTableModel(
            new Object[][] { { null }, { null }, { null }, { null } }, new String[] { "Username" }) {
        boolean[] canEdit = new boolean[] { false };

        public boolean isCellEditable(int rowIndex, int columnIndex) {
            return canEdit[columnIndex];
        }
    });
    usernamesT.setGridColor(new java.awt.Color(0, 0, 0));
    usernamesT.setInheritsPopupMenu(true);
    jScrollPane2.setViewportView(usernamesT);
    if (usernamesT.getColumnModel().getColumnCount() > 0) {
        usernamesT.getColumnModel().getColumn(0).setResizable(false);
    }

    JLabel lblUtilisateursEnligne = new JLabel("Utilisateurs en-ligne");
    lblUtilisateursEnligne.setForeground(new Color(255, 255, 255));
    lblUtilisateursEnligne.setFont(new Font("Trebuchet MS", Font.PLAIN, 14));

    commandBtn = new JButton("Envoyer");
    commandBtn.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            commandBtnActionPerformed(e);
        }
    });

    JLabel lblLobbyPrincipal = new JLabel("Lobby Principal");
    lblLobbyPrincipal.setFont(new Font("Georgia", Font.PLAIN, 70));
    lblLobbyPrincipal.setForeground(new Color(255, 255, 255));
    lblLobbyPrincipal.setBackground(new Color(0, 0, 0));

    scrollPane = new JScrollPane();
    scrollPane.setBackground(Color.WHITE);

    cmdPrompt = new JTextField();
    cmdPrompt.setColumns(10);
    cmdPrompt.grabFocus();

    scrollPane_1 = new JScrollPane();

    lblWelcome = new JLabel("Bienvenue, " + SocketHandler.username);
    lblWelcome.setHorizontalAlignment(SwingConstants.RIGHT);
    lblWelcome.setFont(new Font("Georgia", Font.PLAIN, 18));
    lblWelcome.setForeground(Color.WHITE);

    JLabel label = new JLabel("Amis connect\u00E9s");
    label.setForeground(Color.WHITE);
    label.setFont(new Font("Trebuchet MS", Font.PLAIN, 14));

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    layout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout
            .createSequentialGroup().addContainerGap()
            .addGroup(layout.createParallelGroup(Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                            .addGroup(layout.createParallelGroup(Alignment.LEADING)
                                    .addComponent(scrollPane_1, GroupLayout.PREFERRED_SIZE, 605,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(cmdPrompt, 605, 605, 605))
                            .addPreferredGap(ComponentPlacement.RELATED))
                    .addGroup(layout.createSequentialGroup()
                            .addComponent(lblLobbyPrincipal, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE)
                            .addGap(120)))
            .addGroup(layout.createParallelGroup(Alignment.TRAILING)
                    .addComponent(lblUtilisateursEnligne, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 169,
                            Short.MAX_VALUE)
                    .addGroup(Alignment.LEADING,
                            layout.createSequentialGroup().addPreferredGap(ComponentPlacement.RELATED)
                                    .addComponent(lblWelcome, GroupLayout.PREFERRED_SIZE, 160,
                                            GroupLayout.PREFERRED_SIZE))
                    .addComponent(commandBtn, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 169, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup().addPreferredGap(ComponentPlacement.RELATED)
                            .addComponent(label, GroupLayout.PREFERRED_SIZE, 169, GroupLayout.PREFERRED_SIZE))
                    .addGroup(Alignment.LEADING,
                            layout.createSequentialGroup().addPreferredGap(ComponentPlacement.RELATED)
                                    .addComponent(jScrollPane2, GroupLayout.DEFAULT_SIZE, 169, Short.MAX_VALUE))
                    .addGroup(Alignment.LEADING,
                            layout.createSequentialGroup().addPreferredGap(ComponentPlacement.UNRELATED)
                                    .addComponent(scrollPane, GroupLayout.DEFAULT_SIZE, 169, Short.MAX_VALUE)))
            .addContainerGap()));
    layout.setVerticalGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout
            .createSequentialGroup().addContainerGap()
            .addGroup(layout.createParallelGroup(Alignment.TRAILING).addGroup(layout.createSequentialGroup()
                    .addGroup(layout.createParallelGroup(Alignment.LEADING)
                            .addComponent(lblLobbyPrincipal, GroupLayout.PREFERRED_SIZE, 85,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblWelcome, GroupLayout.PREFERRED_SIZE, 31,
                                    GroupLayout.PREFERRED_SIZE))
                    .addGap(18)
                    .addGroup(layout.createParallelGroup(Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                    .addComponent(scrollPane, GroupLayout.PREFERRED_SIZE, 164,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(ComponentPlacement.RELATED)
                                    .addComponent(lblUtilisateursEnligne, GroupLayout.PREFERRED_SIZE, 24,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(ComponentPlacement.RELATED)
                                    .addComponent(jScrollPane2, GroupLayout.DEFAULT_SIZE, 232, Short.MAX_VALUE))
                            .addComponent(scrollPane_1, GroupLayout.DEFAULT_SIZE, 432, Short.MAX_VALUE))
                    .addGap(9)
                    .addGroup(
                            layout.createParallelGroup(Alignment.BASELINE)
                                    .addComponent(cmdPrompt, GroupLayout.PREFERRED_SIZE, 22,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(commandBtn))
                    .addGap(22))
                    .addGroup(layout.createSequentialGroup()
                            .addComponent(label, GroupLayout.PREFERRED_SIZE, 24, GroupLayout.PREFERRED_SIZE)
                            .addGap(492)))));

    ta = new JTextPane();
    ta.setEditable(false);
    ta.setFont(new Font("SansSerif", Font.PLAIN, 14));
    scrollPane_1.setViewportView(ta);

    friendsT = new JTable();
    friendsT.setModel(new DefaultTableModel(new Object[][] {}, new String[] { "Username" }));
    scrollPane.setViewportView(friendsT);
    getContentPane().setLayout(layout);

    pack();
}

From source file:beproject.MainGUI.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 o m
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    isSequelButtonGroup = new javax.swing.ButtonGroup();
    categoryButtonGroup = new javax.swing.ButtonGroup();
    jSplitPane2 = new javax.swing.JSplitPane();
    jPanel2 = new javax.swing.JPanel();
    movieNameTextField = new javax.swing.JTextField();
    releaseDateTextField = new javax.swing.JFormattedTextField();
    isSequelYesRadioButton = new javax.swing.JRadioButton();
    isSequelNoRadioButton = new javax.swing.JRadioButton();
    jLabel1 = new javax.swing.JLabel();
    jPanel1 = new javax.swing.JPanel();
    cat1CheckBox = new javax.swing.JCheckBox();
    cat2CheckBox = new javax.swing.JCheckBox();
    cat3CheckBox = new javax.swing.JCheckBox();
    cat4CheckBox = new javax.swing.JCheckBox();
    cat5CheckBox = new javax.swing.JCheckBox();
    scheduleButton = new javax.swing.JButton();
    jLabel3 = new javax.swing.JLabel();
    jLabel5 = new javax.swing.JLabel();
    jLabel6 = new javax.swing.JLabel();
    jLabel8 = new javax.swing.JLabel();
    jLabel13 = new javax.swing.JLabel();
    jPanel6 = new javax.swing.JPanel();
    actorTwitterHandleTextField = new javax.swing.JTextField();
    actorNameTextField = new javax.swing.JTextField();
    jLabel7 = new javax.swing.JLabel();
    jLabel4 = new javax.swing.JLabel();
    jLabel10 = new javax.swing.JLabel();
    addButton = new javax.swing.JButton();
    jLabel11 = new javax.swing.JLabel();
    jLabel12 = new javax.swing.JLabel();
    jLabel14 = new javax.swing.JLabel();
    jLabel15 = new javax.swing.JLabel();
    theatreTextField = new javax.swing.JTextField();
    jLabel16 = new javax.swing.JLabel();
    jTabbedPane2 = new javax.swing.JTabbedPane();
    predictionPanel = new javax.swing.JPanel();
    movieNamesComboBox = new javax.swing.JComboBox();
    jScrollPane2 = new javax.swing.JScrollPane();
    predictionTextArea = new javax.swing.JTextArea();
    jLabel2 = new javax.swing.JLabel();
    getPredictionButton = new javax.swing.JButton();
    hypeAnalysisPanel = new javax.swing.JPanel();
    jSplitPane1 = new javax.swing.JSplitPane();
    jPanel3 = new javax.swing.JPanel();
    jSplitPane3 = new javax.swing.JSplitPane();
    sentimentPanel = new javax.swing.JPanel();
    countryPanel = new javax.swing.JPanel();
    timeLinePanel = new javax.swing.JPanel();
    tweetsPanel = new javax.swing.JPanel();
    jScrollPane1 = new javax.swing.JScrollPane();
    tweetTable = new javax.swing.JTable();
    nextButton = new javax.swing.JButton();
    prevButton = new javax.swing.JButton();
    liveTweetsAnalysisPanel = new javax.swing.JPanel();
    mapPanel = new javax.swing.JPanel();
    jToolBar1 = new javax.swing.JToolBar();
    twitterStatusLabel = new javax.swing.JLabel();
    jSeparator2 = new javax.swing.JToolBar.Separator();
    internetConnectionLabel = new javax.swing.JLabel();
    jSeparator3 = new javax.swing.JToolBar.Separator();
    databaseConnectionLabel = new javax.swing.JLabel();
    jMenuBar1 = new javax.swing.JMenuBar();
    fileMenu = new javax.swing.JMenu();
    jMenuItem1 = new javax.swing.JMenuItem();
    jMenu1 = new javax.swing.JMenu();
    startStreamingCheckBoxMenuItem = new javax.swing.JCheckBoxMenuItem();
    helpMenu = new javax.swing.JMenu();
    ContentsMenuItem = new javax.swing.JMenuItem();
    aboutMenuItem = new javax.swing.JMenuItem();

    setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
    setTitle("Hype Analyzer");
    setBounds(new java.awt.Rectangle(0, 0, 500, 500));
    setMinimumSize(null);
    addWindowListener(new java.awt.event.WindowAdapter() {
        public void windowClosing(java.awt.event.WindowEvent evt) {
            formWindowClosing(evt);
        }
    });
    addComponentListener(new java.awt.event.ComponentAdapter() {
        public void componentShown(java.awt.event.ComponentEvent evt) {
            formComponentShown(evt);
        }
    });

    jSplitPane2.setDividerLocation(450);

    jPanel2.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

    movieNameTextField.setColumns(5);
    movieNameTextField.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            movieNameTextFieldMouseClicked(evt);
        }
    });
    movieNameTextField.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            movieNameTextFieldActionPerformed(evt);
        }
    });
    movieNameTextField.addFocusListener(new java.awt.event.FocusAdapter() {
        public void focusGained(java.awt.event.FocusEvent evt) {
            movieNameTextFieldFocusGained(evt);
        }
    });
    jPanel2.add(movieNameTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 10, 137, 30));

    try {
        releaseDateTextField.setFormatterFactory(
                new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##-##-####")));
    } catch (java.text.ParseException ex) {
        ex.printStackTrace();
    }
    jPanel2.add(releaseDateTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 50, 137, 32));

    isSequelButtonGroup.add(isSequelYesRadioButton);
    isSequelYesRadioButton.setText("Yes");
    isSequelYesRadioButton.setName("isSequelRadio"); // NOI18N
    isSequelYesRadioButton.setOpaque(false);
    isSequelYesRadioButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            isSequelYesRadioButtonActionPerformed(evt);
        }
    });
    jPanel2.add(isSequelYesRadioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 210, -1, -1));

    isSequelButtonGroup.add(isSequelNoRadioButton);
    isSequelNoRadioButton.setSelected(true);
    isSequelNoRadioButton.setText("No");
    isSequelNoRadioButton.setName("isSequelRadio"); // NOI18N
    jPanel2.add(isSequelNoRadioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 210, -1, -1));

    jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
    jLabel1.setText("Is Sequel?");
    jPanel2.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(80, 210, -1, 20));

    jPanel1.setBackground(new java.awt.Color(255, 255, 255));
    jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    jPanel1.setName("Category"); // NOI18N

    cat1CheckBox.setBackground(new java.awt.Color(255, 255, 255));
    cat1CheckBox.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
    cat1CheckBox.setText("Action");

    cat2CheckBox.setBackground(new java.awt.Color(255, 255, 255));
    cat2CheckBox.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
    cat2CheckBox.setText("Animation");

    cat3CheckBox.setBackground(new java.awt.Color(255, 255, 255));
    cat3CheckBox.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
    cat3CheckBox.setText("Thriller");

    cat4CheckBox.setBackground(new java.awt.Color(255, 255, 255));
    cat4CheckBox.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
    cat4CheckBox.setText("Romance");

    cat5CheckBox.setBackground(new java.awt.Color(255, 255, 255));
    cat5CheckBox.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
    cat5CheckBox.setText("Comedy");

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup().addGap(60, 60, 60).addGroup(jPanel1Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup().addComponent(cat5CheckBox)
                            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                            .addGroup(jPanel1Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addGroup(jPanel1Layout.createSequentialGroup().addComponent(cat3CheckBox)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                    111, Short.MAX_VALUE)
                                            .addComponent(cat4CheckBox))
                                    .addGroup(jPanel1Layout.createSequentialGroup().addComponent(cat1CheckBox)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(cat2CheckBox)))
                            .addGap(111, 111, 111)))));
    jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap()
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(cat1CheckBox).addComponent(cat2CheckBox))
                    .addGap(18, 18, 18)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(cat4CheckBox).addComponent(cat3CheckBox))
                    .addGap(18, 18, 18).addComponent(cat5CheckBox).addContainerGap(14, Short.MAX_VALUE)));

    jPanel2.add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 260, 430, 130));

    scheduleButton.setText("Schedule");
    scheduleButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            scheduleButtonActionPerformed(evt);
        }
    });
    jPanel2.add(scheduleButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 460, -1, -1));

    jLabel3.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
    jLabel3.setText("Release Date:");
    jPanel2.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 60, -1, -1));

    jLabel5.setForeground(new java.awt.Color(255, 0, 0));
    jLabel5.setText("*");
    jPanel2.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 10, -1, -1));

    jLabel6.setForeground(new java.awt.Color(255, 0, 0));
    jLabel6.setText("*");
    jPanel2.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 50, -1, -1));

    jLabel8.setForeground(new java.awt.Color(255, 0, 0));
    jLabel8.setText("*");
    jPanel2.add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 210, -1, -1));

    jLabel13.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
    jLabel13.setText("Number of theatres movie is to be released:");
    jPanel2.add(jLabel13, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 400, -1, -1));

    jPanel6.setBackground(new java.awt.Color(255, 255, 255));
    jPanel6.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    actorNameTextField.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            actorNameTextFieldMouseClicked(evt);
        }
    });
    actorNameTextField.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            actorNameTextFieldActionPerformed(evt);
        }
    });
    actorNameTextField.addFocusListener(new java.awt.event.FocusAdapter() {
        public void focusGained(java.awt.event.FocusEvent evt) {
            actorNameTextFieldFocusGained(evt);
        }
    });

    jLabel7.setForeground(new java.awt.Color(255, 0, 0));
    jLabel7.setText("*");

    jLabel4.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
    jLabel4.setText("Actor Name:");

    jLabel10.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
    jLabel10.setText("Actor Twitter Handle:");

    addButton.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
    addButton.setText("Add this actor");
    addButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            addButtonActionPerformed(evt);
        }
    });

    jLabel11.setForeground(new java.awt.Color(255, 0, 0));
    jLabel11.setText("*");

    javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
    jPanel6.setLayout(jPanel6Layout);
    jPanel6Layout.setHorizontalGroup(jPanel6Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel10).addComponent(jLabel4))
                    .addGap(28, 28, 28)
                    .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel6Layout.createSequentialGroup()
                                    .addComponent(actorTwitterHandleTextField,
                                            javax.swing.GroupLayout.PREFERRED_SIZE, 137,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jLabel11))
                            .addGroup(jPanel6Layout.createSequentialGroup()
                                    .addComponent(actorNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            137, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jLabel7)))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(addButton)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    jPanel6Layout.setVerticalGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup().addContainerGap()
                    .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel7)
                            .addComponent(actorNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 28,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel4))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel6Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(actorTwitterHandleTextField,
                                            javax.swing.GroupLayout.PREFERRED_SIZE, 32,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel10))
                            .addComponent(jLabel11))
                    .addContainerGap(19, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                    jPanel6Layout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE).addComponent(addButton,
                            javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(26, 26, 26)));

    jPanel2.add(jPanel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 100, -1, 100));

    jLabel12.setForeground(new java.awt.Color(255, 0, 0));
    jLabel12.setText("*");
    jPanel2.add(jLabel12, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 50, -1, -1));

    jLabel14.setForeground(new java.awt.Color(255, 0, 0));
    jLabel14.setText("*");
    jPanel2.add(jLabel14, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 10, -1, -1));

    jLabel15.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
    jLabel15.setText("Movie Name: ");
    jPanel2.add(jLabel15, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 20, -1, -1));

    theatreTextField.setColumns(5);
    theatreTextField.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            theatreTextFieldMouseClicked(evt);
        }
    });
    theatreTextField.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            theatreTextFieldActionPerformed(evt);
        }
    });
    theatreTextField.addFocusListener(new java.awt.event.FocusAdapter() {
        public void focusGained(java.awt.event.FocusEvent evt) {
            theatreTextFieldFocusGained(evt);
        }
    });
    jPanel2.add(theatreTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 420, 137, 30));

    jLabel16.setForeground(new java.awt.Color(255, 0, 0));
    jLabel16.setText("*");
    jPanel2.add(jLabel16, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 420, -1, -1));

    jSplitPane2.setLeftComponent(jPanel2);

    jTabbedPane2.setName(""); // NOI18N
    jTabbedPane2.addChangeListener(new javax.swing.event.ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent evt) {
            jTabbedPane2StateChanged(evt);
        }
    });

    predictionPanel.setName("predictionPanel"); // NOI18N
    predictionPanel.addComponentListener(new java.awt.event.ComponentAdapter() {
        public void componentShown(java.awt.event.ComponentEvent evt) {
            predictionPanelComponentShown(evt);
        }
    });

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

    predictionTextArea.setColumns(20);
    predictionTextArea.setRows(5);
    jScrollPane2.setViewportView(predictionTextArea);

    jLabel2.setText("Prediction:");

    getPredictionButton.setText("Get Prediction");
    getPredictionButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            getPredictionButtonActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout predictionPanelLayout = new javax.swing.GroupLayout(predictionPanel);
    predictionPanel.setLayout(predictionPanelLayout);
    predictionPanelLayout.setHorizontalGroup(
            predictionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(movieNamesComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(predictionPanelLayout.createSequentialGroup()
                            .addGroup(predictionPanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(predictionPanelLayout.createSequentialGroup().addGap(20, 20, 20)
                                            .addComponent(jLabel2).addGap(0, 0, Short.MAX_VALUE))
                                    .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING))
                            .addContainerGap())
                    .addGroup(predictionPanelLayout.createSequentialGroup().addGap(239, 239, 239)
                            .addComponent(getPredictionButton).addContainerGap(158, Short.MAX_VALUE)));
    predictionPanelLayout.setVerticalGroup(predictionPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(predictionPanelLayout.createSequentialGroup()
                    .addComponent(movieNamesComboBox, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(46, 46, 46).addComponent(jLabel2)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 258,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18).addComponent(getPredictionButton).addGap(0, 174, Short.MAX_VALUE)));

    movieNamesComboBox.getAccessibleContext().setAccessibleParent(predictionPanel);

    jTabbedPane2.addTab("Prediction", predictionPanel);

    hypeAnalysisPanel.setName("hypeAnalysisPanel"); // NOI18N
    hypeAnalysisPanel.addComponentListener(new java.awt.event.ComponentAdapter() {
        public void componentShown(java.awt.event.ComponentEvent evt) {
            hypeAnalysisPanelComponentShown(evt);
        }
    });
    hypeAnalysisPanel.setLayout(new java.awt.BorderLayout());

    jSplitPane1.setDividerLocation(300);
    jSplitPane1.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);

    jPanel3.setLayout(new java.awt.BorderLayout());
    jSplitPane1.setTopComponent(jPanel3);

    jSplitPane3.setDividerLocation(300);

    sentimentPanel.setLayout(new java.awt.BorderLayout());
    jSplitPane3.setLeftComponent(sentimentPanel);

    countryPanel.setLayout(new java.awt.BorderLayout());
    jSplitPane3.setRightComponent(countryPanel);

    jSplitPane1.setRightComponent(jSplitPane3);

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

    jTabbedPane2.addTab("Hype Analysis", hypeAnalysisPanel);

    timeLinePanel.setName("timeLinePanel"); // NOI18N
    timeLinePanel.addComponentListener(new java.awt.event.ComponentAdapter() {
        public void componentHidden(java.awt.event.ComponentEvent evt) {
            timeLinePanelComponentHidden(evt);
        }

        public void componentShown(java.awt.event.ComponentEvent evt) {
            timeLinePanelComponentShown(evt);
        }
    });
    timeLinePanel.setLayout(new java.awt.BorderLayout());
    jTabbedPane2.addTab("Time Line", timeLinePanel);

    tweetsPanel.setName("tweetsPanel"); // NOI18N
    tweetsPanel.addComponentListener(new java.awt.event.ComponentAdapter() {
        public void componentShown(java.awt.event.ComponentEvent evt) {
            tweetsPanelComponentShown(evt);
        }
    });

    tweetTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object[][] { { null, null }, { null, null }, { null, null }, { null, null }, { null, null },
                    { null, null }, { null, null }, { null, null }, { null, null }, { null, null },
                    { null, null }, { null, null }, { null, null }, { null, null }, { null, null },
                    { null, null }, { null, null }, { null, null }, { null, null }, { null, null },
                    { null, null }, { null, null }, { null, null }, { null, null }, { null, null },
                    { null, null }, { null, null }, { null, null }, { null, null }, { null, null } },
            new String[] { "Tweet", "Polarity" }) {
        Class[] types = new Class[] { java.lang.String.class, java.lang.Integer.class };
        boolean[] canEdit = new boolean[] { false, false };

        public Class getColumnClass(int columnIndex) {
            return types[columnIndex];
        }

        public boolean isCellEditable(int rowIndex, int columnIndex) {
            return canEdit[columnIndex];
        }
    });
    jScrollPane1.setViewportView(tweetTable);
    if (tweetTable.getColumnModel().getColumnCount() > 0) {
        tweetTable.getColumnModel().getColumn(0).setPreferredWidth(400);
    }

    nextButton.setText("Next>>");
    nextButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            nextButtonActionPerformed(evt);
        }
    });

    prevButton.setText("<<Prev");
    prevButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            prevButtonActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout tweetsPanelLayout = new javax.swing.GroupLayout(tweetsPanel);
    tweetsPanel.setLayout(tweetsPanelLayout);
    tweetsPanelLayout
            .setHorizontalGroup(tweetsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(tweetsPanelLayout.createSequentialGroup().addContainerGap()
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 476,
                                    Short.MAX_VALUE)
                            .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                            tweetsPanelLayout.createSequentialGroup()
                                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(prevButton)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(nextButton).addGap(35, 35, 35)));
    tweetsPanelLayout.setVerticalGroup(tweetsPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(tweetsPanelLayout.createSequentialGroup().addGap(31, 31, 31)
                    .addGroup(tweetsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(prevButton).addComponent(nextButton))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 488, Short.MAX_VALUE)
                    .addContainerGap()));

    jTabbedPane2.addTab("Tweets", tweetsPanel);

    liveTweetsAnalysisPanel.setName("liveTweetsAnalysisPanel"); // NOI18N
    liveTweetsAnalysisPanel.addComponentListener(new java.awt.event.ComponentAdapter() {
        public void componentShown(java.awt.event.ComponentEvent evt) {
            liveTweetsAnalysisPanelComponentShown(evt);
        }
    });
    liveTweetsAnalysisPanel.setLayout(new java.awt.BorderLayout());
    jTabbedPane2.addTab("Live Tweet Analysis", liveTweetsAnalysisPanel);

    mapPanel.setName("mapPanel"); // NOI18N
    mapPanel.setLayout(new java.awt.BorderLayout());
    jTabbedPane2.addTab("Map", mapPanel);

    jSplitPane2.setRightComponent(jTabbedPane2);

    jToolBar1.setRollover(true);
    jToolBar1.setFocusable(false);

    twitterStatusLabel.setText("TWITTER STATUS: Not gathering tweets | Running as Client");
    jToolBar1.add(twitterStatusLabel);
    jToolBar1.add(jSeparator2);

    internetConnectionLabel.setText("No Internet Connection");
    jToolBar1.add(internetConnectionLabel);
    jToolBar1.add(jSeparator3);

    databaseConnectionLabel.setText("No database detected");
    jToolBar1.add(databaseConnectionLabel);

    fileMenu.setText("File");

    jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Q,
            java.awt.event.InputEvent.CTRL_MASK));
    jMenuItem1.setText("Quit");
    jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem1ActionPerformed(evt);
        }
    });
    fileMenu.add(jMenuItem1);

    jMenuBar1.add(fileMenu);

    jMenu1.setText("Twitter");

    startStreamingCheckBoxMenuItem.setText("Start Streaming");
    startStreamingCheckBoxMenuItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            startStreamingCheckBoxMenuItemActionPerformed(evt);
        }
    });
    jMenu1.add(startStreamingCheckBoxMenuItem);

    jMenuBar1.add(jMenu1);

    helpMenu.setText("Help");
    helpMenu.setName("Help"); // NOI18N
    helpMenu.setPreferredSize(new java.awt.Dimension(29, 19));

    ContentsMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F1, 0));
    ContentsMenuItem.setText("Contents");
    helpMenu.add(ContentsMenuItem);

    aboutMenuItem.setText("About");
    aboutMenuItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            aboutMenuItemActionPerformed(evt);
        }
    });
    helpMenu.add(aboutMenuItem);

    jMenuBar1.add(helpMenu);

    setJMenuBar(jMenuBar1);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSplitPane2).addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE,
                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addComponent(jSplitPane2)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 25,
                            javax.swing.GroupLayout.PREFERRED_SIZE)));

    pack();
}

From source file:com.juanhg.cicloc.cicloCApplet.java

private void autogeneratedCode() {
    JPanel panel_control = new JPanel();
    panel_control.setBorder(new CompoundBorder(new EtchedBorder(EtchedBorder.RAISED, null, null),
            new BevelBorder(BevelBorder.RAISED, null, null, null, null)));

    JPanel panelInputs = new JPanel();
    panelInputs.setToolTipText("");
    panelInputs.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));

    JPanel panelOutputs = new JPanel();
    panelOutputs.setToolTipText("");
    panelOutputs.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));

    JPanel panelTitleOutputs = new JPanel();
    panelTitleOutputs.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null));

    JLabel labelOutputData = new JLabel("Datos de la Simulaci\u00F3n");
    labelOutputData.setFont(new Font("Tahoma", Font.PLAIN, 14));
    panelTitleOutputs.add(labelOutputData);

    lblPhase = new JLabel("Trabajo Ciclo:");
    lblPhase.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblTrabajoCValue = new JLabel();
    lblTrabajoCValue.setText("0");
    lblTrabajoCValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel lblPosicion = new JLabel("Trabajo:");
    lblPosicion.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblTrabajoValue = new JLabel();
    lblTrabajoValue.setText("0");
    lblTrabajoValue.setFont(new Font("Tahoma", Font.PLAIN, 14));
    hotImage = loadImage(hot);/*from   w  w w. j  a v  a  2s .  c  o  m*/

    coldImage = loadImage(cold);

    lblE = new JLabel("Rendimiento:");
    lblE.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblEValue = new JLabel();
    lblEValue.setText("0");
    lblEValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    GroupLayout gl_panelOutputs = new GroupLayout(panelOutputs);
    gl_panelOutputs.setHorizontalGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panelOutputs.createSequentialGroup().addGap(22).addGroup(gl_panelOutputs
                    .createParallelGroup(Alignment.LEADING)
                    .addGroup(gl_panelOutputs.createSequentialGroup()
                            .addComponent(lblE, GroupLayout.PREFERRED_SIZE, 84, GroupLayout.PREFERRED_SIZE)
                            .addGap(26).addComponent(lblEValue, GroupLayout.DEFAULT_SIZE, 103, Short.MAX_VALUE))
                    .addGroup(gl_panelOutputs.createSequentialGroup()
                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.TRAILING)
                                    .addGroup(gl_panelOutputs.createSequentialGroup()
                                            .addComponent(lblPhase, GroupLayout.DEFAULT_SIZE,
                                                    GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addGap(26))
                                    .addGroup(gl_panelOutputs.createSequentialGroup()
                                            .addComponent(lblPosicion, GroupLayout.PREFERRED_SIZE, 81,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addGap(29)))
                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING, false)
                                    .addComponent(lblTrabajoValue, GroupLayout.DEFAULT_SIZE,
                                            GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(lblTrabajoCValue, GroupLayout.PREFERRED_SIZE, 103,
                                            GroupLayout.PREFERRED_SIZE))))
                    .addGap(109))
            .addGroup(gl_panelOutputs.createSequentialGroup().addComponent(panelTitleOutputs,
                    GroupLayout.PREFERRED_SIZE, 262, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(82, Short.MAX_VALUE)));
    gl_panelOutputs
            .setVerticalGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
                    .addGroup(gl_panelOutputs.createSequentialGroup()
                            .addComponent(panelTitleOutputs, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(ComponentPlacement.UNRELATED)
                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.BASELINE)
                                    .addComponent(lblTrabajoCValue).addComponent(lblPhase))
                            .addPreferredGap(ComponentPlacement.UNRELATED)
                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.BASELINE)
                                    .addComponent(lblPosicion, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblTrabajoValue, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(ComponentPlacement.UNRELATED)
                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
                                    .addComponent(lblE, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblEValue, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE))
                            .addGap(79)));
    panelOutputs.setLayout(gl_panelOutputs);

    panel_1 = new JPanel();
    panel_1.setBorder(new LineBorder(new Color(0, 0, 0)));

    JPanel panel_6 = new JPanel();
    panel_6.setBorder(new LineBorder(new Color(0, 0, 0)));
    GroupLayout gl_panel_control = new GroupLayout(panel_control);
    gl_panel_control.setHorizontalGroup(gl_panel_control.createParallelGroup(Alignment.TRAILING)
            .addGroup(gl_panel_control.createSequentialGroup().addContainerGap()
                    .addGroup(gl_panel_control.createParallelGroup(Alignment.LEADING, false)
                            .addComponent(panelOutputs, 0, 0, Short.MAX_VALUE)
                            .addComponent(panelInputs, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE)
                            .addComponent(panel_6, 0, 0, Short.MAX_VALUE).addComponent(panel_1,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addContainerGap(92, Short.MAX_VALUE)));
    gl_panel_control.setVerticalGroup(gl_panel_control.createParallelGroup(Alignment.TRAILING)
            .addGroup(gl_panel_control.createSequentialGroup().addContainerGap()
                    .addComponent(panelInputs, GroupLayout.PREFERRED_SIZE, 213, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panelOutputs, GroupLayout.PREFERRED_SIZE, 129, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panel_6, GroupLayout.PREFERRED_SIZE, 146, Short.MAX_VALUE)
                    .addPreferredGap(ComponentPlacement.RELATED).addComponent(panel_1,
                            GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                    .addGap(17)));

    btnLaunchSimulation = new JButton("Iniciar");
    btnLaunchSimulation.setFont(new Font("Tahoma", Font.PLAIN, 16));
    btnLaunchSimulation.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            btnLaunchSimulationEvent(event);
        }
    });

    btnCold = new JButton("");
    btnCold.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            btnHot.setEnabled(true);
            btnCold.setEnabled(false);
            isHot = false;
            lblE.setText("Eficiencia");

            lblModeValue.setText("Modo Frig");
            panelMode.setBackground(Color.BLUE);

        }
    });
    btnCold.setIcon(new ImageIcon(coldImage));
    btnCold.setEnabled(true);

    panelMode = new JPanel();
    panelMode.setBorder(new LineBorder(new Color(0, 0, 0)));
    panelMode.setBackground(Color.ORANGE);

    btnHot = new JButton("");
    btnHot.setIcon(new ImageIcon(hotImage));
    btnHot.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            btnHot.setEnabled(false);
            btnCold.setEnabled(true);
            isHot = true;
            lblE.setText("Rendimiento");

            lblModeValue.setText("Modo Motor");
            panelMode.setBackground(Color.ORANGE);
        }
    });
    btnHot.setEnabled(false);
    GroupLayout gl_panel_6 = new GroupLayout(panel_6);
    gl_panel_6.setHorizontalGroup(gl_panel_6.createParallelGroup(Alignment.LEADING).addGroup(gl_panel_6
            .createSequentialGroup().addContainerGap()
            .addGroup(gl_panel_6.createParallelGroup(Alignment.LEADING, false)
                    .addComponent(panelMode, Alignment.TRAILING, 0, 0, Short.MAX_VALUE)
                    .addComponent(btnHot, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE))
            .addGap(10)
            .addGroup(gl_panel_6.createParallelGroup(Alignment.TRAILING, false)
                    .addComponent(btnCold, GroupLayout.PREFERRED_SIZE, 112, GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnLaunchSimulation, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE,
                            Short.MAX_VALUE))
            .addContainerGap()));
    gl_panel_6.setVerticalGroup(gl_panel_6.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel_6.createSequentialGroup().addGap(10)
                    .addGroup(gl_panel_6.createParallelGroup(Alignment.LEADING)
                            .addComponent(panelMode, 0, 0, Short.MAX_VALUE).addComponent(btnLaunchSimulation,
                                    GroupLayout.PREFERRED_SIZE, 45, GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addGroup(gl_panel_6.createParallelGroup(Alignment.TRAILING)
                            .addComponent(btnCold, GroupLayout.DEFAULT_SIZE, 68, Short.MAX_VALUE)
                            .addComponent(btnHot, GroupLayout.DEFAULT_SIZE, 68, Short.MAX_VALUE))
                    .addContainerGap()));

    lblModeValue = new JLabel("Modo Motor");
    lblModeValue.setFont(new Font("Tahoma", Font.PLAIN, 17));
    GroupLayout gl_panelMode = new GroupLayout(panelMode);
    gl_panelMode.setHorizontalGroup(gl_panelMode.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panelMode.createSequentialGroup().addContainerGap()
                    .addComponent(lblModeValue, GroupLayout.PREFERRED_SIZE, 113, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    gl_panelMode
            .setVerticalGroup(gl_panelMode.createParallelGroup(Alignment.LEADING)
                    .addGroup(gl_panelMode
                            .createSequentialGroup().addContainerGap().addComponent(lblModeValue,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGap(52)));
    panelMode.setLayout(gl_panelMode);
    panel_6.setLayout(gl_panel_6);

    JLabel lblNewLabel = new JLabel("GNU GENERAL PUBLIC LICENSE");
    panel_1.add(lblNewLabel);

    JLabel LabelT1 = new JLabel("T1");
    LabelT1.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel labelT2 = new JLabel("T2");
    labelT2.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel labelVmin = new JLabel("Vm\u00EDn");
    labelVmin.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JPanel panelTitle = new JPanel();
    panelTitle.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null));

    lblT2Value = new JLabel("300");
    lblT2Value.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblVminValue = new JLabel("2");
    lblVminValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblT1Value = new JLabel("400");
    lblT1Value.setFont(new Font("Tahoma", Font.PLAIN, 14));

    sliderT1 = new JSlider();
    sliderT1.setMinimum(350);
    sliderT1.setMaximum(450);
    sliderT1.setMinorTickSpacing(1);
    sliderT1.setValue(400);
    sliderT1.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent event) {
            sliderT1Event();
        }
    });

    sliderT2 = new JSlider();
    sliderT2.setMinimum(270);
    sliderT2.setMaximum(330);
    sliderT2.setMinorTickSpacing(1);
    sliderT2.setValue(300);
    sliderT2.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            sliderT2Event();
        }
    });

    sliderVMin = new JSlider();
    sliderVMin.setMaximum(4);
    sliderVMin.setMinimum(1);
    sliderVMin.setValue(2);
    sliderVMin.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            sliderVminEvent();
        }
    });

    JLabel lblVmax = new JLabel("Vm\u00E1x");
    lblVmax.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblVmaxValue = new JLabel("7");
    lblVmaxValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    sliderVMax = new JSlider();
    sliderVMax.setMaximum(10);
    sliderVMax.setMinimum(6);
    sliderVMax.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent arg0) {
            sliderVmaxEvent();
        }
    });
    sliderVMax.setValue(7);
    sliderVMax.setMinorTickSpacing(1);

    JLabel labelN = new JLabel("N");
    labelN.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblNValue = new JLabel("10");
    lblNValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    sliderN = new JSlider();
    sliderN.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            sliderNEvent();
        }
    });
    sliderN.setValue(10);
    sliderN.setMinorTickSpacing(1);

    GroupLayout gl_panelInputs = new GroupLayout(panelInputs);
    gl_panelInputs.setHorizontalGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panelInputs.createSequentialGroup().addGap(19).addGroup(gl_panelInputs
                    .createParallelGroup(Alignment.LEADING, false)
                    .addComponent(labelN, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(lblVmax, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(labelVmin, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE,
                            Short.MAX_VALUE)
                    .addComponent(labelT2, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(LabelT1, GroupLayout.PREFERRED_SIZE, 65, GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING, false)
                            .addGroup(gl_panelInputs.createSequentialGroup()
                                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                                            .addComponent(lblT1Value, GroupLayout.PREFERRED_SIZE, 42,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addComponent(lblT2Value, GroupLayout.PREFERRED_SIZE, 56,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addComponent(lblVminValue, GroupLayout.PREFERRED_SIZE, 56,
                                                    GroupLayout.PREFERRED_SIZE))
                                    .addGap(18)
                                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING, false)
                                            .addComponent(sliderT1, 0, 0, Short.MAX_VALUE)
                                            .addComponent(sliderT2, 0, 0, Short.MAX_VALUE)
                                            .addComponent(sliderVMin, GroupLayout.PREFERRED_SIZE, 88,
                                                    GroupLayout.PREFERRED_SIZE)))
                            .addGroup(gl_panelInputs.createSequentialGroup()
                                    .addComponent(lblVmaxValue, GroupLayout.PREFERRED_SIZE, 56,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addGap(18).addComponent(sliderVMax, GroupLayout.PREFERRED_SIZE, 88,
                                            GroupLayout.PREFERRED_SIZE))
                            .addGroup(gl_panelInputs.createSequentialGroup()
                                    .addComponent(lblNValue, GroupLayout.PREFERRED_SIZE, 56,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addGap(18)
                                    .addComponent(sliderN, GroupLayout.PREFERRED_SIZE, 88,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(ComponentPlacement.RELATED)))
                    .addContainerGap())
            .addComponent(panelTitle, GroupLayout.DEFAULT_SIZE, 259, Short.MAX_VALUE));
    gl_panelInputs.setVerticalGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panelInputs.createSequentialGroup()
                    .addComponent(panelTitle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addGap(18)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                            .addGroup(gl_panelInputs.createSequentialGroup().addComponent(LabelT1).addGap(12)
                                    .addComponent(labelT2).addGap(17).addComponent(labelVmin).addGap(17)
                                    .addComponent(lblVmax, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addGap(17).addComponent(labelN, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE))
                            .addGroup(gl_panelInputs.createSequentialGroup()
                                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                                            .addComponent(lblT1Value, GroupLayout.PREFERRED_SIZE, 17,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addComponent(sliderT1, GroupLayout.PREFERRED_SIZE,
                                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(ComponentPlacement.RELATED)
                                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                                            .addComponent(lblT2Value, GroupLayout.PREFERRED_SIZE, 17,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addComponent(sliderT2, GroupLayout.PREFERRED_SIZE,
                                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                                    .addGap(11)
                                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                                            .addComponent(lblVminValue, GroupLayout.PREFERRED_SIZE, 17,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addComponent(sliderVMin, GroupLayout.PREFERRED_SIZE,
                                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(ComponentPlacement.UNRELATED)
                                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                                            .addComponent(lblVmaxValue, GroupLayout.PREFERRED_SIZE, 17,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addComponent(sliderVMax, GroupLayout.PREFERRED_SIZE,
                                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(ComponentPlacement.RELATED)
                                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING)
                                            .addComponent(lblNValue, GroupLayout.PREFERRED_SIZE, 17,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addComponent(sliderN, GroupLayout.PREFERRED_SIZE,
                                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))))
                    .addGap(8)));

    JLabel lblDatosDeEntrada = new JLabel("Datos de Entrada");
    lblDatosDeEntrada.setFont(new Font("Tahoma", Font.PLAIN, 14));
    panelTitle.add(lblDatosDeEntrada);
    panelInputs.setLayout(gl_panelInputs);
    panel_control.setLayout(gl_panel_control);

    JPanel panel_visualizar = new JPanel();
    panel_visualizar.setBackground(Color.WHITE);

    GroupLayout groupLayout = new GroupLayout(getContentPane());
    groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
            .addGroup(Alignment.LEADING, groupLayout.createSequentialGroup().addContainerGap()
                    .addComponent(panel_control, GroupLayout.PREFERRED_SIZE, 286, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED).addComponent(panel_visualizar,
                            GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(93, Short.MAX_VALUE)));
    groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.TRAILING).addGroup(groupLayout
            .createSequentialGroup().addContainerGap()
            .addGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
                    .addComponent(panel_visualizar, GroupLayout.DEFAULT_SIZE, 567, Short.MAX_VALUE)
                    .addComponent(panel_control, GroupLayout.PREFERRED_SIZE, 568, GroupLayout.PREFERRED_SIZE))
            .addContainerGap()));

    JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);

    panelPiston = new JPanelGrafica();
    panelPiston.setBackground(Color.WHITE);

    JPanel panel_5 = new JPanel();
    panel_5.setBackground(Color.WHITE);

    JPanel panel = new JPanel();
    panel.setBackground(Color.WHITE);
    GroupLayout gl_panel_visualizar = new GroupLayout(panel_visualizar);
    gl_panel_visualizar.setHorizontalGroup(gl_panel_visualizar.createParallelGroup(Alignment.LEADING)
            .addComponent(tabbedPane, GroupLayout.DEFAULT_SIZE, 845, Short.MAX_VALUE)
            .addGroup(gl_panel_visualizar.createSequentialGroup().addContainerGap()
                    .addComponent(panelPiston, GroupLayout.PREFERRED_SIZE, 355, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panel, GroupLayout.PREFERRED_SIZE, 183, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panel_5, GroupLayout.DEFAULT_SIZE, 275, Short.MAX_VALUE).addContainerGap()));
    gl_panel_visualizar.setVerticalGroup(gl_panel_visualizar.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel_visualizar.createSequentialGroup()
                    .addComponent(tabbedPane, GroupLayout.PREFERRED_SIZE, 289, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addGroup(gl_panel_visualizar.createParallelGroup(Alignment.LEADING)
                            .addComponent(panel, GroupLayout.DEFAULT_SIZE, 291, Short.MAX_VALUE)
                            .addComponent(panelPiston, GroupLayout.DEFAULT_SIZE, 291, Short.MAX_VALUE)
                            .addComponent(panel_5, GroupLayout.DEFAULT_SIZE, 291, Short.MAX_VALUE))
                    .addContainerGap()));

    panelTermo = new JPanelGrafica();
    panelTermo.setBackground(Color.WHITE);
    GroupLayout gl_panel = new GroupLayout(panel);
    gl_panel.setHorizontalGroup(gl_panel.createParallelGroup(Alignment.LEADING).addComponent(panelTermo,
            GroupLayout.DEFAULT_SIZE, 131, Short.MAX_VALUE));
    gl_panel.setVerticalGroup(gl_panel.createParallelGroup(Alignment.LEADING).addComponent(panelTermo,
            GroupLayout.DEFAULT_SIZE, 291, Short.MAX_VALUE));
    panel.setLayout(gl_panel);

    panelPistonInterno = new JPanelGrafica();
    panelPistonInterno.setBackground(Color.WHITE);
    GroupLayout gl_panelPiston = new GroupLayout(panelPiston);
    gl_panelPiston.setHorizontalGroup(gl_panelPiston.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panelPiston.createSequentialGroup()
                    .addComponent(panelPistonInterno, GroupLayout.PREFERRED_SIZE, 354,
                            GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    gl_panelPiston.setVerticalGroup(gl_panelPiston.createParallelGroup(Alignment.LEADING)
            .addComponent(panelPistonInterno, GroupLayout.DEFAULT_SIZE, 261, Short.MAX_VALUE));
    panelPiston.setLayout(gl_panelPiston);

    JPanel panelBulb = new JPanel();
    panelBulb.setBackground(Color.WHITE);

    JPanel panelLED = new JPanel();
    panelLED.setBackground(Color.WHITE);

    lblBulbValue = new JLabel("-  Horas");

    lblLEDValue = new JLabel("-  Horas");
    GroupLayout gl_panel_5 = new GroupLayout(panel_5);
    gl_panel_5.setHorizontalGroup(gl_panel_5.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel_5.createSequentialGroup()
                    .addGroup(gl_panel_5.createParallelGroup(Alignment.LEADING, false)
                            .addComponent(panelLED, 0, 0, Short.MAX_VALUE)
                            .addComponent(panelBulb, GroupLayout.PREFERRED_SIZE, 132, Short.MAX_VALUE))
                    .addGap(18).addGroup(gl_panel_5.createParallelGroup(Alignment.LEADING)
                            .addComponent(lblBulbValue).addComponent(lblLEDValue))
                    .addContainerGap(87, Short.MAX_VALUE)));
    gl_panel_5.setVerticalGroup(gl_panel_5.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel_5.createSequentialGroup()
                    .addComponent(panelBulb, GroupLayout.PREFERRED_SIZE, 143, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.UNRELATED)
                    .addComponent(panelLED, GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE))
            .addGroup(gl_panel_5.createSequentialGroup().addGap(64).addComponent(lblBulbValue)
                    .addPreferredGap(ComponentPlacement.RELATED, 135, Short.MAX_VALUE).addComponent(lblLEDValue)
                    .addGap(64)));

    LEDOnImage = loadImage(LEDOn);
    LEDOffImage = loadImage(LEDOff);
    lblLED = new JLabel(new ImageIcon(LEDOffImage));
    lblLED.setBackground(Color.WHITE);

    GroupLayout gl_panelLED = new GroupLayout(panelLED);
    gl_panelLED.setHorizontalGroup(gl_panelLED.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panelLED.createSequentialGroup()
                    .addComponent(lblLED, GroupLayout.PREFERRED_SIZE, 131, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(33, Short.MAX_VALUE)));
    gl_panelLED.setVerticalGroup(gl_panelLED.createParallelGroup(Alignment.TRAILING).addGroup(Alignment.LEADING,
            gl_panelLED.createSequentialGroup().addContainerGap().addComponent(lblLED, GroupLayout.DEFAULT_SIZE,
                    126, Short.MAX_VALUE)));
    panelLED.setLayout(gl_panelLED);

    bulbOnImage = loadImage(bulbOn);
    bulbOffImage = loadImage(bulbOff);
    lblBulb = new JLabel(new ImageIcon(bulbOffImage));
    lblBulb.setBackground(Color.WHITE);

    GroupLayout gl_panelBulb = new GroupLayout(panelBulb);
    gl_panelBulb.setHorizontalGroup(gl_panelBulb.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panelBulb.createSequentialGroup()
                    .addComponent(lblBulb, GroupLayout.PREFERRED_SIZE, 134, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(30, Short.MAX_VALUE)));
    gl_panelBulb.setVerticalGroup(gl_panelBulb.createParallelGroup(Alignment.LEADING).addComponent(lblBulb,
            GroupLayout.DEFAULT_SIZE, 143, Short.MAX_VALUE));
    panelBulb.setLayout(gl_panelBulb);
    panel_5.setLayout(gl_panel_5);

    JPanel panelXV = new JPanel();
    panelXV.setBackground(Color.WHITE);
    tabbedPane.addTab("Grficas V", null, panelXV, null);

    JPanel panel_2 = new JPanel();

    JPanel panel_3 = new JPanel();

    JPanel panel_4 = new JPanel();

    panelTV = new JPanelGrafica();
    GroupLayout gl_panel_4 = new GroupLayout(panel_4);
    gl_panel_4.setHorizontalGroup(
            gl_panel_4.createParallelGroup(Alignment.LEADING).addGap(0, 272, Short.MAX_VALUE)
                    .addComponent(panelTV, GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VALUE));
    gl_panel_4
            .setVerticalGroup(gl_panel_4.createParallelGroup(Alignment.LEADING).addGap(0, 241, Short.MAX_VALUE)
                    .addGroup(gl_panel_4.createSequentialGroup()
                            .addComponent(panelTV, GroupLayout.PREFERRED_SIZE, 241, GroupLayout.PREFERRED_SIZE)
                            .addContainerGap(306, Short.MAX_VALUE)));
    panel_4.setLayout(gl_panel_4);
    GroupLayout gl_panelXV = new GroupLayout(panelXV);
    gl_panelXV.setHorizontalGroup(gl_panelXV.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panelXV.createSequentialGroup().addContainerGap()
                    .addComponent(panel_2, GroupLayout.PREFERRED_SIZE, 263, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panel_3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panel_4, GroupLayout.PREFERRED_SIZE, 272, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(11, Short.MAX_VALUE)));
    gl_panelXV.setVerticalGroup(gl_panelXV.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panelXV.createSequentialGroup().addContainerGap()
                    .addGroup(gl_panelXV.createParallelGroup(Alignment.LEADING)
                            .addComponent(panel_4, GroupLayout.PREFERRED_SIZE, 241, GroupLayout.PREFERRED_SIZE)
                            .addGroup(gl_panelXV.createParallelGroup(Alignment.TRAILING, false)
                                    .addComponent(panel_3, Alignment.LEADING, 0, 0, Short.MAX_VALUE)
                                    .addComponent(panel_2, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 241,
                                            Short.MAX_VALUE)))
                    .addContainerGap(317, Short.MAX_VALUE)));

    panelUV = new JPanelGrafica();
    GroupLayout gl_panel_3 = new GroupLayout(panel_3);
    gl_panel_3.setHorizontalGroup(gl_panel_3.createParallelGroup(Alignment.LEADING).addComponent(panelUV,
            GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VALUE));
    gl_panel_3.setVerticalGroup(gl_panel_3.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel_3.createSequentialGroup()
                    .addComponent(panelUV, GroupLayout.PREFERRED_SIZE, 241, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(306, Short.MAX_VALUE)));
    panel_3.setLayout(gl_panel_3);

    panelPV = new JPanelGrafica();
    GroupLayout gl_panel_2 = new GroupLayout(panel_2);
    gl_panel_2.setHorizontalGroup(gl_panel_2.createParallelGroup(Alignment.LEADING).addComponent(panelPV,
            GroupLayout.DEFAULT_SIZE, 249, Short.MAX_VALUE));
    gl_panel_2.setVerticalGroup(gl_panel_2.createParallelGroup(Alignment.LEADING).addComponent(panelPV,
            GroupLayout.DEFAULT_SIZE, 225, Short.MAX_VALUE));
    panel_2.setLayout(gl_panel_2);
    panelXV.setLayout(gl_panelXV);

    JPanel panelXT = new JPanel();
    panelXT.setBackground(Color.WHITE);
    tabbedPane.addTab("Grficas T", null, panelXT, null);

    JPanel panel_9 = new JPanel();

    panelPT = new JPanelGrafica();
    GroupLayout gl_panel_9 = new GroupLayout(panel_9);
    gl_panel_9.setHorizontalGroup(
            gl_panel_9.createParallelGroup(Alignment.LEADING).addGap(0, 263, Short.MAX_VALUE)
                    .addComponent(panelPT, GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE));
    gl_panel_9
            .setVerticalGroup(gl_panel_9.createParallelGroup(Alignment.LEADING).addGap(0, 241, Short.MAX_VALUE)
                    .addComponent(panelPT, GroupLayout.DEFAULT_SIZE, 241, Short.MAX_VALUE));
    panel_9.setLayout(gl_panel_9);

    JPanel panel_10 = new JPanel();

    panelST = new JPanelGrafica();
    GroupLayout gl_panel_10 = new GroupLayout(panel_10);
    gl_panel_10.setHorizontalGroup(
            gl_panel_10.createParallelGroup(Alignment.LEADING).addGap(0, 272, Short.MAX_VALUE)
                    .addComponent(panelST, GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VALUE));
    gl_panel_10
            .setVerticalGroup(gl_panel_10.createParallelGroup(Alignment.LEADING).addGap(0, 241, Short.MAX_VALUE)
                    .addGroup(gl_panel_10.createSequentialGroup()
                            .addComponent(panelST, GroupLayout.PREFERRED_SIZE, 241, GroupLayout.PREFERRED_SIZE)
                            .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    panel_10.setLayout(gl_panel_10);

    JPanel panel_11 = new JPanel();

    panelUT = new JPanelGrafica();
    GroupLayout gl_panel_11 = new GroupLayout(panel_11);
    gl_panel_11.setHorizontalGroup(
            gl_panel_11.createParallelGroup(Alignment.LEADING).addGap(0, 272, Short.MAX_VALUE)
                    .addComponent(panelUT, GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VALUE));
    gl_panel_11
            .setVerticalGroup(gl_panel_11.createParallelGroup(Alignment.LEADING).addGap(0, 241, Short.MAX_VALUE)
                    .addGroup(gl_panel_11.createSequentialGroup()
                            .addComponent(panelUT, GroupLayout.PREFERRED_SIZE, 241, GroupLayout.PREFERRED_SIZE)
                            .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    panel_11.setLayout(gl_panel_11);
    GroupLayout gl_panelXT = new GroupLayout(panelXT);
    gl_panelXT.setHorizontalGroup(gl_panelXT.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panelXT.createSequentialGroup().addContainerGap()
                    .addComponent(panel_9, GroupLayout.PREFERRED_SIZE, 263, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panel_10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panel_11, GroupLayout.PREFERRED_SIZE, 272, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(11, Short.MAX_VALUE)));
    gl_panelXT.setVerticalGroup(gl_panelXT.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panelXT.createSequentialGroup().addContainerGap()
                    .addGroup(gl_panelXT.createParallelGroup(Alignment.LEADING)
                            .addComponent(panel_11, GroupLayout.PREFERRED_SIZE, 241, GroupLayout.PREFERRED_SIZE)
                            .addGroup(gl_panelXT.createParallelGroup(Alignment.TRAILING, false)
                                    .addComponent(panel_10, Alignment.LEADING, 0, 0, Short.MAX_VALUE)
                                    .addComponent(panel_9, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 241,
                                            Short.MAX_VALUE)))
                    .addContainerGap(317, Short.MAX_VALUE)));
    panelXT.setLayout(gl_panelXT);
    panel_visualizar.setLayout(gl_panel_visualizar);

    getContentPane().setLayout(groupLayout);
}

From source file:uk.ac.ox.cbrg.cpfp.uploadapp.UploadApplet.java

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

    jPanel1 = new javax.swing.JPanel();
    jScrollPane1 = new javax.swing.JScrollPane();
    fileTable = new javax.swing.JTable();
    btnAdd = new javax.swing.JButton();
    btnDel = new javax.swing.JButton();
    btnUpload = new javax.swing.JButton();
    prgUploadProgress = new javax.swing.JProgressBar();
    lblProgress = new javax.swing.JLabel();
    lblMessages = new javax.swing.JLabel();
    jScrollPane2 = new javax.swing.JScrollPane();
    txtMessages = new javax.swing.JTextArea();
    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();

    fileTable.setModel(new javax.swing.table.DefaultTableModel(new Object[][] {

    }, new String[] { "Filename", "Size" }) {
        Class[] types = new Class[] { java.lang.String.class, java.lang.String.class };
        boolean[] canEdit = new boolean[] { false, false };

        public Class getColumnClass(int columnIndex) {
            return types[columnIndex];
        }

        public boolean isCellEditable(int rowIndex, int columnIndex) {
            return canEdit[columnIndex];
        }
    });
    fileTable.setColumnSelectionAllowed(true);
    fileTable.getTableHeader().setReorderingAllowed(false);
    jScrollPane1.setViewportView(fileTable);
    fileTable.getColumnModel().getSelectionModel()
            .setSelectionMode(javax.swing.ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);

    btnAdd.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/uk/ac/ox/cbrg/cpfp/uploadapp/12-em-plus.png"))); // NOI18N
    btnAdd.setText("Add File(s)");
    btnAdd.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnAddActionPerformed(evt);
        }
    });

    btnDel.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/uk/ac/ox/cbrg/cpfp/uploadapp/12-em-cross.png"))); // NOI18N
    btnDel.setText("Remove File(s)");
    btnDel.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnDelActionPerformed(evt);
        }
    });

    btnUpload.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/uk/ac/ox/cbrg/cpfp/uploadapp/12-em-up.png"))); // NOI18N
    btnUpload.setText("Upload Files");
    btnUpload.setEnabled(false);
    btnUpload.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnUploadActionPerformed(evt);
        }
    });

    prgUploadProgress.setStringPainted(true);

    lblProgress.setText("Progress:");

    lblMessages.setText("Messages:");

    txtMessages.setColumns(20);
    txtMessages.setRows(5);
    jScrollPane2.setViewportView(txtMessages);

    jLabel1.setFont(jLabel1.getFont().deriveFont(jLabel1.getFont().getStyle() | java.awt.Font.BOLD,
            jLabel1.getFont().getSize() + 3));
    jLabel1.setForeground(javax.swing.UIManager.getDefaults().getColor("textText"));
    jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jLabel1.setText("CPFP File Uploader");

    jLabel2.setText("2011.10.04");

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addGroup(jPanel1Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING,
                            javax.swing.GroupLayout.DEFAULT_SIZE, 609, Short.MAX_VALUE)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 609, Short.MAX_VALUE)
                    .addComponent(prgUploadProgress, javax.swing.GroupLayout.DEFAULT_SIZE, 609, Short.MAX_VALUE)
                    .addComponent(lblProgress)
                    .addGroup(jPanel1Layout.createSequentialGroup().addGroup(
                            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup().addComponent(btnAdd)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(btnDel))
                                    .addComponent(lblMessages))
                            .addGroup(jPanel1Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 257,
                                                    Short.MAX_VALUE))
                                    .addGroup(jPanel1Layout.createSequentialGroup().addGap(103, 103, 103)
                                            .addComponent(jLabel2)))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(btnUpload)))
                    .addContainerGap()));
    jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap()
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 244,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(jPanel1Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(btnAdd).addComponent(btnDel).addComponent(btnUpload)
                                            .addComponent(jLabel1))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(lblMessages)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 87,
                                            Short.MAX_VALUE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(lblProgress)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(prgUploadProgress, javax.swing.GroupLayout.PREFERRED_SIZE, 26,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(35, 35, 35))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout
                                    .createSequentialGroup().addComponent(jLabel2).addGap(195, 195, 195)))));

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addContainerGap().addComponent(jPanel1,
                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap()));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(
            javax.swing.GroupLayout.Alignment.TRAILING,
            layout.createSequentialGroup().addContainerGap().addComponent(jPanel1,
                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap()));
}

From source file:rod_design_compute.ShowPanel.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.//  ww w  .  j  a v  a2 s .  c  o m
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jLabelThu = new javax.swing.JLabel();

    addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
        public void mouseDragged(java.awt.event.MouseEvent evt) {
            formMouseDragged(evt);
        }

        public void mouseMoved(java.awt.event.MouseEvent evt) {
            formMouseMoved(evt);
        }
    });
    addMouseWheelListener(new java.awt.event.MouseWheelListener() {
        public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {
            formMouseWheelMoved(evt);
        }
    });
    addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            formMouseClicked(evt);
        }

        public void mousePressed(java.awt.event.MouseEvent evt) {
            formMousePressed(evt);
        }

        public void mouseReleased(java.awt.event.MouseEvent evt) {
            formMouseReleased(evt);
        }
    });

    jLabelThu.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/thu1.png"))); // NOI18N

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                    layout.createSequentialGroup().addGap(0, 123, Short.MAX_VALUE).addComponent(jLabelThu,
                            javax.swing.GroupLayout.PREFERRED_SIZE, 277,
                            javax.swing.GroupLayout.PREFERRED_SIZE)));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addComponent(jLabelThu,
                    javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 310, Short.MAX_VALUE)));
}

From source file:homenetapp.HomeNetAppGui.java

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

    SendPacketFrame = new javax.swing.JFrame();
    sendPacketButton = new javax.swing.JButton();
    jPanel1 = new javax.swing.JPanel();
    toNodeLabel = new javax.swing.JLabel();
    toNodeSpinner = new javax.swing.JSpinner();
    toDeviceLabel = new javax.swing.JLabel();
    toDeviceSpinner = new javax.swing.JSpinner();
    fromNodeLabel = new javax.swing.JLabel();
    fromNodeSpinner = new javax.swing.JSpinner();
    fromDeviceLabel = new javax.swing.JLabel();
    commandLabel = new javax.swing.JLabel();
    commandComboBox = new javax.swing.JComboBox();
    payloadLabel = new javax.swing.JLabel();
    payloadTextField = new javax.swing.JTextField();
    fromDeviceSpinner = new javax.swing.JSpinner();
    jSplitPane1 = new javax.swing.JSplitPane();
    SettingsDialog = new javax.swing.JDialog();
    jTabbedPane1 = new javax.swing.JTabbedPane();
    jPanel4 = new javax.swing.JPanel();
    serverLabel = new javax.swing.JLabel();
    apiKeyLabel = new javax.swing.JLabel();
    serverTextField = new javax.swing.JTextField();
    apiKeyTextField = new javax.swing.JTextField();
    testButton = new javax.swing.JButton();
    jLabel1 = new javax.swing.JLabel();
    certPropertiesLabel = new javax.swing.JLabel();
    jButton1 = new javax.swing.JButton();
    jPanel5 = new javax.swing.JPanel();
    serverPortLabel = new javax.swing.JLabel();
    serverPortTextField = new javax.swing.JTextField();
    enableUPnPCheckBox = new javax.swing.JCheckBox();
    enableServerCheckBox = new javax.swing.JCheckBox();
    jSeparator1 = new javax.swing.JSeparator();
    jPanel6 = new javax.swing.JPanel();
    checkForUpdatesCheckBox = new javax.swing.JCheckBox();
    settingsSaveButton = new javax.swing.JButton();
    filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0),
            new java.awt.Dimension(0, 32767));
    cardPanel = new javax.swing.JPanel();
    mainPanel = new javax.swing.JPanel();
    jPanel3 = new javax.swing.JPanel();
    jSplitPane2 = new javax.swing.JSplitPane();
    jPanel2 = new javax.swing.JPanel();
    jLabel9 = new javax.swing.JLabel();
    jScrollPane2 = new javax.swing.JScrollPane();
    packetTextArea = new javax.swing.JTextArea();
    jScrollPane3 = new javax.swing.JScrollPane();
    packetListModel = new DefaultListModel();
    jList1 = new javax.swing.JList();
    autoUpdateToggleButton = new javax.swing.JToggleButton();
    jScrollPane1 = new javax.swing.JScrollPane();
    consoleTextPane = new javax.swing.JTextPane();
    statusPanel = new javax.swing.JPanel();
    jLabel7 = new javax.swing.JLabel();
    localStatusLabel = new javax.swing.JLabel();
    jLabel11 = new javax.swing.JLabel();
    remoteStatusLabel = new javax.swing.JLabel();
    localSendingLabel = new javax.swing.JLabel();
    localReceivingLabel = new javax.swing.JLabel();
    remoteSendingLabel = new javax.swing.JLabel();
    remoteReceivingLabel = new javax.swing.JLabel();
    topMenuBar = new javax.swing.JMenuBar();
    menuFile = new javax.swing.JMenu();
    jMenuItem3 = new javax.swing.JMenuItem();
    menuTools = new javax.swing.JMenu();
    menuToolsSendPacket = new javax.swing.JMenuItem();
    menuToolsSettings = new javax.swing.JMenuItem();
    menuSerialPorts = new javax.swing.JMenu();
    menuHelp = new javax.swing.JMenu();
    menuHelpOnline = new javax.swing.JMenuItem();
    menuHelpAbout = new javax.swing.JMenuItem();

    SendPacketFrame.setTitle("Send Packet");
    SendPacketFrame.setMinimumSize(new java.awt.Dimension(380, 240));
    SendPacketFrame.setResizable(false);
    SendPacketFrame.addWindowListener(new java.awt.event.WindowAdapter() {
        public void windowOpened(java.awt.event.WindowEvent evt) {
            SendPacketFrameWindowOpened(evt);
        }
    });

    sendPacketButton.setText("Send");
    sendPacketButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            sendPacketButtonActionPerformed(evt);
        }
    });

    jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Packet"));

    toNodeLabel.setText("To Node: ");

    toNodeSpinner.setModel(new javax.swing.SpinnerNumberModel(0, 0, 4095, 1));

    toDeviceLabel.setText("To Device:");

    toDeviceSpinner.setModel(new javax.swing.SpinnerNumberModel(0, 0, 15, 1));

    fromNodeLabel.setText("From Node:");

    fromNodeSpinner.setModel(new javax.swing.SpinnerNumberModel(0, 0, 4095, 1));

    fromDeviceLabel.setText("From Device:");

    commandLabel.setText("Command:");

    commandComboBox.setModel(new javax.swing.DefaultComboBoxModel(homenetapp.getCommandKeys()));
    commandComboBox.setRenderer(new CommandRenderer());

    payloadLabel.setText("Payload:");

    fromDeviceSpinner.setModel(new javax.swing.SpinnerNumberModel(0, 0, 15, 1));

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup().addGap(10, 10, 10).addGroup(jPanel1Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING).addComponent(payloadLabel)
                    .addComponent(commandLabel).addComponent(fromNodeLabel).addComponent(toNodeLabel))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(commandComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE)
                            .addGroup(jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(toNodeSpinner).addComponent(fromNodeSpinner))
                                    .addGap(18, 18, 18)
                                    .addGroup(jPanel1Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(fromDeviceLabel).addComponent(toDeviceLabel))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(jPanel1Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
                                                    false)
                                            .addComponent(toDeviceSpinner, 0, 0, Short.MAX_VALUE).addComponent(
                                                    fromDeviceSpinner, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    37, Short.MAX_VALUE))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 2,
                                            Short.MAX_VALUE))
                            .addComponent(payloadTextField))
                    .addContainerGap(17, Short.MAX_VALUE)));
    jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addGroup(jPanel1Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(toNodeLabel)
                    .addComponent(toNodeSpinner, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(toDeviceLabel).addComponent(toDeviceSpinner,
                            javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                            javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(fromNodeLabel)
                            .addComponent(fromNodeSpinner, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(fromDeviceLabel).addComponent(fromDeviceSpinner,
                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(commandComboBox, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(commandLabel))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(payloadTextField, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(payloadLabel))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    javax.swing.GroupLayout SendPacketFrameLayout = new javax.swing.GroupLayout(
            SendPacketFrame.getContentPane());
    SendPacketFrame.getContentPane().setLayout(SendPacketFrameLayout);
    SendPacketFrameLayout.setHorizontalGroup(
            SendPacketFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(SendPacketFrameLayout.createSequentialGroup().addContainerGap()
                            .addGroup(SendPacketFrameLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(sendPacketButton).addComponent(jPanel1,
                                            javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    SendPacketFrameLayout.setVerticalGroup(SendPacketFrameLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(SendPacketFrameLayout.createSequentialGroup().addContainerGap()
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(sendPacketButton)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    SettingsDialog.setTitle("HomeNet Settings");
    SettingsDialog.setMinimumSize(new java.awt.Dimension(400, 300));
    SettingsDialog.setResizable(false);
    SettingsDialog.addWindowListener(new java.awt.event.WindowAdapter() {
        public void windowOpened(java.awt.event.WindowEvent evt) {
            SettingsDialogWindowOpened(evt);
        }
    });

    serverLabel.setText("Server:");

    apiKeyLabel.setText("API Key:");

    serverTextField.setEditable(false);
    serverTextField.setText("homenet.me");

    apiKeyTextField.setText("reallylongstringofchars");

    testButton.setText("Test");
    testButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            testButtonActionPerformed(evt);
        }
    });

    jLabel1.setText("SSL Cert:");

    certPropertiesLabel.setText("Loading...");

    jButton1.setText("Paste");
    jButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton1ActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
    jPanel4.setLayout(jPanel4Layout);
    jPanel4Layout.setHorizontalGroup(jPanel4Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup().addContainerGap().addGroup(jPanel4Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(apiKeyLabel).addComponent(serverLabel))
                    .addComponent(jLabel1)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                    jPanel4Layout.createSequentialGroup()
                                            .addComponent(certPropertiesLabel,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, 182, Short.MAX_VALUE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(testButton)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jButton1))
                            .addComponent(apiKeyTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 304,
                                    Short.MAX_VALUE)
                            .addComponent(serverTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 304,
                                    Short.MAX_VALUE))
                    .addContainerGap()));
    jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup().addContainerGap()
                    .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(serverTextField, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(serverLabel))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(apiKeyTextField, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(apiKeyLabel))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel1).addComponent(certPropertiesLabel).addComponent(testButton)
                            .addComponent(jButton1))
                    .addContainerGap(81, Short.MAX_VALUE)));

    jTabbedPane1.addTab("Client", jPanel4);

    serverPortLabel.setText("Port:");

    serverPortTextField.setEditable(false);
    serverPortTextField.setText("2443");

    enableUPnPCheckBox.setText("Enable UPnP Portforwarding");

    enableServerCheckBox.setSelected(true);
    enableServerCheckBox.setText("Enable Local Server");
    enableServerCheckBox.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            enableServerCheckBoxActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
    jPanel5.setLayout(jPanel5Layout);
    jPanel5Layout.setHorizontalGroup(jPanel5Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup().addContainerGap().addComponent(serverPortLabel)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(serverPortTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 43,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(294, Short.MAX_VALUE))
            .addGroup(jPanel5Layout.createSequentialGroup().addContainerGap().addComponent(enableServerCheckBox)
                    .addContainerGap(250, Short.MAX_VALUE))
            .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.TRAILING,
                    javax.swing.GroupLayout.DEFAULT_SIZE, 375, Short.MAX_VALUE)
            .addGroup(jPanel5Layout.createSequentialGroup().addContainerGap().addComponent(enableUPnPCheckBox)
                    .addContainerGap(208, Short.MAX_VALUE)));
    jPanel5Layout.setVerticalGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup().addContainerGap().addComponent(enableServerCheckBox)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 2,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                            .addComponent(serverPortTextField, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(serverPortLabel))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(enableUPnPCheckBox).addContainerGap(77, Short.MAX_VALUE)));

    jTabbedPane1.addTab("Server", jPanel5);

    checkForUpdatesCheckBox.setText("Check For Updates");

    javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
    jPanel6.setLayout(jPanel6Layout);
    jPanel6Layout
            .setHorizontalGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel6Layout.createSequentialGroup().addContainerGap()
                            .addComponent(checkForUpdatesCheckBox).addContainerGap(252, Short.MAX_VALUE)));
    jPanel6Layout.setVerticalGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup().addContainerGap()
                    .addComponent(checkForUpdatesCheckBox).addContainerGap(137, Short.MAX_VALUE)));

    jTabbedPane1.addTab("Preferences", jPanel6);

    settingsSaveButton.setText("Save");
    settingsSaveButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            settingsSaveButtonActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout SettingsDialogLayout = new javax.swing.GroupLayout(SettingsDialog.getContentPane());
    SettingsDialog.getContentPane().setLayout(SettingsDialogLayout);
    SettingsDialogLayout.setHorizontalGroup(SettingsDialogLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(SettingsDialogLayout.createSequentialGroup().addContainerGap().addGroup(
                    SettingsDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(settingsSaveButton, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 380,
                                    Short.MAX_VALUE))
                    .addContainerGap()));
    SettingsDialogLayout.setVerticalGroup(SettingsDialogLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, SettingsDialogLayout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 195, Short.MAX_VALUE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(settingsSaveButton).addContainerGap()));

    jTabbedPane1.getAccessibleContext().setAccessibleName("Server");

    SettingsDialog.getAccessibleContext().setAccessibleName("HomeNet App Settings");

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setTitle("HomeNet.me Desktop App");

    cardPanel.setLayout(new java.awt.CardLayout());

    mainPanel.setLayout(new javax.swing.BoxLayout(mainPanel, javax.swing.BoxLayout.Y_AXIS));

    jSplitPane2.setDividerLocation(200);
    jSplitPane2.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);

    jLabel9.setText("Packets Received:");

    packetTextArea.setColumns(20);
    packetTextArea.setFont(new java.awt.Font("Courier New", 0, 12));
    packetTextArea.setRows(5);
    jScrollPane2.setViewportView(packetTextArea);

    jList1.setModel(packetListModel);
    jList1.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
    jList1.setCellRenderer(new PacketListRenderer());
    jList1.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
        public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
            jList1ValueChanged(evt);
        }
    });
    jScrollPane3.setViewportView(jList1);

    autoUpdateToggleButton.setSelected(true);
    autoUpdateToggleButton.setText("Auto Update");
    autoUpdateToggleButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            autoUpdateToggleButtonActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(jPanel2Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap()
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel9).addComponent(jScrollPane3,
                                    javax.swing.GroupLayout.PREFERRED_SIZE, 152,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(autoUpdateToggleButton).addComponent(jScrollPane2,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, 350, Short.MAX_VALUE))
                    .addContainerGap()));
    jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel9).addComponent(autoUpdateToggleButton))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 148,
                                    Short.MAX_VALUE)
                            .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 148,
                                    Short.MAX_VALUE))
                    .addContainerGap()));

    jSplitPane2.setTopComponent(jPanel2);

    consoleTextPane.setBackground(new java.awt.Color(0, 0, 0));
    consoleTextPane.setEditable(false);
    consoleTextPane.setFont(new java.awt.Font("Consolas", 0, 10));
    consoleTextPane.setForeground(new java.awt.Color(255, 255, 255));
    jScrollPane1.setViewportView(consoleTextPane);

    jSplitPane2.setRightComponent(jScrollPane1);

    javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
    jPanel3.setLayout(jPanel3Layout);
    jPanel3Layout.setHorizontalGroup(jPanel3Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 530, Short.MAX_VALUE)
            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jSplitPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 530, Short.MAX_VALUE)));
    jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 320, Short.MAX_VALUE)
            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jSplitPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 320, Short.MAX_VALUE)));

    mainPanel.add(jPanel3);

    statusPanel.setBackground(new java.awt.Color(204, 204, 204));
    statusPanel.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

    jLabel7.setText("Local:");

    localStatusLabel.setText("Not Connected");

    jLabel11.setText("Remote:");

    remoteStatusLabel.setText("Not Connected");

    localSendingLabel.setFont(new java.awt.Font("Courier New", 0, 11));
    localSendingLabel.setText("( )");

    localReceivingLabel.setFont(new java.awt.Font("Courier New", 0, 11));
    localReceivingLabel.setText("( )");

    remoteSendingLabel.setFont(new java.awt.Font("Courier New", 0, 11));
    remoteSendingLabel.setText("( )");

    remoteReceivingLabel.setFont(new java.awt.Font("Courier New", 0, 11));
    remoteReceivingLabel.setText("( )");

    javax.swing.GroupLayout statusPanelLayout = new javax.swing.GroupLayout(statusPanel);
    statusPanel.setLayout(statusPanelLayout);
    statusPanelLayout.setHorizontalGroup(statusPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(statusPanelLayout.createSequentialGroup().addContainerGap().addComponent(jLabel7)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(localStatusLabel)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(localSendingLabel)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(localReceivingLabel)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 177, Short.MAX_VALUE)
                    .addComponent(jLabel11).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(remoteStatusLabel)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(remoteSendingLabel)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(remoteReceivingLabel).addContainerGap()));
    statusPanelLayout
            .setVerticalGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 20,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(localStatusLabel).addComponent(localSendingLabel)
                            .addComponent(localReceivingLabel).addComponent(remoteSendingLabel)
                            .addComponent(remoteReceivingLabel).addComponent(remoteStatusLabel)
                            .addComponent(jLabel11)));

    mainPanel.add(statusPanel);

    cardPanel.add(mainPanel, "card2");

    topMenuBar.setVisible(false);

    menuFile.setMnemonic('f');
    menuFile.setText("File");

    jMenuItem3.setMnemonic('e');
    jMenuItem3.setText("Exit");
    jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem3ActionPerformed(evt);
        }
    });
    menuFile.add(jMenuItem3);

    topMenuBar.add(menuFile);

    menuTools.setMnemonic('t');
    menuTools.setText("Tools");

    menuToolsSendPacket.setMnemonic('p');
    menuToolsSendPacket.setText("Send Packet");
    menuToolsSendPacket.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            menuToolsSendPacketActionPerformed(evt);
        }
    });
    menuTools.add(menuToolsSendPacket);

    menuToolsSettings.setMnemonic('s');
    menuToolsSettings.setText("Settings");
    menuToolsSettings.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            menuToolsSettingsActionPerformed(evt);
        }
    });
    menuTools.add(menuToolsSettings);

    menuSerialPorts.setMnemonic('e');
    menuSerialPorts.setText("Select Ports");
    menuSerialPorts.addMenuListener(new javax.swing.event.MenuListener() {
        public void menuCanceled(javax.swing.event.MenuEvent evt) {
        }

        public void menuDeselected(javax.swing.event.MenuEvent evt) {
        }

        public void menuSelected(javax.swing.event.MenuEvent evt) {
            menuSerialPortsMenuSelected(evt);
        }
    });
    menuSerialPorts.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            menuSerialPortsActionPerformed(evt);
        }
    });
    menuTools.add(menuSerialPorts);

    topMenuBar.add(menuTools);

    menuHelp.setMnemonic('h');
    menuHelp.setText("Help");

    menuHelpOnline.setText("Online Help");
    menuHelpOnline.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            menuHelpOnlineActionPerformed(evt);
        }
    });
    menuHelp.add(menuHelpOnline);

    menuHelpAbout.setText("About");
    menuHelpAbout.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            menuHelpAboutActionPerformed(evt);
        }
    });
    menuHelp.add(menuHelpAbout);

    topMenuBar.add(menuHelp);

    setJMenuBar(topMenuBar);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(cardPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 530, Short.MAX_VALUE));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(cardPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 340, Short.MAX_VALUE));

    pack();
}