Example usage for javax.swing WindowConstants EXIT_ON_CLOSE

List of usage examples for javax.swing WindowConstants EXIT_ON_CLOSE

Introduction

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

Prototype

int EXIT_ON_CLOSE

To view the source code for javax.swing WindowConstants EXIT_ON_CLOSE.

Click Source Link

Document

The exit application default window close operation.

Usage

From source file:graphics.MainWindow.java

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

    jPanel1 = new javax.swing.JPanel();
    jPanelpos1 = new javax.swing.JPanel();
    jPanelpos2 = new javax.swing.JPanel();
    jPanelpos3 = new javax.swing.JPanel();
    jPanelpos4 = new javax.swing.JPanel();
    jPanelpos5 = new javax.swing.JPanel();
    jPanelpos6 = new javax.swing.JPanel();
    jPanelpos7 = new javax.swing.JPanel();
    jPanelpos8 = new javax.swing.JPanel();
    jPanelpos9 = new javax.swing.JPanel();
    jPanelpos10 = new javax.swing.JPanel();
    jPanelpos11 = new javax.swing.JPanel();
    jPanelpos12 = new javax.swing.JPanel();
    jPanelpos13 = new javax.swing.JPanel();
    jPanelpos14 = new javax.swing.JPanel();
    jPanelpos15 = new javax.swing.JPanel();
    jPanelpos16 = new javax.swing.JPanel();
    jMenuBar6 = new javax.swing.JMenuBar();
    jMenu6 = new javax.swing.JMenu();
    Start = new javax.swing.JMenuItem();
    PauseMenuItem = new javax.swing.JCheckBoxMenuItem();
    Stop = new javax.swing.JMenuItem();
    Exit = new javax.swing.JMenuItem();
    jMenu1 = new javax.swing.JMenu();
    SimulationConf = new javax.swing.JMenuItem();
    AddSpecie = new javax.swing.JMenuItem();
    AddCell = new javax.swing.JMenuItem();
    jMenu2 = new javax.swing.JMenu();
    Help = new javax.swing.JMenuItem();
    About = new javax.swing.JMenuItem();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

    jPanel1.setLayout(new java.awt.GridLayout(4, 4));

    jPanelpos1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    jPanelpos1.setLayout(new java.awt.CardLayout());
    jPanel1.add(jPanelpos1);

    jPanelpos2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    jPanelpos2.setLayout(new java.awt.CardLayout());
    jPanel1.add(jPanelpos2);

    jPanelpos3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    jPanelpos3.setLayout(new java.awt.CardLayout());
    jPanel1.add(jPanelpos3);

    jPanelpos4.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    jPanelpos4.setLayout(new java.awt.CardLayout());
    jPanel1.add(jPanelpos4);

    jPanelpos5.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    jPanelpos5.setLayout(new java.awt.CardLayout());
    jPanel1.add(jPanelpos5);

    jPanelpos6.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    jPanelpos6.setLayout(new java.awt.CardLayout());
    jPanel1.add(jPanelpos6);

    jPanelpos7.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    jPanelpos7.setLayout(new java.awt.CardLayout());
    jPanel1.add(jPanelpos7);

    jPanelpos8.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    jPanelpos8.setLayout(new java.awt.CardLayout());
    jPanel1.add(jPanelpos8);

    jPanelpos9.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    jPanelpos9.setLayout(new java.awt.CardLayout());
    jPanel1.add(jPanelpos9);

    jPanelpos10.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    jPanelpos10.setLayout(new java.awt.CardLayout());
    jPanel1.add(jPanelpos10);

    jPanelpos11.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    jPanelpos11.setLayout(new java.awt.CardLayout());
    jPanel1.add(jPanelpos11);

    jPanelpos12.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    jPanelpos12.setLayout(new java.awt.CardLayout());
    jPanel1.add(jPanelpos12);

    jPanelpos13.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    jPanelpos13.setLayout(new java.awt.CardLayout());
    jPanel1.add(jPanelpos13);

    jPanelpos14.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    jPanelpos14.setLayout(new java.awt.CardLayout());
    jPanel1.add(jPanelpos14);

    jPanelpos15.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    jPanelpos15.setLayout(new java.awt.CardLayout());
    jPanel1.add(jPanelpos15);

    jPanelpos16.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    jPanelpos16.setLayout(new java.awt.CardLayout());
    jPanel1.add(jPanelpos16);

    jMenu6.setText("Simulation");

    Start.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N,
            java.awt.event.InputEvent.CTRL_MASK));
    Start.setText("Start");
    Start.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            StartActionPerformed(evt);
        }
    });
    jMenu6.add(Start);

    PauseMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P,
            java.awt.event.InputEvent.CTRL_MASK));
    PauseMenuItem.setText("Pause");
    PauseMenuItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            PauseMenuItemActionPerformed(evt);
        }
    });
    jMenu6.add(PauseMenuItem);

    Stop.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O,
            java.awt.event.InputEvent.CTRL_MASK));
    Stop.setText("Stop");
    Stop.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            StopActionPerformed(evt);
        }
    });
    jMenu6.add(Stop);

    Exit.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_X,
            java.awt.event.InputEvent.CTRL_MASK));
    Exit.setText("Exit");
    Exit.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            ExitActionPerformed(evt);
        }
    });
    jMenu6.add(Exit);

    jMenuBar6.add(jMenu6);

    jMenu1.setText("Edit");

    SimulationConf.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C,
            java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
    SimulationConf.setText("Simulation Configuration");
    SimulationConf.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SimulationConfActionPerformed(evt);
        }
    });
    jMenu1.add(SimulationConf);

    AddSpecie.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S,
            java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
    AddSpecie.setText("Add New Specie");
    AddSpecie.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            AddSpecieActionPerformed(evt);
        }
    });
    jMenu1.add(AddSpecie);

    AddCell.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A,
            java.awt.event.InputEvent.CTRL_MASK));
    AddCell.setText("Add New Cell");
    AddCell.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            AddCellActionPerformed(evt);
        }
    });
    jMenu1.add(AddCell);

    jMenuBar6.add(jMenu1);

    jMenu2.setText("Help");

    Help.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_H,
            java.awt.event.InputEvent.CTRL_MASK));
    Help.setText("Help");
    jMenu2.add(Help);

    About.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A,
            java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
    About.setText("About");
    jMenu2.add(About);

    jMenuBar6.add(jMenu2);

    setJMenuBar(jMenuBar6);

    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(66, 66, 66).addComponent(jPanel1,
                            javax.swing.GroupLayout.PREFERRED_SIZE, 468, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(76, Short.MAX_VALUE)));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout
                    .createSequentialGroup().addGap(47, 47, 47).addComponent(jPanel1,
                            javax.swing.GroupLayout.PREFERRED_SIZE, 439, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(60, Short.MAX_VALUE)));

    pack();
}

From source file:interfazGrafica.frmMoverRFC.java

@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    ventanaGeneral = new javax.swing.JPanel();
    panelGeneral = new javax.swing.JPanel();
    nombreArchivo = new javax.swing.JLabel();
    jScrollPane1 = new javax.swing.JScrollPane();
    listaArchivos = new javax.swing.JList();
    panelPDF = new javax.swing.JPanel();
    botonAnt = new javax.swing.JButton();
    botonSig = new javax.swing.JButton();
    BotonLigarCURPRFC = new javax.swing.JButton();
    jScrollPane2 = new javax.swing.JScrollPane();
    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    jLabel3 = new javax.swing.JLabel();
    txtCapturaCurp = new javax.swing.JTextField();

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

    ventanaGeneral.setBackground(new java.awt.Color(233, 233, 233));
    ventanaGeneral.setForeground(new java.awt.Color(227, 227, 227));
    ventanaGeneral.setMinimumSize(new java.awt.Dimension(1300, 500));

    panelGeneral.setBackground(new java.awt.Color(255, 255, 255));
    panelGeneral.setForeground(new java.awt.Color(102, 102, 102));
    panelGeneral.setPreferredSize(new java.awt.Dimension(900, 600));

    nombreArchivo.setFont(new java.awt.Font("Arial", 0, 36)); // NOI18N
    nombreArchivo.setForeground(new java.awt.Color(51, 51, 51));
    nombreArchivo.setText(Nombre_Archivo);

    jScrollPane1.setBackground(new java.awt.Color(255, 255, 255));
    jScrollPane1.setBorder(null);/*from   w  w  w  .  j ava 2  s.c  o m*/
    jScrollPane1.setForeground(new java.awt.Color(255, 255, 255));

    listaArchivos.setBackground(new java.awt.Color(240, 240, 240));
    listaArchivos.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
    listaArchivos.setForeground(new java.awt.Color(102, 102, 102));
    listaArchivos.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
    listaArchivos.setFocusable(false);
    listaArchivos.setOpaque(false);
    listaArchivos.setRequestFocusEnabled(false);
    listaArchivos.setSelectionBackground(new java.awt.Color(153, 153, 153));
    listaArchivos.setVerifyInputWhenFocusTarget(false);
    listaArchivos.setVisibleRowCount(0);
    jScrollPane1.setViewportView(listaArchivos);

    panelPDF.setBackground(new java.awt.Color(204, 204, 255));

    javax.swing.GroupLayout panelPDFLayout = new javax.swing.GroupLayout(panelPDF);
    panelPDF.setLayout(panelPDFLayout);
    panelPDFLayout.setHorizontalGroup(panelPDFLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 1008, Short.MAX_VALUE));
    panelPDFLayout.setVerticalGroup(panelPDFLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE));

    botonAnt.setBackground(new java.awt.Color(204, 204, 204));
    botonAnt.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/zoomOut.png"))); // NOI18N
    botonAnt.setToolTipText("Clic para alejar");
    botonAnt.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
    botonAnt.setFocusable(false);
    botonAnt.setRequestFocusEnabled(false);
    botonAnt.setRolloverEnabled(false);
    botonAnt.setVerifyInputWhenFocusTarget(false);
    botonAnt.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            botonAntActionPerformed(evt);
        }
    });

    botonSig.setBackground(new java.awt.Color(204, 204, 204));
    botonSig.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/zoomIn.png"))); // NOI18N
    botonSig.setToolTipText("Clic para acercar");
    botonSig.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
    botonSig.setFocusable(false);
    botonSig.setRequestFocusEnabled(false);
    botonSig.setRolloverEnabled(false);
    botonSig.setVerifyInputWhenFocusTarget(false);
    botonSig.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            botonSigActionPerformed(evt);
        }
    });

    BotonLigarCURPRFC.setBackground(new java.awt.Color(255, 255, 255));
    BotonLigarCURPRFC.setFont(new java.awt.Font("SansSerif", 0, 14)); // NOI18N
    BotonLigarCURPRFC.setText("Ligar CURP a RFC");
    BotonLigarCURPRFC.setActionCommand("Asignar CURP al RFC");
    BotonLigarCURPRFC.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(238, 100, 100), 1, true));
    BotonLigarCURPRFC.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
    BotonLigarCURPRFC.setFocusable(false);
    BotonLigarCURPRFC.setRequestFocusEnabled(false);
    BotonLigarCURPRFC.setRolloverEnabled(false);
    BotonLigarCURPRFC.setVerifyInputWhenFocusTarget(false);
    BotonLigarCURPRFC.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            BotonLigarCURPRFCActionPerformed(evt);
        }
    });

    jLabel1.setText("Alejar rea Ampliada");

    jLabel2.setText("Ampliar ?rea");

    jLabel3.setText("Teclea el CURP:");

    txtCapturaCurp.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            txtCapturaCurpActionPerformed(evt);
        }
    });
    txtCapturaCurp.addKeyListener(new java.awt.event.KeyAdapter() {
        public void keyTyped(java.awt.event.KeyEvent evt) {
            txtCapturaCurpKeyTyped(evt);
        }
    });

    javax.swing.GroupLayout panelGeneralLayout = new javax.swing.GroupLayout(panelGeneral);
    panelGeneral.setLayout(panelGeneralLayout);
    panelGeneralLayout.setHorizontalGroup(panelGeneralLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelGeneralLayout.createSequentialGroup().addContainerGap().addGroup(panelGeneralLayout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelGeneralLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 211,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                    panelGeneralLayout.createSequentialGroup().addComponent(botonSig)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 148,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(29, 29, 29)))
                    .addGroup(panelGeneralLayout.createSequentialGroup().addComponent(botonAnt)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 148,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(BotonLigarCURPRFC, javax.swing.GroupLayout.PREFERRED_SIZE, 211,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(panelGeneralLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(txtCapturaCurp, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.LEADING,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, 211, Short.MAX_VALUE)))
                    .addGroup(panelGeneralLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(panelGeneralLayout.createSequentialGroup()
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(panelPDF, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addGroup(panelGeneralLayout.createSequentialGroup().addGap(46, 46, 46)
                                    .addComponent(nombreArchivo)))
                    .addGap(18, 18, 18).addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 10,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(27, 27, 27)));
    panelGeneralLayout.setVerticalGroup(panelGeneralLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelGeneralLayout.createSequentialGroup().addGroup(panelGeneralLayout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelGeneralLayout.createSequentialGroup().addContainerGap()
                            .addComponent(nombreArchivo)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(panelGeneralLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 616,
                                            Short.MAX_VALUE)
                                    .addComponent(panelPDF, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addGroup(panelGeneralLayout.createSequentialGroup().addGap(89, 89, 89)
                            .addGroup(panelGeneralLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(botonSig, javax.swing.GroupLayout.PREFERRED_SIZE, 32,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 32,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGap(26, 26, 26)
                            .addGroup(panelGeneralLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(botonAnt, javax.swing.GroupLayout.PREFERRED_SIZE, 32,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 32,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGap(73, 73, 73)
                            .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 23,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(18, 18, 18)
                            .addComponent(txtCapturaCurp, javax.swing.GroupLayout.PREFERRED_SIZE, 37,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(134, 134, 134)
                            .addComponent(BotonLigarCURPRFC, javax.swing.GroupLayout.PREFERRED_SIZE, 36,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(173, 173, 173).addComponent(jScrollPane1,
                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    javax.swing.GroupLayout ventanaGeneralLayout = new javax.swing.GroupLayout(ventanaGeneral);
    ventanaGeneral.setLayout(ventanaGeneralLayout);
    ventanaGeneralLayout.setHorizontalGroup(ventanaGeneralLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ventanaGeneralLayout.createSequentialGroup().addComponent(panelGeneral,
                    javax.swing.GroupLayout.PREFERRED_SIZE, 1311, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 9, Short.MAX_VALUE)));
    ventanaGeneralLayout.setVerticalGroup(ventanaGeneralLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ventanaGeneralLayout.createSequentialGroup().addComponent(panelGeneral,
                    javax.swing.GroupLayout.PREFERRED_SIZE, 687, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 22, Short.MAX_VALUE)));

    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(ventanaGeneral, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                    .addComponent(ventanaGeneral, 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:com.yifanlu.PSXperiaTool.Interface.GUI.java

/**
 * This method is called from within the constructor to
 * initialize the form./*from   w  w  w  .  ja  va2  s .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() {

    tabbedPane = new javax.swing.JTabbedPane();
    informationPanel = new javax.swing.JPanel();
    licenseCheck1 = new javax.swing.JCheckBox();
    licenseCheck2 = new javax.swing.JCheckBox();
    licenseCheck3 = new javax.swing.JCheckBox();
    licenseCheck4 = new javax.swing.JCheckBox();
    textScrollPane = new javax.swing.JScrollPane();
    licenseText = new javax.swing.JTextArea();
    extractPanel = new javax.swing.JPanel();
    extractInformation = new javax.swing.JLabel();
    apkFileLabel = new javax.swing.JLabel();
    apkFileInput = new javax.swing.JTextField();
    zpakFileInput = new javax.swing.JTextField();
    extractOutputInput = new javax.swing.JTextField();
    zpakFileLabel = new javax.swing.JLabel();
    extractOutputLabel = new javax.swing.JLabel();
    chooseZpakFile = new javax.swing.JButton();
    chooseApkFile = new javax.swing.JButton();
    chooseOutputDir = new javax.swing.JButton();
    extractProgress = new javax.swing.JProgressBar();
    extractButton = new javax.swing.JButton();
    extractStatus = new javax.swing.JLabel();
    createPanel = new javax.swing.JPanel();
    chooseData = new javax.swing.JButton();
    dataInput = new javax.swing.JTextField();
    dataLabel = new javax.swing.JLabel();
    isoLabel = new javax.swing.JLabel();
    isoInput = new javax.swing.JTextField();
    chooseIso = new javax.swing.JButton();
    chooseIcon = new javax.swing.JButton();
    convertOutputInput = new javax.swing.JTextField();
    convertOutputLabel = new javax.swing.JLabel();
    chooseConvertOutput = new javax.swing.JButton();
    convertSeparator = new javax.swing.JSeparator();
    loadXmlButton = new javax.swing.JButton();
    gameInformationLabel = new javax.swing.JLabel();
    titleIdLabel = new javax.swing.JLabel();
    titleIdInput = new javax.swing.JTextField();
    nameInput = new javax.swing.JTextField();
    nameLabel = new javax.swing.JLabel();
    developerInput = new javax.swing.JTextField();
    developerLabel = new javax.swing.JLabel();
    publisherLabel = new javax.swing.JLabel();
    publisherInput = new javax.swing.JTextField();
    descriptionLabel = new javax.swing.JLabel();
    descriptionTextPane = new javax.swing.JScrollPane();
    descriptionTextInput = new javax.swing.JTextArea();
    convertProgress = new javax.swing.JProgressBar();
    parentalRatingLabel = new javax.swing.JLabel();
    parentalRatingInput = new javax.swing.JTextField();
    storeTypeLabel = new javax.swing.JLabel();
    storeTypeInput = new javax.swing.JTextField();
    analogModeCheckbox = new javax.swing.JCheckBox();
    convertButton = new javax.swing.JButton();
    getTitleIdButton = new javax.swing.JButton();
    iconImagePreview = new javax.swing.JLabel();
    convertStatus = new javax.swing.JLabel();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setTitle("PSXperia Tool");
    setName("PSXperia Tool"); // NOI18N
    setPreferredSize(new java.awt.Dimension(800, 540));
    setResizable(false);
    setSize(new java.awt.Dimension(800, 540));
    addWindowListener(new java.awt.event.WindowAdapter() {
        public void windowOpened(java.awt.event.WindowEvent evt) {
            formWindowOpened(evt);
        }
    });

    tabbedPane.setPreferredSize(new java.awt.Dimension(800, 530));

    licenseCheck1.setText("Yes, I own a Xperia Play and the Crash Bandicoot APK");

    licenseCheck2.setText("Yes, I own the game(s) I will convert and have permission to use them");

    licenseCheck3.setText("Yes, I will not distribute/redistribute any of the files generated by this tool");

    licenseCheck4.setText("Yes, I understand this is a free tool and does not come with any warranties");

    licenseText.setColumns(20);
    licenseText.setEditable(false);
    licenseText.setLineWrap(true);
    licenseText.setRows(5);
    licenseText.setText(
            "This tool is designed to allow you to convert PSX game(s) that you OWN and have permission to USE on your Android phone by modifying the files from the \"Crash Bandicoot\" game that is included with the Xperia Play. You must own these files too and the phone to obtain the necessary files. Please understand that piracy hurts the game industry and prevents developers from earning money for their hard work, so do not distribute any files you create with this tool. Finally, know that this tool is completely free and open source and should not be sold as is or part of any package. If you understand all of this, check the boxes and highlight my name below to enable the tool.\n\n-Yifan Lu\nhttp://yifan.lu/\nhttp://github.com/yifanlu/PSXperia\n");
    licenseText.setWrapStyleWord(true);
    licenseText.addCaretListener(new javax.swing.event.CaretListener() {
        public void caretUpdate(javax.swing.event.CaretEvent evt) {
            licenseTextCaretUpdate(evt);
        }
    });
    textScrollPane.setViewportView(licenseText);

    org.jdesktop.layout.GroupLayout informationPanelLayout = new org.jdesktop.layout.GroupLayout(
            informationPanel);
    informationPanel.setLayout(informationPanelLayout);
    informationPanelLayout.setHorizontalGroup(informationPanelLayout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(informationPanelLayout.createSequentialGroup().addContainerGap().add(informationPanelLayout
                    .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(textScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 739, Short.MAX_VALUE)
                    .add(licenseCheck4).add(licenseCheck3).add(licenseCheck2).add(licenseCheck1))
                    .addContainerGap()));
    informationPanelLayout.setVerticalGroup(informationPanelLayout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, informationPanelLayout.createSequentialGroup()
                    .addContainerGap()
                    .add(textScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 328, Short.MAX_VALUE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(licenseCheck1)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED).add(licenseCheck2)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED).add(licenseCheck3)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED).add(licenseCheck4)
                    .addContainerGap()));

    tabbedPane.addTab("Information", informationPanel);

    java.util.ResourceBundle bundle = java.util.ResourceBundle
            .getBundle("com/yifanlu/PSXperiaTool/Interface/Strings"); // NOI18N
    extractInformation.setText(bundle.getString("extract.directions")); // NOI18N

    apkFileLabel.setText(bundle.getString("extract.apkfile")); // NOI18N

    zpakFileLabel.setText(bundle.getString("extract.zpakfile")); // NOI18N

    extractOutputLabel.setText(bundle.getString("extract.output")); // NOI18N

    chooseZpakFile.setText(bundle.getString("extract.choose")); // NOI18N
    chooseZpakFile.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            chooseZpakFileActionPerformed(evt);
        }
    });

    chooseApkFile.setText(bundle.getString("extract.choose")); // NOI18N
    chooseApkFile.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            chooseApkFileActionPerformed(evt);
        }
    });

    chooseOutputDir.setText(bundle.getString("extract.choose")); // NOI18N
    chooseOutputDir.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            chooseOutputDirActionPerformed(evt);
        }
    });

    extractButton.setText(bundle.getString("extract.extract")); // NOI18N
    extractButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            extractButtonActionPerformed(evt);
        }
    });

    org.jdesktop.layout.GroupLayout extractPanelLayout = new org.jdesktop.layout.GroupLayout(extractPanel);
    extractPanel.setLayout(extractPanelLayout);
    extractPanelLayout.setHorizontalGroup(extractPanelLayout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, extractPanelLayout.createSequentialGroup()
                    .addContainerGap()
                    .add(extractPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(org.jdesktop.layout.GroupLayout.LEADING, extractStatus,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 739, Short.MAX_VALUE)
                            .add(org.jdesktop.layout.GroupLayout.LEADING, extractInformation,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 739, Short.MAX_VALUE)
                            .add(extractPanelLayout.createSequentialGroup().add(extractPanelLayout
                                    .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(org.jdesktop.layout.GroupLayout.TRAILING, extractPanelLayout
                                            .createSequentialGroup()
                                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 5,
                                                    Short.MAX_VALUE)
                                            .add(extractPanelLayout
                                                    .createParallelGroup(
                                                            org.jdesktop.layout.GroupLayout.LEADING)
                                                    .add(extractOutputLabel).add(zpakFileLabel)
                                                    .add(apkFileLabel))
                                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                            .add(extractPanelLayout
                                                    .createParallelGroup(
                                                            org.jdesktop.layout.GroupLayout.TRAILING, false)
                                                    .add(org.jdesktop.layout.GroupLayout.LEADING, zpakFileInput)
                                                    .add(org.jdesktop.layout.GroupLayout.LEADING,
                                                            extractOutputInput)
                                                    .add(org.jdesktop.layout.GroupLayout.LEADING, apkFileInput,
                                                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 562,
                                                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                                    .add(org.jdesktop.layout.GroupLayout.TRAILING, extractProgress,
                                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 639, Short.MAX_VALUE))
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(extractPanelLayout
                                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                            .add(extractButton).add(chooseOutputDir).add(chooseApkFile)
                                            .add(chooseZpakFile))))
                    .addContainerGap()));
    extractPanelLayout.setVerticalGroup(extractPanelLayout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(extractPanelLayout.createSequentialGroup().addContainerGap()
                    .add(extractInformation, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(18, 18, 18)
                    .add(extractPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(extractPanelLayout
                                    .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                    .add(apkFileInput, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(chooseApkFile))
                            .add(apkFileLabel))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(extractPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(extractPanelLayout
                                    .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                    .add(zpakFileInput, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(chooseZpakFile))
                            .add(zpakFileLabel))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(extractPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(extractPanelLayout
                                    .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                    .add(extractOutputInput, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(chooseOutputDir))
                            .add(extractOutputLabel))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 167, Short.MAX_VALUE)
                    .add(extractPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(extractProgress, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(extractButton))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(extractStatus, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 15,
                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap()));

    extractInformation.getAccessibleContext().setAccessibleName(bundle.getString("extractDirections")); // NOI18N

    tabbedPane.addTab("Extract", extractPanel);

    chooseData.setText(bundle.getString("convert.choose")); // NOI18N
    chooseData.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            chooseDataActionPerformed(evt);
        }
    });

    dataInput.setToolTipText(bundle.getString("convert.extracted_data.tooltip")); // NOI18N

    dataLabel.setText(bundle.getString("convert.extracted_data")); // NOI18N

    isoLabel.setText(bundle.getString("convert.iso_input")); // NOI18N

    chooseIso.setText(bundle.getString("convert.choose")); // NOI18N
    chooseIso.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            chooseIsoActionPerformed(evt);
        }
    });

    chooseIcon.setText("Change Icon");
    chooseIcon.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            chooseIconActionPerformed(evt);
        }
    });

    convertOutputLabel.setText(bundle.getString("convert.output_directory")); // NOI18N

    chooseConvertOutput.setText(bundle.getString("convert.choose")); // NOI18N
    chooseConvertOutput.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            chooseConvertOutputActionPerformed(evt);
        }
    });

    loadXmlButton.setText(bundle.getString("convert.load_xml")); // NOI18N
    loadXmlButton.setToolTipText(bundle.getString("common.disabled_control")); // NOI18N
    loadXmlButton.setEnabled(false);

    gameInformationLabel.setText(bundle.getString("convert.game_information")); // NOI18N

    titleIdLabel.setText(bundle.getString("convert.title_id")); // NOI18N

    titleIdInput.setToolTipText(bundle.getString("convert.title_id.tooltip")); // NOI18N

    nameInput.setToolTipText(bundle.getString("convert.name.tooltip")); // NOI18N

    nameLabel.setText(bundle.getString("convert.name")); // NOI18N

    developerInput.setToolTipText(bundle.getString("convert.developer.tooltip")); // NOI18N

    developerLabel.setText(bundle.getString("convert.developer")); // NOI18N

    publisherLabel.setText(bundle.getString("convert.publisher")); // NOI18N

    publisherInput.setToolTipText(bundle.getString("convert.publisher.tooltip")); // NOI18N

    descriptionLabel.setText("Description:");

    descriptionTextInput.setColumns(20);
    descriptionTextInput.setLineWrap(true);
    descriptionTextInput.setRows(5);
    descriptionTextInput.setWrapStyleWord(true);
    descriptionTextPane.setViewportView(descriptionTextInput);

    parentalRatingLabel.setText(bundle.getString("convert.parental_rating")); // NOI18N

    parentalRatingInput.setToolTipText(bundle.getString("convert.parental_rating.tooltip")); // NOI18N

    storeTypeLabel.setText(bundle.getString("convert.store_type")); // NOI18N

    storeTypeInput.setToolTipText(bundle.getString("convert.store_type.tooltip")); // NOI18N

    analogModeCheckbox.setText(bundle.getString("convert.analog_mode")); // NOI18N
    analogModeCheckbox.setToolTipText(bundle.getString("convert.analog_mode.tooltip")); // NOI18N

    convertButton.setText(bundle.getString("convert.convert")); // NOI18N
    convertButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            convertButtonActionPerformed(evt);
        }
    });

    getTitleIdButton.setText(bundle.getString("convert.get_title_id")); // NOI18N
    getTitleIdButton.setToolTipText(bundle.getString("common.disabled_control")); // NOI18N
    getTitleIdButton.setEnabled(false);

    iconImagePreview.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    org.jdesktop.layout.GroupLayout createPanelLayout = new org.jdesktop.layout.GroupLayout(createPanel);
    createPanel.setLayout(createPanelLayout);
    createPanelLayout.setHorizontalGroup(createPanelLayout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, createPanelLayout.createSequentialGroup()
                    .addContainerGap()
                    .add(createPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(org.jdesktop.layout.GroupLayout.LEADING, convertStatus,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 739, Short.MAX_VALUE)
                            .add(org.jdesktop.layout.GroupLayout.LEADING,
                                    createPanelLayout.createSequentialGroup().add(createPanelLayout
                                            .createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                                            .add(org.jdesktop.layout.GroupLayout.LEADING, createPanelLayout
                                                    .createSequentialGroup()
                                                    .add(createPanelLayout
                                                            .createParallelGroup(
                                                                    org.jdesktop.layout.GroupLayout.LEADING)
                                                            .add(isoLabel).add(dataLabel)
                                                            .add(convertOutputLabel))
                                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                                    .add(createPanelLayout
                                                            .createParallelGroup(
                                                                    org.jdesktop.layout.GroupLayout.LEADING)
                                                            .add(convertOutputInput,
                                                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                                    332, Short.MAX_VALUE)
                                                            .add(isoInput,
                                                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                                    332, Short.MAX_VALUE)
                                                            .add(dataInput,
                                                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                                    332, Short.MAX_VALUE))
                                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                                    .add(createPanelLayout
                                                            .createParallelGroup(
                                                                    org.jdesktop.layout.GroupLayout.LEADING)
                                                            .add(chooseData).add(chooseIso)
                                                            .add(chooseConvertOutput)))
                                            .add(org.jdesktop.layout.GroupLayout.LEADING, convertSeparator,
                                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 552,
                                                    Short.MAX_VALUE)
                                            .add(createPanelLayout.createSequentialGroup()
                                                    .add(gameInformationLabel)
                                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED,
                                                            123, Short.MAX_VALUE)
                                                    .add(getTitleIdButton)
                                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                                                    .add(loadXmlButton))
                                            .add(org.jdesktop.layout.GroupLayout.LEADING, createPanelLayout
                                                    .createSequentialGroup()
                                                    .add(createPanelLayout
                                                            .createParallelGroup(
                                                                    org.jdesktop.layout.GroupLayout.LEADING)
                                                            .add(nameLabel).add(developerLabel)
                                                            .add(descriptionLabel))
                                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                                    .add(createPanelLayout
                                                            .createParallelGroup(
                                                                    org.jdesktop.layout.GroupLayout.LEADING)
                                                            .add(descriptionTextPane,
                                                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                                    465, Short.MAX_VALUE)
                                                            .add(createPanelLayout.createSequentialGroup().add(
                                                                    nameInput,
                                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                                                    235,
                                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                                                    .addPreferredGap(
                                                                            org.jdesktop.layout.LayoutStyle.RELATED)
                                                                    .add(titleIdLabel)
                                                                    .addPreferredGap(
                                                                            org.jdesktop.layout.LayoutStyle.RELATED)
                                                                    .add(titleIdInput,
                                                                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                                            160, Short.MAX_VALUE))
                                                            .add(createPanelLayout.createSequentialGroup().add(
                                                                    developerInput,
                                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                                                    149,
                                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                                                    .addPreferredGap(
                                                                            org.jdesktop.layout.LayoutStyle.RELATED)
                                                                    .add(publisherLabel)
                                                                    .addPreferredGap(
                                                                            org.jdesktop.layout.LayoutStyle.RELATED)
                                                                    .add(publisherInput,
                                                                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                                            238, Short.MAX_VALUE)))))
                                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                            .add(createPanelLayout
                                                    .createParallelGroup(
                                                            org.jdesktop.layout.GroupLayout.LEADING)
                                                    .add(iconImagePreview,
                                                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 175,
                                                            Short.MAX_VALUE)
                                                    .add(createPanelLayout
                                                            .createParallelGroup(
                                                                    org.jdesktop.layout.GroupLayout.LEADING,
                                                                    false)
                                                            .add(org.jdesktop.layout.GroupLayout.TRAILING,
                                                                    chooseIcon,
                                                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                                    Short.MAX_VALUE)
                                                            .add(parentalRatingLabel).add(parentalRatingInput)
                                                            .add(storeTypeLabel).add(storeTypeInput))
                                                    .add(analogModeCheckbox,
                                                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 174,
                                                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                            .add(createPanelLayout.createSequentialGroup()
                                    .add(convertProgress, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 637,
                                            Short.MAX_VALUE)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(convertButton)
                                    .add(2, 2, 2)))
                    .addContainerGap()));
    createPanelLayout.setVerticalGroup(createPanelLayout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(createPanelLayout.createSequentialGroup().addContainerGap().add(createPanelLayout
                    .createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(createPanelLayout.createSequentialGroup()
                            .add(createPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(createPanelLayout
                                            .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                            .add(chooseData).add(dataInput,
                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                    .add(dataLabel))
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                            .add(createPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(createPanelLayout
                                            .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                            .add(isoInput, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                            .add(chooseIso))
                                    .add(isoLabel))
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                            .add(createPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(convertOutputLabel)
                                    .add(createPanelLayout
                                            .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                            .add(convertOutputInput,
                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                            .add(chooseConvertOutput)))
                            .add(18, 18, 18)
                            .add(convertSeparator, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 10,
                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 12, Short.MAX_VALUE)
                            .add(createPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                    .add(loadXmlButton).add(gameInformationLabel).add(getTitleIdButton)))
                    .add(iconImagePreview, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 177, Short.MAX_VALUE))
                    .add(18, 18, 18)
                    .add(createPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(titleIdInput, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(titleIdLabel)
                            .add(nameInput, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(chooseIcon).add(nameLabel))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(createPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(createPanelLayout.createSequentialGroup().add(parentalRatingLabel)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(parentalRatingInput, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(storeTypeLabel)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(storeTypeInput, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(analogModeCheckbox))
                            .add(createPanelLayout.createSequentialGroup().add(createPanelLayout
                                    .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(developerLabel)
                                    .add(developerInput, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(publisherLabel).add(publisherInput,
                                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                    .add(18, 18, 18)
                                    .add(createPanelLayout
                                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                            .add(descriptionTextPane,
                                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 93,
                                                    Short.MAX_VALUE)
                                            .add(descriptionLabel))))
                    .add(18, 18, 18)
                    .add(createPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(convertButton)
                            .add(convertProgress, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(convertStatus, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 14,
                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap()));

    tabbedPane.addTab("Convert", createPanel);

    org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(tabbedPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 800, Short.MAX_VALUE));
    layout.setVerticalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                    .add(tabbedPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 528, Short.MAX_VALUE)
                    .addContainerGap()));

    pack();
}

From source file:stratego.neural.net.StrategoNeuralNet.java

private static void plotDataSet(List<NamedDataSet> ArraySetList, String network_name) {

    String plot_title = "Plot " + plotIndex + ": Overfitting on network " + network_name;
    XYSeriesCollection plotData = new XYSeriesCollection();

    for (NamedDataSet ns : ArraySetList) {
        XYSeries series = new XYSeries(ns.getName());
        double[] data = ns.getArray();
        for (int i = 0; i < data.length; i++) {
            series.add((double) i, data[i]);
        }// w w w.  j  ava2 s  .  c o  m

        plotData.addSeries(series);
    }

    String title = plot_title;
    String xAxisLabel = "Epochs";
    String yAxisLabel = "Accuracy";
    PlotOrientation orientation = PlotOrientation.VERTICAL;
    boolean legend = true; // might wanna set this to true at some point, but research the library
    boolean tooltips = false;
    boolean urls = false;
    JFreeChart chart = ChartFactory.createScatterPlot(title, xAxisLabel, yAxisLabel, plotData, orientation,
            legend, tooltips, urls);

    JPanel panel = new ChartPanel(chart);

    JFrame f = new JFrame();
    f.add(panel);
    f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    f.pack();
    f.setTitle(plot_title);

    f.setVisible(true);

    plotIndex++; // increase the plotindex
}

From source file:br.unicamp.cst.util.MindViewer.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./*www. j  a  v  a  2  s . c om*/
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;

    pnSimulationControl = new javax.swing.JPanel();
    lblRefreshTime = new javax.swing.JLabel();
    txtRefreshTime = new javax.swing.JFormattedTextField();
    btnPlus = new javax.swing.JButton();
    btnMinus = new javax.swing.JButton();
    tbControl = new javax.swing.JTabbedPane();
    jspMainSplit = new javax.swing.JSplitPane();
    splMainChart = new javax.swing.JSplitPane();
    pnMindEntities = new javax.swing.JPanel();
    cbRefreshMindsEntities = new javax.swing.JCheckBox();
    jtpMindsEntities = new javax.swing.JTabbedPane();
    jspMindsEntities = new javax.swing.JScrollPane();
    pnChart = new javax.swing.JPanel();
    cbRefreshChart = new javax.swing.JCheckBox();
    pnCodelets = new javax.swing.JPanel();
    sdChart = new javax.swing.JSlider();
    tbModules = new javax.swing.JTabbedPane();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setMinimumSize(new java.awt.Dimension(800, 600));
    setSize(new java.awt.Dimension(1024, 768));
    getContentPane().setLayout(new java.awt.GridBagLayout());

    lblRefreshTime.setText("Refresh Time (ms):");

    txtRefreshTime.setEditable(false);
    txtRefreshTime.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(
            new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));
    txtRefreshTime.setText("100");
    txtRefreshTime.setToolTipText("");
    txtRefreshTime.setEnabled(false);

    btnPlus.setText("+");
    btnPlus.setMargin(new java.awt.Insets(0, 0, 0, 0));
    btnPlus.setMaximumSize(new java.awt.Dimension(25, 25));
    btnPlus.setMinimumSize(new java.awt.Dimension(25, 25));
    btnPlus.setPreferredSize(new java.awt.Dimension(25, 25));
    btnPlus.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnPlusActionPerformed(evt);
        }
    });

    btnMinus.setText("-");
    btnMinus.setMargin(new java.awt.Insets(0, 0, 0, 0));
    btnMinus.setMaximumSize(new java.awt.Dimension(25, 25));
    btnMinus.setMinimumSize(new java.awt.Dimension(25, 25));
    btnMinus.setPreferredSize(new java.awt.Dimension(25, 25));
    btnMinus.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnMinusActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout pnSimulationControlLayout = new javax.swing.GroupLayout(pnSimulationControl);
    pnSimulationControl.setLayout(pnSimulationControlLayout);
    pnSimulationControlLayout.setHorizontalGroup(
            pnSimulationControlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnSimulationControlLayout.createSequentialGroup().addContainerGap()
                            .addComponent(lblRefreshTime)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(txtRefreshTime, javax.swing.GroupLayout.PREFERRED_SIZE, 150,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(btnPlus, javax.swing.GroupLayout.PREFERRED_SIZE, 25,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(btnMinus, javax.swing.GroupLayout.PREFERRED_SIZE, 25,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addContainerGap(417, Short.MAX_VALUE)));
    pnSimulationControlLayout.setVerticalGroup(
            pnSimulationControlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnSimulationControlLayout.createSequentialGroup().addContainerGap()
                            .addGroup(pnSimulationControlLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(btnPlus, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(pnSimulationControlLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(lblRefreshTime).addComponent(txtRefreshTime,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addComponent(btnMinus, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.weightx = 0.1;
    getContentPane().add(pnSimulationControl, gridBagConstraints);

    jspMainSplit.setDividerLocation(220);
    jspMainSplit.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);

    splMainChart.setDividerLocation(400);

    pnMindEntities.setMinimumSize(new java.awt.Dimension(0, 0));
    pnMindEntities.setLayout(new java.awt.GridBagLayout());

    cbRefreshMindsEntities.setSelected(true);
    cbRefreshMindsEntities.setText("Auto Refresh");
    cbRefreshMindsEntities.setToolTipText("");
    cbRefreshMindsEntities.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            cbRefreshMindsEntitiesActionPerformed(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    pnMindEntities.add(cbRefreshMindsEntities, gridBagConstraints);

    jtpMindsEntities.addTab("Mind's Memories", jspMindsEntities);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.ipadx = 161;
    gridBagConstraints.ipady = 197;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.weightx = 0.1;
    gridBagConstraints.weighty = 0.1;
    gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 2);
    pnMindEntities.add(jtpMindsEntities, gridBagConstraints);

    splMainChart.setLeftComponent(pnMindEntities);
    pnMindEntities.getAccessibleContext().setAccessibleName("");

    pnChart.setMinimumSize(new java.awt.Dimension(0, 0));
    pnChart.setName(""); // NOI18N
    pnChart.setLayout(new java.awt.GridBagLayout());

    cbRefreshChart.setSelected(true);
    cbRefreshChart.setText("Auto Refresh");
    cbRefreshChart.setToolTipText("");
    cbRefreshChart.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            cbRefreshChartActionPerformed(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
    pnChart.add(cbRefreshChart, gridBagConstraints);

    pnCodelets.setBackground(new java.awt.Color(102, 102, 102));

    javax.swing.GroupLayout pnCodeletsLayout = new javax.swing.GroupLayout(pnCodelets);
    pnCodelets.setLayout(pnCodeletsLayout);
    pnCodeletsLayout.setHorizontalGroup(pnCodeletsLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 366, Short.MAX_VALUE));
    pnCodeletsLayout.setVerticalGroup(pnCodeletsLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 177, Short.MAX_VALUE));

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.gridheight = java.awt.GridBagConstraints.RELATIVE;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 0.1;
    gridBagConstraints.weighty = 10.0;
    pnChart.add(pnCodelets, gridBagConstraints);

    sdChart.setToolTipText("");
    sdChart.setValue(100);
    sdChart.addChangeListener(new javax.swing.event.ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent evt) {
            sdChartStateChanged(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 15;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.PAGE_END;
    gridBagConstraints.weightx = 0.1;
    gridBagConstraints.weighty = 0.1;
    pnChart.add(sdChart, gridBagConstraints);

    splMainChart.setRightComponent(pnChart);

    jspMainSplit.setTopComponent(splMainChart);

    tbModules.setMinimumSize(new java.awt.Dimension(0, 0));
    jspMainSplit.setRightComponent(tbModules);
    tbModules.getAccessibleContext().setAccessibleName("Motivational Subsystem");
    tbModules.getAccessibleContext().setAccessibleDescription("");

    tbControl.addTab("Mind's Entities", jspMainSplit);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.weightx = 0.1;
    gridBagConstraints.weighty = 0.1;
    getContentPane().add(tbControl, gridBagConstraints);

    pack();
}

From source file:teambootje.A1.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.//www  . j  ava2  s.c  om
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0,
            400, Short.MAX_VALUE));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 300,
            Short.MAX_VALUE));

    pack();
}

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

    jPanelCliente = new javax.swing.JPanel();
    listaClientes = new javax.swing.JComboBox();
    jlNombre = new javax.swing.JLabel();
    jlDireccion = new javax.swing.JLabel();
    jlTlf = new javax.swing.JLabel();
    jlComentarios = new javax.swing.JLabel();
    jScrollPane1 = new javax.swing.JScrollPane();
    listaCorreos = new javax.swing.JTextArea();
    bCerrar = new javax.swing.JButton();
    bFoto = new javax.swing.JButton();
    bEnviar = new javax.swing.JButton();
    jSeparator1 = new javax.swing.JSeparator();
    cbEmail = new javax.swing.JCheckBox();
    jScrollPane2 = new javax.swing.JScrollPane();
    txtBody = new javax.swing.JTextArea();
    jScrollPane = new javax.swing.JScrollPane();
    jPanelPrincipal = new javax.swing.JPanel();
    jPanel1 = new javax.swing.JPanel();
    jPanel2 = new javax.swing.JPanel();
    jPanel3 = new javax.swing.JPanel();
    jPanel4 = new javax.swing.JPanel();
    jPanel5 = new javax.swing.JPanel();
    jPanel6 = new javax.swing.JPanel();
    jPanel7 = new javax.swing.JPanel();
    jPanel8 = new javax.swing.JPanel();
    jPanel9 = new javax.swing.JPanel();
    jPanel10 = new javax.swing.JPanel();
    jPanel11 = new javax.swing.JPanel();
    jPanel12 = new javax.swing.JPanel();
    jPanel13 = new javax.swing.JPanel();
    jPanel14 = new javax.swing.JPanel();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setPreferredSize(new java.awt.Dimension(1280, 750));

    listaClientes.setModel(
            new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

    jlNombre.setText("Nombre");

    jlDireccion.setText("Direccin");

    jlTlf.setText("Telfonos");

    jlComentarios.setText("Comentarios");

    listaCorreos.setColumns(20);
    listaCorreos.setRows(5);
    jScrollPane1.setViewportView(listaCorreos);

    bCerrar.setText("CERRAR");
    bCerrar.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            bCerrarActionPerformed(evt);
        }
    });

    bFoto.setText("FOTO");

    bEnviar.setText("ENVIAR");

    cbEmail.setText("Personalizar cuerpo del e-mail");
    cbEmail.addItemListener(new java.awt.event.ItemListener() {
        public void itemStateChanged(java.awt.event.ItemEvent evt) {
            cbEmailItemStateChanged(evt);
        }
    });

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

    javax.swing.GroupLayout jPanelClienteLayout = new javax.swing.GroupLayout(jPanelCliente);
    jPanelCliente.setLayout(jPanelClienteLayout);
    jPanelClienteLayout.setHorizontalGroup(jPanelClienteLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(bCerrar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                    Short.MAX_VALUE)
            .addGroup(
                    jPanelClienteLayout.createSequentialGroup().addContainerGap().addGroup(jPanelClienteLayout
                            .createParallelGroup(
                                    javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanelClienteLayout.createSequentialGroup()
                                    .addComponent(bFoto, javax.swing.GroupLayout.PREFERRED_SIZE, 90,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 42,
                                            Short.MAX_VALUE)
                                    .addComponent(
                                            bEnviar, javax.swing.GroupLayout.PREFERRED_SIZE, 90,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                    jPanelClienteLayout.createSequentialGroup().addGroup(jPanelClienteLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(jScrollPane2,
                                                    javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(cbEmail, javax.swing.GroupLayout.Alignment.LEADING,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(listaClientes,
                                                    javax.swing.GroupLayout.Alignment.LEADING, 0,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(jlNombre, javax.swing.GroupLayout.Alignment.LEADING,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(jlDireccion,
                                                    javax.swing.GroupLayout.Alignment.LEADING,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(jlTlf, javax.swing.GroupLayout.Alignment.LEADING,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(
                                                    jlComentarios, javax.swing.GroupLayout.Alignment.LEADING,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(jScrollPane1,
                                                    javax.swing.GroupLayout.Alignment.LEADING))
                                            .addContainerGap())
                            .addComponent(jSeparator1))));
    jPanelClienteLayout.setVerticalGroup(jPanelClienteLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelClienteLayout.createSequentialGroup()
                    .addComponent(listaClientes, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18).addComponent(jlNombre)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(jlDireccion)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(jlTlf)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(jlComentarios).addGap(18, 18, 18)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 150,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18).addComponent(cbEmail)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 129, Short.MAX_VALUE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(
                            jPanelClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(bFoto, javax.swing.GroupLayout.PREFERRED_SIZE, 90,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(bEnviar, javax.swing.GroupLayout.PREFERRED_SIZE, 90,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18).addComponent(bCerrar, javax.swing.GroupLayout.PREFERRED_SIZE, 40,
                            javax.swing.GroupLayout.PREFERRED_SIZE)));

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 300, Short.MAX_VALUE));
    jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE));

    javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(jPanel2Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE));
    jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE));

    javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
    jPanel3.setLayout(jPanel3Layout);
    jPanel3Layout.setHorizontalGroup(jPanel3Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE));
    jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE));

    javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
    jPanel4.setLayout(jPanel4Layout);
    jPanel4Layout.setHorizontalGroup(jPanel4Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 300, Short.MAX_VALUE));
    jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 300, Short.MAX_VALUE));

    javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
    jPanel5.setLayout(jPanel5Layout);
    jPanel5Layout.setHorizontalGroup(jPanel5Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 300, Short.MAX_VALUE));
    jPanel5Layout.setVerticalGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 300, Short.MAX_VALUE));

    javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
    jPanel6.setLayout(jPanel6Layout);
    jPanel6Layout.setHorizontalGroup(jPanel6Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 300, Short.MAX_VALUE));
    jPanel6Layout.setVerticalGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 300, Short.MAX_VALUE));

    javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
    jPanel7.setLayout(jPanel7Layout);
    jPanel7Layout.setHorizontalGroup(jPanel7Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 300, Short.MAX_VALUE));
    jPanel7Layout.setVerticalGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 300, Short.MAX_VALUE));

    javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
    jPanel8.setLayout(jPanel8Layout);
    jPanel8Layout.setHorizontalGroup(jPanel8Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 300, Short.MAX_VALUE));
    jPanel8Layout.setVerticalGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 300, Short.MAX_VALUE));

    javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
    jPanel9.setLayout(jPanel9Layout);
    jPanel9Layout.setHorizontalGroup(jPanel9Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 300, Short.MAX_VALUE));
    jPanel9Layout.setVerticalGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 300, Short.MAX_VALUE));

    javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
    jPanel10.setLayout(jPanel10Layout);
    jPanel10Layout.setHorizontalGroup(jPanel10Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 300, Short.MAX_VALUE));
    jPanel10Layout.setVerticalGroup(jPanel10Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 300, Short.MAX_VALUE));

    javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
    jPanel11.setLayout(jPanel11Layout);
    jPanel11Layout.setHorizontalGroup(jPanel11Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 300, Short.MAX_VALUE));
    jPanel11Layout.setVerticalGroup(jPanel11Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 300, Short.MAX_VALUE));

    javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
    jPanel12.setLayout(jPanel12Layout);
    jPanel12Layout.setHorizontalGroup(jPanel12Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 300, Short.MAX_VALUE));
    jPanel12Layout.setVerticalGroup(jPanel12Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 300, Short.MAX_VALUE));

    javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
    jPanel13.setLayout(jPanel13Layout);
    jPanel13Layout.setHorizontalGroup(jPanel13Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 300, Short.MAX_VALUE));
    jPanel13Layout.setVerticalGroup(jPanel13Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 300, Short.MAX_VALUE));

    javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
    jPanel14.setLayout(jPanel14Layout);
    jPanel14Layout.setHorizontalGroup(jPanel14Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 300, Short.MAX_VALUE));
    jPanel14Layout.setVerticalGroup(jPanel14Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 300, Short.MAX_VALUE));

    javax.swing.GroupLayout jPanelPrincipalLayout = new javax.swing.GroupLayout(jPanelPrincipal);
    jPanelPrincipal.setLayout(jPanelPrincipalLayout);
    jPanelPrincipalLayout.setHorizontalGroup(
            jPanelPrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelPrincipalLayout.createSequentialGroup()
                            .addGroup(jPanelPrincipalLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addGap(18, 18, 18)
                            .addGroup(jPanelPrincipalLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jPanel3, 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))
                            .addGap(18, 18, 18)
                            .addGroup(jPanelPrincipalLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanelPrincipalLayout.createSequentialGroup()
                                            .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(18, 18, 18)
                                            .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(18, 18, 18)
                                            .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(18, 18, 18)
                                            .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(18, 18, 18).addComponent(jPanel13,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanelPrincipalLayout.createSequentialGroup()
                                            .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(18, 18, 18)
                                            .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(18, 18, 18)
                                            .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(18, 18, 18)
                                            .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(18, 18, 18).addComponent(jPanel14,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGap(0, 371, Short.MAX_VALUE)));
    jPanelPrincipalLayout.setVerticalGroup(jPanelPrincipalLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelPrincipalLayout.createSequentialGroup().addGroup(jPanelPrincipalLayout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelPrincipalLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanel13, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addGroup(jPanelPrincipalLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanelPrincipalLayout
                                    .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))
                            .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(0, 37, Short.MAX_VALUE)));

    jScrollPane.setViewportView(jPanelPrincipal);

    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(jPanelCliente, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(jScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 1205, Short.MAX_VALUE)
                    .addContainerGap()));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addContainerGap()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanelCliente, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 0,
                                    Short.MAX_VALUE))
                    .addContainerGap()));

    pack();
}

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

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner Evaluation license - Gary Lee
    scrollPane1 = new JScrollPane();
    list1 = new JList();
    button1 = new JButton();
    label2 = new JLabel();
    button2 = new JButton();
    button3 = new JButton();
    button4 = new JButton();
    button5 = new JButton();
    scrollPane2 = new JScrollPane();
    xImagePanel1 = new JXImagePanel();
    button6 = new JButton();
    button7 = new JButton();
    button8 = new JButton();

    //======== this ========
    setTitle("Welcome to OpenByte");
    setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    setResizable(false);//from www .j av a2s.c  o m
    Container contentPane = getContentPane();
    contentPane.setLayout(null);

    //======== scrollPane1 ========
    {
        scrollPane1.setBorder(new TitledBorder(LineBorder.createGrayLineBorder(), "Recent Projects"));

        //---- list1 ----
        list1.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        list1.setBackground(new Color(240, 240, 240));
        list1.addListSelectionListener(new ListSelectionListener() {
            @Override
            public void valueChanged(ListSelectionEvent e) {
                list1ValueChanged(e);
            }
        });
        scrollPane1.setViewportView(list1);
    }
    contentPane.add(scrollPane1);
    scrollPane1.setBounds(15, 10, 165, 340);

    //---- button1 ----
    button1.setText("Open Project");
    button1.setEnabled(false);
    button1.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            button1ActionPerformed(e);
        }
    });
    contentPane.add(button1);
    button1.setBounds(105, 355, 110, button1.getPreferredSize().height);

    //---- label2 ----
    label2.setText("Media");
    contentPane.add(label2);
    label2.setBounds(new Rectangle(new Point(605, 210), label2.getPreferredSize()));

    //---- button2 ----
    button2.setText("Minecraft Forums");
    button2.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            button2ActionPerformed(e);
        }
    });
    contentPane.add(button2);
    button2.setBounds(500, 230, 151, button2.getPreferredSize().height);

    //---- button3 ----
    button3.setText("GitHub");
    button3.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            button3ActionPerformed(e);
        }
    });
    contentPane.add(button3);
    button3.setBounds(500, 260, 150, button3.getPreferredSize().height);

    //---- button4 ----
    button4.setText("+");
    button4.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            button4ActionPerformed(e);
        }
    });
    contentPane.add(button4);
    button4.setBounds(15, 355, 45, button4.getPreferredSize().height);

    //---- button5 ----
    button5.setText("-");
    button5.setEnabled(false);
    button5.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            button5ActionPerformed(e);
        }
    });
    contentPane.add(button5);
    button5.setBounds(60, 355, 40, button5.getPreferredSize().height);

    //======== scrollPane2 ========
    {
        scrollPane2.setBorder(null);
        scrollPane2.setViewportView(xImagePanel1);
    }
    contentPane.add(scrollPane2);
    scrollPane2.setBounds(210, 25, 445, 160);

    //---- button6 ----
    button6.setText("Preferences");
    button6.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            button6ActionPerformed(e);
        }
    });
    contentPane.add(button6);
    button6.setBounds(500, 290, 150, 30);

    //---- button7 ----
    button7.setText("About");
    button7.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            button7ActionPerformed(e);
        }
    });
    contentPane.add(button7);
    button7.setBounds(500, 320, 150, 30);

    //---- button8 ----
    button8.setText("Plugins");
    button8.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            button8ActionPerformed(e);
        }
    });
    contentPane.add(button8);
    button8.setBounds(500, 350, 150, 30);

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

From source file:gtu._work.etc.EnglishTester.java

private void initGUI() {
    try {//from  w  w  w  .  j a v a2 s.c  o m
        JCommonUtil.defaultToolTipDelay();
        BorderLayout thisLayout = new BorderLayout();
        getContentPane().setLayout(thisLayout);
        this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        {
            jTabbedPane1 = new JTabbedPane();
            getContentPane().add(jTabbedPane1, BorderLayout.CENTER);
            jTabbedPane1.setPreferredSize(new java.awt.Dimension(462, 259));

            jTabbedPane1.addMouseListener(new MouseAdapter() {
                public void mouseClicked(MouseEvent evt) {
                    // XXX
                    // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx
                    jTabbedPane1.requestFocus();// FOCUS TODO
                    // XXX
                    // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx
                }
            });
            jTabbedPane1.addKeyListener(new KeyAdapter() {
                public void keyPressed(KeyEvent evt) {
                    System.out.println("2===" + evt.getKeyCode());
                    if (evt.getKeyCode() == 49) {// 0
                        jTabbedPane1.setSelectedIndex(0);
                    }
                    if (evt.getKeyCode() == 50) {// 1
                        jTabbedPane1.setSelectedIndex(1);
                    }
                    if (evt.getKeyCode() == 10) {// enter
                        skipBtnAction();
                    }
                    if (evt.getKeyCode() == 32) {// 
                        removeBtnAction();
                    }
                }
            });
            {
                jPanel1 = new JPanel();
                BorderLayout jPanel1Layout = new BorderLayout();
                jPanel1.setLayout(jPanel1Layout);
                jTabbedPane1.addTab("english", null, jPanel1, null);
                {
                    jScrollPane1 = new JScrollPane();
                    jPanel1.add(jScrollPane1, BorderLayout.CENTER);
                    jScrollPane1.setPreferredSize(new java.awt.Dimension(420, 141));
                    {
                        englishArea = new JTextArea();
                        jScrollPane1.setViewportView(englishArea);
                        englishArea.setFont(new java.awt.Font("Microsoft JhengHei", 0, 22));
                    }
                }
                {
                    jPanel5 = new JPanel();
                    jPanel1.add(jPanel5, BorderLayout.SOUTH);
                    jPanel5.setPreferredSize(new java.awt.Dimension(402, 65));
                    {
                        skipBtn = new JButton();
                        jPanel5.add(skipBtn);
                        skipBtn.setText("skip");
                        skipBtn.setPreferredSize(new java.awt.Dimension(187, 24));
                        skipBtn.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent evt) {
                                skipBtnAction();
                            }
                        });
                    }
                    {
                        removeBtn = new JButton();
                        jPanel5.add(removeBtn);
                        removeBtn.setText("remove");
                        removeBtn.setPreferredSize(new java.awt.Dimension(180, 24));
                        removeBtn.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent evt) {
                                removeBtnAction();
                            }
                        });
                    }
                    {
                        questionCountLabel = new JLabel();
                        jPanel5.add(questionCountLabel);
                        questionCountLabel.setPreferredSize(new java.awt.Dimension(47, 21));
                        questionCountLabel.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
                        questionCountLabel.setToolTipText("");
                    }
                    {
                        propCountLabel = new JLabel();
                        jPanel5.add(propCountLabel);
                        propCountLabel.setPreferredSize(new java.awt.Dimension(45, 21));
                        propCountLabel.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
                        propCountLabel.setToolTipText("");
                    }
                    {
                        googleSearchBtn = new JButton();
                        jPanel5.add(googleSearchBtn);
                        googleSearchBtn.setText("<html>GPic</html>");
                        googleSearchBtn.setPreferredSize(new java.awt.Dimension(58, 24));
                        googleSearchBtn.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent evt) {
                                try {
                                    String word = currentWordIndex.trim();
                                    ClipboardUtil.getInstance().setContents(word);
                                    word = word.replace(" ", "%20");
                                    URI uri = new URI(
                                            "https://www.google.com.tw/search?num=10&hl=zh-TW&site=imghp&tbm=isch&source=hp&biw=1280&bih=696&q="
                                                    + word);
                                    //URI uri = new URI("http://image.baidu.com/search/index?tn=baiduimage&ps=1&ct=201326592&lm=-1&cl=2&nc=1&ie=utf-8&word=" + word);
                                    Desktop.getDesktop().browse(uri);
                                } catch (Exception ex) {
                                    JCommonUtil.handleException(ex);
                                }
                            }
                        });
                    }
                    {
                        yahooDicBtn = new JButton();
                        jPanel5.add(yahooDicBtn);
                        yahooDicBtn.setText("<html>Dict</html>");
                        yahooDicBtn.setPreferredSize(new java.awt.Dimension(57, 24));
                        yahooDicBtn.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent evt) {
                                try {
                                    // URI uri = new
                                    // URI("http://tw.dictionary.yahoo.com/dictionary?p="
                                    // + currentWord.trim());
                                    URI uri = new URI("http://www.dreye.com/axis/ddict.jsp?ver=big5&dod=0102&w="
                                            + currentWordIndex.trim() + "&x=0&y=0");
                                    Desktop.getDesktop().browse(uri);
                                } catch (Exception ex) {
                                    JCommonUtil.handleException(ex);
                                }
                            }
                        });
                    }
                    {
                        pickBtn = new JButton();
                        jPanel5.add(pickBtn);
                        pickBtn.setText("<html>+Pick</html>");
                        pickBtn.setPreferredSize(new java.awt.Dimension(60, 24));
                        pickBtn.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent evt) {
                                try {
                                    String key = currentWordIndex;
                                    String value = englishProp.getProperty(currentWordIndex);
                                    if (StringUtils.isEmpty(value)) {
                                        JCommonUtil._jOptionPane_showMessageDialog_error(
                                                "add pick failed : no such word => " + key);
                                    } else {
                                        pickProp.setProperty(key, value);
                                        JCommonUtil._jOptionPane_showMessageDialog_info(
                                                "key=" + key + "\nvalue=" + value + "\nsize=" + pickProp.size(),
                                                "??");
                                    }
                                } catch (Exception ex) {
                                    JCommonUtil.handleException(ex);
                                }
                            }
                        });
                    }
                    {
                        scanPicBtn = new JButton();
                        scanPicBtn.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent e) {
                            }
                        });
                        jPanel5.add(scanPicBtn);
                        scanPicBtn.setPreferredSize(new java.awt.Dimension(46, 24));
                        scanPicBtn.addMouseListener(new MouseAdapter() {

                            public void mouseClicked(MouseEvent evt) {
                                if (picDir == null) {
                                    JCommonUtil._jOptionPane_showMessageDialog_error("picDir is null");
                                    return;
                                }

                                if (picSet != null && picSet.size() > 0) {
                                    try {
                                        Desktop.getDesktop().open(picSet.iterator().next());
                                    } catch (IOException e) {
                                        JCommonUtil.handleException(e);
                                    }
                                    return;
                                }

                                try {
                                    String text = currentWordIndex.trim().toLowerCase();
                                    ClipboardUtil.getInstance().setContents(text);
                                    text = text.replace(" ", "%20");
                                    URI uri = new URI(
                                            "https://www.google.com.tw/search?num=10&hl=zh-TW&site=imghp&tbm=isch&source=hp&biw=1280&bih=696&q="
                                                    + text);
                                    //URI uri = new URI("http://image.baidu.com/search/index?tn=baiduimage&ps=1&ct=201326592&lm=-1&cl=2&nc=1&ie=utf-8&word=" + text);
                                    Desktop.getDesktop().browse(uri);
                                } catch (Exception ex) {
                                    JCommonUtil.handleException(ex);
                                }
                            }
                        });
                    }
                    {
                        showChineseOption = new JCheckBox();
                        showChineseOption.setSelected(true);
                        jPanel5.add(showChineseOption);
                    }
                }
            }
            {
                jPanel2 = new JPanel();
                BorderLayout jPanel2Layout = new BorderLayout();
                jPanel2.setLayout(jPanel2Layout);
                jTabbedPane1.addTab("chinese", null, jPanel2, null);
                jPanel2.setPreferredSize(new java.awt.Dimension(420, 211));
                {
                    showEnglishText = new JTextField();
                    jPanel2.add(showEnglishText, BorderLayout.NORTH);
                    showEnglishText.setEditable(false);
                }
                {
                    jPanel10 = new JPanel();
                    jPanel2.add(jPanel10, BorderLayout.CENTER);
                }
                {
                    answerBtn[0] = new JButton();
                    jPanel10.add(answerBtn[0]);
                    answerBtn[0].setPreferredSize(new java.awt.Dimension(190, 110));
                    answerBtn[0].addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            answerBtnClick(answerBtn[0]);
                        }
                    });
                }
                {
                    answerBtn[1] = new JButton();
                    jPanel10.add(answerBtn[1]);
                    answerBtn[1].setPreferredSize(new java.awt.Dimension(190, 110));
                    answerBtn[1].addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            answerBtnClick(answerBtn[1]);
                        }
                    });
                }
                {
                    answerBtn[2] = new JButton();
                    jPanel10.add(answerBtn[2]);
                    answerBtn[2].setPreferredSize(new java.awt.Dimension(190, 110));
                    answerBtn[2].addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            answerBtnClick(answerBtn[2]);
                        }
                    });
                }
                {
                    answerBtn[3] = new JButton();
                    jPanel10.add(answerBtn[3]);
                    answerBtn[3].setPreferredSize(new java.awt.Dimension(190, 110));
                    answerBtn[3].addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            answerBtnClick(answerBtn[3]);
                        }
                    });
                }
                {
                    for (int ii = 0; ii < 4; ii++) {
                        answerBtn[ii].setFont(new java.awt.Font("", 0, 14));
                    }
                }
            }
            {
                jPanel3 = new JPanel();
                BorderLayout jPanel3Layout = new BorderLayout();
                jPanel3.setLayout(jPanel3Layout);
                jTabbedPane1.addTab("word", null, jPanel3, null);
                {
                    jScrollPane3 = new JScrollPane();
                    jPanel3.add(jScrollPane3, BorderLayout.CENTER);
                    jScrollPane3.setPreferredSize(new java.awt.Dimension(420, 187));
                    {
                        propTable = new JTable();
                        jScrollPane3.setViewportView(propTable);
                        JTableUtil.defaultSetting(propTable);
                        propTable.addMouseListener(new MouseAdapter() {
                            public void mouseClicked(MouseEvent evt) {
                                JPopupMenuUtil.newInstance(propTable)
                                        .addJMenuItem(JTableUtil.newInstance(propTable).getDefaultJMenuItems())
                                        .applyEvent(evt).show();
                            }
                        });
                    }
                }
                {
                    saveBtn = new JButton();
                    jPanel3.add(saveBtn, BorderLayout.SOUTH);
                    saveBtn.setText("save table");
                    saveBtn.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            DefaultTableModel model = JTableUtil.newInstance(propTable).getModel();
                            for (int ii = 0; ii < model.getRowCount(); ii++) {
                                String key = (String) model.getValueAt(ii, 0);
                                String value = (String) model.getValueAt(ii, 1);
                                if (!englishProp.containsKey(key)) {
                                    englishProp.setProperty(key, value);
                                }
                            }
                            try {
                                englishProp.store(new FileOutputStream(englishFile), "comment");
                            } catch (Exception e) {
                                e.printStackTrace();
                            }
                            JCommonUtil._jOptionPane_showMessageDialog_info("save file ok!  \n" + englishFile);
                        }
                    });
                }
                {
                    queryText = new JTextField();
                    jPanel3.add(queryText, BorderLayout.NORTH);
                    queryText.getDocument()
                            .addDocumentListener(JCommonUtil.getDocumentListener(new HandleDocumentEvent() {
                                @Override
                                public void process(DocumentEvent event) {
                                    String text = JCommonUtil.getDocumentText(event);
                                    Pattern pattern = Pattern.compile(text);
                                    Matcher matcher = null;
                                    DefaultTableModel propTableModel = JTableUtil.createModel(false, "english",
                                            "chinese");
                                    for (Enumeration<?> enu = englishProp.propertyNames(); enu
                                            .hasMoreElements();) {
                                        String key = (String) enu.nextElement();
                                        String value = englishProp.getProperty(key);
                                        if (key.contains(text)) {
                                            propTableModel.addRow(new Object[] { key, value });
                                            continue;
                                        }
                                        matcher = pattern.matcher(key);
                                        if (matcher.find()) {
                                            propTableModel.addRow(new Object[] { key, value });
                                            continue;
                                        }
                                    }
                                    propTable.setModel(propTableModel);
                                }
                            }));
                }
            }
            {
                jPanel4 = new JPanel();
                jTabbedPane1.addTab("config", null, jPanel4, null);
                {
                    savePickBtn = new JButton();
                    jPanel4.add(savePickBtn);
                    savePickBtn.setText("save pick");
                    savePickBtn.setPreferredSize(new java.awt.Dimension(116, 40));
                    savePickBtn.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            if (englishFile == null) {
                                File file = new File(//
                                        PropertiesUtil.getJarCurrentPath(EnglishTester.class),
                                        "temp.properties");
                                englishFile = file;
                            }
                            if (pickProp.isEmpty()) {
                                JCommonUtil._jOptionPane_showMessageDialog_error("?!");
                                return;
                            }
                            String fileName = englishFile.getName().replaceAll("\\.properties",
                                    "_bak.properties");
                            File jarWhereFile = PropertiesUtil.getJarCurrentPath(EnglishTester.class);
                            fileName = JCommonUtil._jOptionPane_showInputDialog("save target properties",
                                    fileName);
                            if (StringUtils.isEmpty(fileName)) {
                                JCommonUtil._jOptionPane_showMessageDialog_error("can't save!");
                                return;
                            }
                            if (fileName.equalsIgnoreCase(englishFile.getName())) {
                                JCommonUtil._jOptionPane_showMessageDialog_error(
                                        "??englishFile???");
                                return;
                            }
                            if (!fileName.endsWith(".properties")) {
                                fileName += ".properties";
                            }
                            File newFile = new File(jarWhereFile, fileName);
                            Properties oldProp = new Properties();
                            if (newFile.exists()) {
                                try {
                                    oldProp.load(new FileInputStream(newFile));
                                } catch (Exception e) {
                                    e.printStackTrace();
                                }
                            }
                            oldProp.putAll(pickProp);
                            try {
                                oldProp.store(new FileOutputStream(newFile), "comment");
                            } catch (Exception e) {
                                e.printStackTrace();
                            }
                            JCommonUtil._jOptionPane_showMessageDialog_info("save file ok!  \n" + newFile);
                        }
                    });
                }
                {
                    saveConfigBtn2 = new JButton();
                    jPanel4.add(saveConfigBtn2);
                    saveConfigBtn2.setText("save config");
                    saveConfigBtn2.setPreferredSize(new java.awt.Dimension(108, 40));
                    saveConfigBtn2.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            saveConfigBtnAction();
                        }
                    });
                }
                {
                    startAllBtn = new JButton();
                    jPanel4.add(startAllBtn);
                    startAllBtn.setText("start all");
                    startAllBtn.setPreferredSize(new java.awt.Dimension(101, 40));
                    startAllBtn.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            Object[] files = fileList.getSelectedValues();
                            if (files == null || files.length == 0) {
                                JCommonUtil
                                        ._jOptionPane_showMessageDialog_error("?properties");
                                return;
                            }
                            Properties allProp = new Properties();
                            Properties prop = new Properties();
                            for (Object ff : files) {
                                try {
                                    prop.load(new FileInputStream((File) ff));
                                } catch (Exception e) {
                                    JCommonUtil.handleException(e);
                                }
                                allProp.putAll(prop);
                            }
                            englishProp = allProp;
                            System.out.println("englishProp = " + englishProp.size());
                            startNow();
                        }
                    });
                }
                {
                    startNow = new JButton();
                    jPanel4.add(startNow);
                    startNow.setText("start now");
                    startNow.setPreferredSize(new java.awt.Dimension(101, 40));

                    startNow.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            startNow();
                        }
                    });
                }
                {
                    picOnly = new JCheckBox();
                    jPanel4.add(picOnly);
                    picOnly.setText("picOnly");
                }
                {
                    sortChkBox = new JCheckBox();
                    jPanel4.add(sortChkBox);
                    sortChkBox.setText("sort");
                }
                {
                    showPicChkBox = new JCheckBox();
                    showPicChkBox.setSelected(true);
                    jPanel4.add(showPicChkBox);
                    showPicChkBox.setText("showPic");
                }
                {
                    JCommonUtil.defaultToolTipDelay();
                    fontSizeSliber = new JSlider(JSlider.HORIZONTAL);
                    jPanel4.add(fontSizeSliber);
                    fontSizeSliber.setPreferredSize(new java.awt.Dimension(419, 35));
                    fontSizeSliber.setValue(22);
                    fontSizeSliber.setMinimum(22);
                    fontSizeSliber.setMaximum(300);
                    fontSizeSliber.setMajorTickSpacing(30);
                    fontSizeSliber.setMinorTickSpacing(5);
                    fontSizeSliber.setCursor(new Cursor(Cursor.HAND_CURSOR));
                    fontSizeSliber.setPaintTicks(false);
                    fontSizeSliber.setPaintLabels(true);
                    {
                        picFolderDirText = new JTextField();
                        JCommonUtil.jTextFieldSetFilePathMouseEvent(picFolderDirText, true);
                        jPanel4.add(picFolderDirText);
                        picFolderDirText.setColumns(20);
                    }
                    fontSizeSliber.addChangeListener(new ChangeListener() {
                        @Override
                        public void stateChanged(ChangeEvent e) {
                            int size = fontSizeSliber.getValue();
                            fontSizeSliber.setToolTipText("" + size);
                            englishArea.setFont(new java.awt.Font("Microsoft JhengHei", 0, size));
                        }
                    });

                }
            }
            {
                jPanel6 = new JPanel();
                jTabbedPane1.addTab("files", null, jPanel6, null);
                BorderLayout jPanel6Layout = new BorderLayout();
                jPanel6.setLayout(jPanel6Layout);
                {
                    jScrollPane4 = new JScrollPane();
                    jPanel6.add(jScrollPane4, BorderLayout.CENTER);
                    jScrollPane4.setPreferredSize(new java.awt.Dimension(420, 211));
                    {
                        fileList = new JList();
                        reloadFileList();
                        jScrollPane4.setViewportView(fileList);
                        fileList.addMouseListener(new MouseAdapter() {
                            public void mouseClicked(MouseEvent evt) {
                                final File file = JListUtil.getLeadSelectionObject(fileList);
                                if (JMouseEventUtil.buttonRightClick(1, evt)) {
                                    JPopupMenuUtil.newInstance(EnglishTester.this.fileList).applyEvent(evt)//
                                            .addJMenuItem("reload", new ActionListener() {
                                                @Override
                                                public void actionPerformed(ActionEvent e) {
                                                    reloadFileList();
                                                }
                                            })//
                                            .addJMenuItem("delete : " + file.getName(), new ActionListener() {
                                                @Override
                                                public void actionPerformed(ActionEvent e) {
                                                    boolean result = JCommonUtil
                                                            ._JOptionPane_showConfirmDialog_yesNoOption(
                                                                    "delete : " + file.getName() + " ?",
                                                                    "confirm");
                                                    if (result) {
                                                        file.delete();
                                                        reloadFileList();
                                                    }
                                                }//
                                            }).show();
                                    return;
                                }
                                if (evt.getClickCount() == 1) {
                                    return;
                                }
                                if (JCommonUtil._JOptionPane_showConfirmDialog_yesNoOption(
                                        "?,?\n" + file.getName(),
                                        "")) {
                                    loadEnglishFile(file);
                                }
                            }
                        });
                        fileList.addKeyListener(new KeyAdapter() {
                            public void keyPressed(KeyEvent evt) {
                                JListUtil.newInstance(fileList).defaultJListKeyPressed(evt);
                            }
                        });
                    }
                }
            }
            {
                jPanel9 = new JPanel();
                jTabbedPane1.addTab("pic", null, jPanel9, null);
                {
                    picCheckText = new JTextField();
                    jPanel9.add(picCheckText);
                    picCheckText.setPreferredSize(new java.awt.Dimension(177, 39));
                }
                {
                    picCheckBtn = new JButton();
                    jPanel9.add(picCheckBtn);
                    picCheckBtn.setText("check");
                    picCheckBtn.setPreferredSize(new java.awt.Dimension(98, 43));
                    {
                        jPanel11 = new JPanel();
                        jTabbedPane1.addTab("", null, jPanel11, null);
                        jPanel11.setLayout(new BorderLayout(0, 0));
                        {
                            inputTestArea2 = new JTextArea();
                            inputTestArea2.setFont(new Font("", Font.PLAIN, 12));
                            inputTestArea2.addKeyListener(new KeyAdapter() {
                                @Override
                                public void keyReleased(KeyEvent e) {
                                    inputTestTrainer.keyin(e);
                                }
                            });
                            jPanel11.add(inputTestArea2, BorderLayout.SOUTH);
                        }
                        {
                            inputTestArea1 = new JTextArea();
                            JTextAreaUtil.setWrapTextArea(inputTestArea1);
                            inputTestArea1.setFont(new Font("", Font.PLAIN, 22));
                            jPanel11.add(inputTestArea1, BorderLayout.CENTER);
                        }
                        {
                            panel = new JPanel();
                            jPanel11.add(panel, BorderLayout.NORTH);
                            {
                                inputTestLabel = new JLabel("");
                                panel.add(inputTestLabel);
                            }
                            {
                                inputTestChk = new JCheckBox("");
                                inputTestChk.addActionListener(new ActionListener() {
                                    public void actionPerformed(ActionEvent e) {
                                        inputTestTrainer.initQuestion();
                                    }
                                });
                                panel.add(inputTestChk);
                            }
                        }
                    }
                    picCheckBtn.addActionListener(new ActionListener() {
                        void scanPic(String searchWord, File file, Set<File> findFile) {
                            if (file.isDirectory()) {
                                File[] list = null;
                                if ((list = file.listFiles()) != null) {
                                    for (File f : list) {
                                        scanPic(searchWord, f, findFile);
                                    }
                                }
                            } else {
                                String text = searchWord;
                                String name = file.getName().toLowerCase();
                                if (isMatch(name, text)) {
                                    findFile.add(file);
                                }
                            }
                        }

                        public void actionPerformed(ActionEvent evt) {
                            picDir = new File(picFolderDirText.getText());
                            if (picDir == null) {
                                JCommonUtil._jOptionPane_showMessageDialog_error("picDir is null");
                                return;
                            }
                            if (!picDir.exists() || !picDir.isDirectory()) {
                                JCommonUtil._jOptionPane_showMessageDialog_error("picDir ");
                                return;
                            }

                            picCheckBtn.setText("search..");

                            String searchWord = picCheckText.getText().toLowerCase().trim();

                            Set<File> picSet2 = new HashSet<File>();
                            scanPic(searchWord, picDir, picSet2);

                            if (picSet2 != null && picSet2.size() > 0) {
                                picCheckBtn.setText("" + picSet2.size());

                                try {
                                    Desktop.getDesktop().open(picSet2.iterator().next());
                                } catch (IOException e) {
                                    JCommonUtil.handleException(e);
                                }
                            } else {
                                picCheckBtn.setText("0");
                            }
                        }
                    });
                }
            }
        }

        JCommonUtil.setJFrameIcon(this, "resource/images/ico/english_tester.ico");

        pack();
        this.setSize(423, 314);

        configHelper.init();
    } catch (Exception e) {
        // add your error handling code here
        e.printStackTrace();
    }
}

From source file:pi.bestdeal.gui.InterfacePrincipale.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  2s .  c om
 */

// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    buttonGroup1 = new javax.swing.ButtonGroup();
    jTabbedPane1 = new javax.swing.JTabbedPane();
    Client_Panel = new javax.swing.JPanel();
    jScrollPane2 = new javax.swing.JScrollPane();
    Search_TextField = new javax.swing.JTextPane();
    Add_Button = new javax.swing.JButton();
    Update_Button = new javax.swing.JButton();
    Delete_Button = new javax.swing.JButton();
    Display_Button = new javax.swing.JButton();
    jPanel1 = new javax.swing.JPanel();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTable1 = new javax.swing.JTable();
    GoToClientInterface = new javax.swing.JButton();
    jPanel2 = new javax.swing.JPanel();
    jScrollPane3 = new javax.swing.JScrollPane();
    jTable2 = new javax.swing.JTable();
    DeleteClient = new javax.swing.JButton();
    jScrollPane6 = new javax.swing.JScrollPane();
    Search_TextField1 = new javax.swing.JTextPane();
    jPanel3 = new javax.swing.JPanel();
    jScrollPane5 = new javax.swing.JScrollPane();
    jTable3 = new javax.swing.JTable();
    StatButton = new javax.swing.JButton();
    ButtonRapport = new javax.swing.JButton();
    jScrollPane7 = new javax.swing.JScrollPane();
    Search_TextField2 = new javax.swing.JTextPane();
    jPanel4 = new javax.swing.JPanel();
    jScrollPane4 = new javax.swing.JScrollPane();
    jTableMessage = new javax.swing.JTable();
    ReplyButton = new javax.swing.JButton();
    DeleteMessageButton = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setTitle("BesDeal");

    jTabbedPane1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
    jTabbedPane1.addFocusListener(new java.awt.event.FocusAdapter() {
        public void focusGained(java.awt.event.FocusEvent evt) {
            jTabbedPane1FocusGained(evt);
        }
    });

    Search_TextField.addKeyListener(new java.awt.event.KeyAdapter() {
        public void keyReleased(java.awt.event.KeyEvent evt) {
            Search_TextFieldKeyReleased(evt);
        }
    });
    jScrollPane2.setViewportView(Search_TextField);

    Add_Button.setText("Ajouter");
    Add_Button.setToolTipText("Ajouter un Nouveau Deal");
    Add_Button.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            Add_ButtonActionPerformed(evt);
        }
    });

    Update_Button.setText("Modifier");
    Update_Button.setToolTipText("Modifier le Deal slectionn");
    Update_Button.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            Update_ButtonActionPerformed(evt);
        }
    });

    Delete_Button.setText("Supprimer");
    Delete_Button.setToolTipText("Supprimer le deal slectionn");
    Delete_Button.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            Delete_ButtonActionPerformed(evt);
        }
    });

    Display_Button.setText("Afficher");
    Display_Button.setToolTipText("Afficher le Deal");
    Display_Button.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            Display_ButtonActionPerformed(evt);
        }
    });

    jTable1.setModel(tableModel);
    jScrollPane1.setViewportView(jTable1);

    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()
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 536, Short.MAX_VALUE)
                    .addContainerGap()));
    jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING,
                    javax.swing.GroupLayout.PREFERRED_SIZE, 284, javax.swing.GroupLayout.PREFERRED_SIZE));

    GoToClientInterface.setText("Espace Client");
    GoToClientInterface.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            GoToClientInterfaceActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout Client_PanelLayout = new javax.swing.GroupLayout(Client_Panel);
    Client_Panel.setLayout(Client_PanelLayout);
    Client_PanelLayout.setHorizontalGroup(Client_PanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(Client_PanelLayout.createSequentialGroup().addContainerGap().addGroup(Client_PanelLayout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(Client_PanelLayout.createSequentialGroup().addGap(12, 12, 12)
                            .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 100,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                            Client_PanelLayout.createSequentialGroup().addComponent(Add_Button)
                                    .addGap(18, 18, 18).addComponent(Update_Button)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(GoToClientInterface, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            160, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(30, 30, 30).addComponent(Delete_Button).addGap(18, 18, 18)
                                    .addComponent(Display_Button)))
                    .addContainerGap()));
    Client_PanelLayout.setVerticalGroup(Client_PanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, Client_PanelLayout.createSequentialGroup()
                    .addGap(12, 12, 12)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 90, Short.MAX_VALUE)
                    .addGroup(Client_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(Add_Button).addComponent(Update_Button).addComponent(Delete_Button)
                            .addComponent(Display_Button))
                    .addGap(29, 29, 29))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                    Client_PanelLayout.createSequentialGroup()
                            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(GoToClientInterface).addContainerGap()));

    jTabbedPane1.addTab("Gestion des Deals", Client_Panel);

    jTable2.setModel(clientmodel);
    jScrollPane3.setViewportView(jTable2);

    DeleteClient.setText("Supprimer");
    DeleteClient.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            DeleteClientActionPerformed(evt);
        }
    });

    Search_TextField1.addKeyListener(new java.awt.event.KeyAdapter() {
        public void keyReleased(java.awt.event.KeyEvent evt) {
            Search_TextField1KeyReleased(evt);
        }
    });
    jScrollPane6.setViewportView(Search_TextField1);

    javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(jPanel2Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createSequentialGroup().addGroup(jPanel2Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel2Layout.createSequentialGroup().addGap(18, 18, 18)
                                            .addComponent(DeleteClient))
                                    .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap()
                                            .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    100, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addGap(0, 0, Short.MAX_VALUE))
                            .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap().addComponent(
                                    jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 556, Short.MAX_VALUE)))
                    .addContainerGap()));
    jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap()
                    .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 286,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 106, Short.MAX_VALUE)
                    .addComponent(DeleteClient)));

    jTabbedPane1.addTab("Gestion des Clients", jPanel2);

    jTable3.setModel(tableModel);
    jTable3.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
        public void propertyChange(java.beans.PropertyChangeEvent evt) {
            jTable3PropertyChange(evt);
        }
    });
    jScrollPane5.setViewportView(jTable3);

    StatButton.setText("Statistique");
    StatButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton4ActionPerformed(evt);
        }
    });

    ButtonRapport.setText("Rapport");
    ButtonRapport.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            ButtonRapportActionPerformed(evt);
        }
    });

    Search_TextField2.addKeyListener(new java.awt.event.KeyAdapter() {
        public void keyReleased(java.awt.event.KeyEvent evt) {
            Search_TextField2KeyReleased(evt);
        }
    });
    jScrollPane7.setViewportView(Search_TextField2);

    javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
    jPanel3.setLayout(jPanel3Layout);
    jPanel3Layout.setHorizontalGroup(jPanel3Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup().addGroup(jPanel3Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup().addContainerGap().addComponent(jScrollPane5,
                            javax.swing.GroupLayout.DEFAULT_SIZE, 556, Short.MAX_VALUE))
                    .addGroup(jPanel3Layout.createSequentialGroup().addGap(20, 20, 20)
                            .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 100,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(
                            jPanel3Layout.createSequentialGroup().addContainerGap().addComponent(ButtonRapport)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(StatButton)))
                    .addContainerGap()));
    jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup().addContainerGap()
                    .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 250,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(ButtonRapport).addComponent(StatButton))
                    .addContainerGap(136, Short.MAX_VALUE)));

    jTabbedPane1.addTab("Gnrer les Rapports", jPanel3);

    jTableMessage.setModel(mailmodel);
    jScrollPane4.setViewportView(jTableMessage);

    ReplyButton.setText("Rpondre");
    ReplyButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            ReplyButtonActionPerformed(evt);
        }
    });

    DeleteMessageButton.setText("Supprimer");
    DeleteMessageButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            DeleteMessageButtonActionPerformed(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)
                    .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 556, Short.MAX_VALUE)
                    .addGroup(jPanel4Layout.createSequentialGroup().addComponent(ReplyButton)
                            .addGap(292, 292, 292).addComponent(DeleteMessageButton)
                            .addGap(0, 0, Short.MAX_VALUE)))
                    .addContainerGap()));
    jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                    .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 424, Short.MAX_VALUE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(ReplyButton).addComponent(DeleteMessageButton))
                    .addGap(8, 8, 8)));

    jTabbedPane1.addTab("Consulter les Messages", jPanel4);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jTabbedPane1));
    layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jTabbedPane1));

    pack();
}