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:gtu._work.ui.RegexTestUI.java

private void initGUI() {
    try {/*from   w  w  w  . j a va 2 s.c  o m*/
        DocumentListener docListener = JCommonUtil.getDocumentListener(new HandleDocumentEvent() {
            public void process(DocumentEvent event) {
                jText1OrJArea1Change(event);
            }
        });

        BorderLayout thisLayout = new BorderLayout();
        getContentPane().setLayout(thisLayout);
        this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        {
            jTabbedPane1 = new JTabbedPane();
            jTabbedPane1.addChangeListener(new ChangeListener() {
                public void stateChanged(ChangeEvent e) {
                    jText1OrJArea1Change(null);
                }
            });
            getContentPane().add(jTabbedPane1, BorderLayout.CENTER);
            {
                jPanel1 = new JPanel();
                BorderLayout jPanel1Layout = new BorderLayout();
                jPanel1.setLayout(jPanel1Layout);
                jTabbedPane1.addTab("src text", null, jPanel1, null);
                {
                    jScrollPane1 = new JScrollPane();
                    jPanel1.add(jScrollPane1, BorderLayout.CENTER);
                    {
                        srcArea = new JTextArea();
                        jScrollPane1.setViewportView(srcArea);
                        srcArea.setBorder(
                                BorderFactory.createMatteBorder(1, 1, 1, 1, new java.awt.Color(0, 0, 0)));
                        JCommonUtil.setFont(srcArea);
                        srcArea.addKeyListener(new KeyAdapter() {
                            @Override
                            public void keyPressed(KeyEvent e) {
                                jText1OrJArea1Change(null);
                            }
                        });
                    }
                }
            }
            {
                jPanel2 = new JPanel();
                BorderLayout jPanel2Layout = new BorderLayout();
                jPanel2.setLayout(jPanel2Layout);
                jTabbedPane1.addTab("group", null, jPanel2, null);
                {
                    jScrollPane2 = new JScrollPane();
                    jPanel2.add(jScrollPane2, BorderLayout.CENTER);
                    jScrollPane2.setPreferredSize(new java.awt.Dimension(398, 234));
                    {
                        ListModel groupListModel = new DefaultComboBoxModel();
                        groupList = new JList();
                        jScrollPane2.setViewportView(groupList);
                        groupList.setBorder(
                                BorderFactory.createMatteBorder(1, 1, 1, 1, new java.awt.Color(0, 0, 0)));
                        groupList.setModel(groupListModel);
                        JCommonUtil.setFont(groupList);
                    }
                }
                {
                    regexText0 = new JTextField();
                    jPanel2.add(regexText0, BorderLayout.NORTH);
                    regexText0.setBorder(
                            BorderFactory.createMatteBorder(1, 1, 1, 1, new java.awt.Color(0, 0, 0)));
                    JCommonUtil.setFont(regexText0);
                    regexText0.getDocument().addDocumentListener(docListener);
                }
            }
            {
                jPanel3 = new JPanel();
                BorderLayout jPanel3Layout = new BorderLayout();
                jPanel3.setLayout(jPanel3Layout);
                jTabbedPane1.addTab("scanner", null, jPanel3, null);
                {
                    jScrollPane3 = new JScrollPane();
                    jPanel3.add(jScrollPane3, BorderLayout.CENTER);
                    {
                        ListModel scannerListModel = new DefaultComboBoxModel();
                        scannerList = new JList();
                        jScrollPane3.setViewportView(scannerList);
                        scannerList.setBorder(
                                BorderFactory.createMatteBorder(1, 1, 1, 1, new java.awt.Color(0, 0, 0)));
                        scannerList.setModel(scannerListModel);
                        JCommonUtil.setFont(scannerList);
                    }
                }
                {
                    regexText = new JTextField();
                    jPanel3.add(regexText, BorderLayout.NORTH);
                    regexText.setBorder(
                            BorderFactory.createMatteBorder(1, 1, 1, 1, new java.awt.Color(0, 0, 0)));
                    JCommonUtil.setFont(regexText);
                    regexText.getDocument().addDocumentListener(docListener);
                }
            }
        }
        this.setTitle("\u6b63\u5247\u8868\u793a\u5f0f");
        this.setSize(419, 320);
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:com.javafxpert.neuralnetviz.scenario.PlotUtil.java

/**Plot the training data. Assume 2d input, classification output
 * @param features Training data features
 * @param labels Training data labels (one-hot representation)
 * @param predicted Network predictions, for the test points
 * @param backgroundIn sets of x,y points in input space, plotted in the background
 * @param backgroundOut results of network evaluation at points in x,y points in space
 * @param nDivisions Number of points (per axis, for the backgroundIn/backgroundOut arrays)
 *///from w  ww.j  a va2  s  .  c o  m
public static void plotTestData(INDArray features, INDArray labels, INDArray predicted, INDArray backgroundIn,
        INDArray backgroundOut, int nDivisions) {

    double[] mins = backgroundIn.min(0).data().asDouble();
    double[] maxs = backgroundIn.max(0).data().asDouble();

    XYZDataset backgroundData = createBackgroundData(backgroundIn, backgroundOut);
    JPanel panel = new ChartPanel(createChart(backgroundData, mins, maxs, nDivisions,
            createDataSetTest(features, labels, predicted)));

    JFrame f = new JFrame();
    f.add(panel);
    f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    f.pack();
    f.setTitle("Test Data");

    f.setVisible(true);

}

From source file:components.TextAreaDemo.java

private void initComponents() {
    jLabel1 = new JLabel("Try typing 'spectacular' or 'Swing'...");

    textArea = new JTextArea();
    setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    textArea.setColumns(20);/*w  w  w .  j av a2s  .c om*/
    textArea.setLineWrap(true);
    textArea.setRows(5);
    textArea.setWrapStyleWord(true);

    jScrollPane1 = new JScrollPane(textArea);

    GroupLayout layout = new GroupLayout(getContentPane());
    getContentPane().setLayout(layout);

    //Create a parallel group for the horizontal axis
    ParallelGroup hGroup = layout.createParallelGroup(GroupLayout.Alignment.LEADING);
    //Create a sequential and a parallel groups
    SequentialGroup h1 = layout.createSequentialGroup();
    ParallelGroup h2 = layout.createParallelGroup(GroupLayout.Alignment.TRAILING);
    //Add a scroll panel and a label to the parallel group h2
    h2.addComponent(jScrollPane1, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 212,
            Short.MAX_VALUE);
    h2.addComponent(jLabel1, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 212, Short.MAX_VALUE);

    //Add a container gap to the sequential group h1
    h1.addContainerGap();
    // Add the group h2 to the group h1
    h1.addGroup(h2);
    h1.addContainerGap();
    //Add the group h1 to hGroup
    hGroup.addGroup(Alignment.TRAILING, h1);
    //Create the horizontal group
    layout.setHorizontalGroup(hGroup);

    //Create a parallel group for the vertical axis
    ParallelGroup vGroup = layout.createParallelGroup(GroupLayout.Alignment.LEADING);
    //Create a sequential group
    SequentialGroup v1 = layout.createSequentialGroup();
    //Add a container gap to the sequential group v1
    v1.addContainerGap();
    //Add a label to the sequential group v1
    v1.addComponent(jLabel1);
    v1.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED);
    //Add scroll panel to the sequential group v1
    v1.addComponent(jScrollPane1, GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE);
    v1.addContainerGap();
    //Add the group v1 to vGroup
    vGroup.addGroup(v1);
    //Create the vertical group
    layout.setVerticalGroup(vGroup);
    pack();

}

From source file:lockers.FrameCobro.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.  ja v  a2  s  . c  om*/
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jLabel1 = new javax.swing.JLabel();
    jLblAvailableLockers = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    jPanel1 = new javax.swing.JPanel();
    jPanel2 = new javax.swing.JPanel();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setTitle("Selecciona tu locker");
    setPreferredSize(new java.awt.Dimension(640, 480));

    jLabel1.setText("Disponibilidad de Lockers");

    jLblAvailableLockers.setText("Sin disponibilidad");

    jLabel2.setText("Tarifas Vigentes");

    jPanel1.setLayout(new java.awt.GridLayout(0, 1));

    jPanel2.setLayout(new java.awt.GridLayout(4, 3));

    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().addGroup(layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLblAvailableLockers)
                                    .addGroup(layout.createSequentialGroup().addGap(31, 31, 31)
                                            .addComponent(jLabel2))
                                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 195,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGap(6, 6, 6)))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, 170, Short.MAX_VALUE)
                    .addContainerGap()));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addGap(14, 14, 14).addGroup(layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup().addComponent(jLabel1)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jLblAvailableLockers).addGap(10, 10, 10).addComponent(jLabel2)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 204, Short.MAX_VALUE)))
                    .addContainerGap()));

    jLblAvailableLockers.getAccessibleContext().setAccessibleName("jLblAvailableLockers");

    pack();
}

From source file:courseapplication.CourseApplication1.java

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

    jPanel1 = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTextArea1 = new javax.swing.JTextArea();
    jLabel2 = new javax.swing.JLabel();
    jTextField1 = new javax.swing.JTextField();
    jButton1 = new javax.swing.JButton();
    jButton2 = new javax.swing.JButton();
    jButton3 = new javax.swing.JButton();
    jButton4 = new javax.swing.JButton();
    jButton5 = new javax.swing.JButton();
    jButton6 = new javax.swing.JButton();
    jButton7 = new javax.swing.JButton();
    jLabel3 = new javax.swing.JLabel();
    jTextField2 = new javax.swing.JTextField();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

    jLabel1.setFont(new java.awt.Font("Sylfaen", 2, 24)); // NOI18N
    jLabel1.setText("Interpolation");

    jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    jScrollPane1.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);

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

    jLabel2.setFont(new java.awt.Font("Sylfaen", 2, 14)); // NOI18N
    jLabel2.setText("Input function :");

    jButton1.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
    jButton1.setText("Import data from file");
    jButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton1ActionPerformed(evt);
        }
    });

    jButton2.setText("OK");
    jButton2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton2ActionPerformed(evt);
        }
    });

    jButton3.setText("Clear");
    jButton3.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton3ActionPerformed(evt);
        }
    });

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

    jButton5.setText("Gaussian method");
    jButton5.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton5ActionPerformed(evt);
        }
    });

    jButton6.setText("Graphic");
    jButton6.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton6ActionPerformed(evt);
        }
    });

    jButton7.setText("Clear panel");
    jButton7.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton7ActionPerformed(evt);
        }
    });

    jLabel3.setText("X");

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

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addGroup(jPanel1Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING,
                                    jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
                                                    false)
                                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout
                                                    .createSequentialGroup().addComponent(jButton1)
                                                    .addPreferredGap(
                                                            javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                            38, Short.MAX_VALUE)
                                                    .addComponent(jLabel1,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE, 158,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addGroup(jPanel1Layout.createSequentialGroup()
                                                    .addGroup(jPanel1Layout
                                                            .createParallelGroup(
                                                                    javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addComponent(jLabel2).addComponent(jLabel3))
                                                    .addPreferredGap(
                                                            javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                    .addGroup(jPanel1Layout
                                                            .createParallelGroup(
                                                                    javax.swing.GroupLayout.Alignment.LEADING,
                                                                    false)
                                                            .addComponent(jTextField1).addComponent(jTextField2,
                                                                    javax.swing.GroupLayout.DEFAULT_SIZE, 244,
                                                                    Short.MAX_VALUE))))
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 56,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(
                                                    javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(jButton3))
                            .addGroup(jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jButton5, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addGroup(jPanel1Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
                                                    false)
                                            .addComponent(jButton6, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(jButton7, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 458,
                            javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addGroup(jPanel1Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup().addComponent(jLabel1).addGap(29, 29, 29))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                            jPanel1Layout.createSequentialGroup().addComponent(jButton1)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)))
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2)
                            .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jButton2).addComponent(jButton3))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3).addComponent(jTextField2,
                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 162,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jButton4).addComponent(jButton6))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jButton5).addComponent(jButton7))
                    .addContainerGap()));

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

    pack();
}

From source file:misc.TextAreaPrintingDemo.java

/** This method is called from within the constructor to
 * initialize the form./*from  ww w .j  a  va2 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() {
    jScrollPane1 = new javax.swing.JScrollPane();
    text = new javax.swing.JTextArea();
    headerLabel = new javax.swing.JLabel();
    headerField = new javax.swing.JTextField();
    footerLabel = new javax.swing.JLabel();
    footerField = new javax.swing.JTextField();
    interactiveCheck = new javax.swing.JCheckBox();
    printButton = new javax.swing.JButton();
    guideText = new javax.swing.JTextArea();
    backgroundCheck = new javax.swing.JCheckBox();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setTitle("TextAreaPrintingDemo");
    text.setColumns(20);
    text.setRows(5);
    text.setMargin(new java.awt.Insets(2, 2, 2, 2));
    jScrollPane1.setViewportView(text);

    headerLabel.setText("Header");

    headerField.setText("William Shakespeare");

    footerLabel.setText("Footer");

    footerField.setText("Page {0}");

    interactiveCheck.setSelected(true);
    interactiveCheck.setText("Show Progress Dialog");
    interactiveCheck.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));

    printButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("images/print.png")));
    printButton.setText("Print!");
    printButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            print(evt);
        }
    });

    guideText.setColumns(20);
    guideText.setEditable(false);
    guideText.setLineWrap(true);
    guideText.setRows(5);
    guideText.setWrapStyleWord(true);
    guideText.setOpaque(false);

    backgroundCheck.setSelected(true);
    backgroundCheck.setText("Print in Background");
    backgroundCheck.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));

    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()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(guideText)
                            .addGroup(layout.createSequentialGroup().addGroup(layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(backgroundCheck, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(interactiveCheck, javax.swing.GroupLayout.PREFERRED_SIZE, 159,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                            printButton, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addGroup(layout.createSequentialGroup().addGroup(layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(footerLabel, javax.swing.GroupLayout.Alignment.LEADING,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(headerLabel, javax.swing.GroupLayout.Alignment.LEADING,
                                            javax.swing.GroupLayout.PREFERRED_SIZE, 74,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
                                                    false)
                                            .addComponent(footerField).addComponent(headerField,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 209,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGap(15, 15, 15)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 343, 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(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING,
                            javax.swing.GroupLayout.DEFAULT_SIZE, 403, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                            .addComponent(guideText, javax.swing.GroupLayout.DEFAULT_SIZE, 260, Short.MAX_VALUE)
                            .addGap(18, 18, 18)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(headerLabel).addComponent(headerField,
                                            javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(footerLabel).addComponent(footerField,
                                            javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGap(27, 27, 27)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                            .addComponent(interactiveCheck,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 23,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(backgroundCheck,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 23,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addComponent(printButton, javax.swing.GroupLayout.PREFERRED_SIZE, 52,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addContainerGap()));
    pack();
}

From source file:com.cactus.ClientRegisterGUI.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  v  a2  s  .c  o m*/
 */

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

    this.pack();
    this.setLocationRelativeTo(null);

    Username_TextField = new JTextField();
    Email_TextField = new JTextField();
    Email_Confirm_TextField = new JTextField();
    Password_TextField = new JPasswordField();
    Confirm_Password_TextField = new JPasswordField();
    Username_Label = new JLabel();
    Email_Label = new JLabel();
    Email_Confirm_Label = new JLabel();
    Password_Label = new JLabel();
    Confirm_Password_Label = new JLabel();
    Register_Button = new JButton();
    Cancel_Button = new JButton();

    setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

    Email_TextField.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            Email_TextFieldActionPerformed(evt);
        }
    });

    Username_Label.setText("Username:");
    Email_Label.setText("Email:");
    Email_Confirm_Label.setText("Confirm Email:");
    Password_Label.setText("Password:");
    Confirm_Password_Label.setText("Confirm Password:");

    Register_Button.setText("Register");
    Register_Button.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            try {
                Register_ButtonActionPerformed(evt);
            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
    });

    Cancel_Button.setText("Cancel");
    Cancel_Button.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            try {
                Cancel_ButtonActionPerformed(evt);
            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
    });

    javax.swing.GroupLayout layout = new GroupLayout(getContentPane());
    layout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout
            .createSequentialGroup().addGap(67)
            .addGroup(layout.createParallelGroup(Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup().addComponent(Confirm_Password_Label)
                            .addContainerGap())
                    .addGroup(layout.createParallelGroup(Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup().addComponent(Email_Confirm_Label)
                                    .addContainerGap())
                            .addGroup(layout.createParallelGroup(Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup().addComponent(Email_Label)
                                            .addContainerGap())
                                    .addGroup(layout.createSequentialGroup().addComponent(Password_Label)
                                            .addContainerGap())
                                    .addGroup(layout.createSequentialGroup().addGroup(layout
                                            .createParallelGroup(Alignment.LEADING)
                                            .addComponent(Password_TextField, GroupLayout.DEFAULT_SIZE, 250,
                                                    Short.MAX_VALUE)
                                            .addComponent(Confirm_Password_TextField, GroupLayout.DEFAULT_SIZE,
                                                    250, Short.MAX_VALUE)
                                            .addGroup(layout.createSequentialGroup().addComponent(Cancel_Button)
                                                    .addPreferredGap(ComponentPlacement.RELATED, 112,
                                                            Short.MAX_VALUE)
                                                    .addComponent(Register_Button))
                                            .addComponent(Username_Label)
                                            .addComponent(Username_TextField, 250, 250, Short.MAX_VALUE)
                                            .addComponent(Email_TextField, GroupLayout.DEFAULT_SIZE, 250,
                                                    Short.MAX_VALUE)
                                            .addComponent(Email_Confirm_TextField, GroupLayout.DEFAULT_SIZE,
                                                    250, Short.MAX_VALUE))
                                            .addGap(83)))))));
    layout.setVerticalGroup(layout.createParallelGroup(Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addContainerGap().addComponent(Username_Label)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(Username_TextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.UNRELATED).addComponent(Email_Label)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(Email_TextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.UNRELATED).addComponent(Email_Confirm_Label).addGap(10)
                    .addComponent(Email_Confirm_TextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED).addComponent(Password_Label)
                    .addPreferredGap(ComponentPlacement.UNRELATED)
                    .addComponent(Password_TextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.UNRELATED).addComponent(Confirm_Password_Label)
                    .addGap(11)
                    .addComponent(Confirm_Password_TextField, GroupLayout.PREFERRED_SIZE,
                            GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                    .addGap(18).addGroup(layout.createParallelGroup(Alignment.BASELINE)
                            .addComponent(Cancel_Button).addComponent(Register_Button))
                    .addContainerGap(26, Short.MAX_VALUE)));
    getContentPane().setLayout(layout);

    pack();
}

From source file:com.clank.launcher.dialog.LauncherFrame.java

/**
 * Create a new frame.//from w  w  w. j  a  v  a  2 s  . c o m
 *
 * @param launcher the launcher
 */
public LauncherFrame(@NonNull Launcher launcher) {
    super(_("launcher.title", launcher.getVersion()));

    this.launcher = launcher;
    instancesModel = new InstanceTableModel(launcher.getInstances());

    setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    setSize(700, 450);
    setMinimumSize(new Dimension(400, 300));
    initComponents();
    setLocationRelativeTo(null);

    SwingHelper.setIconImage(this, Launcher.class, "icon.png");

    loadInstances();
    checkLauncherUpdate();
}

From source file:gtu.zcognos.DimensionUI.java

private void initGUI() {
    try {/*  w  w w . jav a  2  s .  co  m*/

        final SwingActionUtil swingUtil = (SwingActionUtil) SwingActionUtil.newInstance(this);
        {
            GroupLayout thisLayout = new GroupLayout((JComponent) getContentPane());
            getContentPane().setLayout(thisLayout);
            this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
            {
                projectId = new JTextField();
            }
            {
                jLabel1 = new JLabel();
                jLabel1.setText("PROJECT_ID");
            }
            {
                create = new JButton();
                create.setText("create");
                create.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent evt) {
                        swingUtil.invokeAction("create.actionPerformed", evt);
                    }
                });
            }
            {
                reportId = new JTextField();
            }
            {
                jLabel8 = new JLabel();
                jLabel8.setText("report id");
            }
            {
                addDimensionFromDb = new JButton();
                addDimensionFromDb.setText("add from db");
                addDimensionFromDb.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent evt) {
                        swingUtil.invokeAction("addFromDb.actionPerformed", evt);
                    }
                });
            }
            {
                dataSourceTable = new JTextField();
                dataSourceTable.setText("rscdpg0901");
            }
            {
                jLabel7 = new JLabel();
                jLabel7.setText("data source table");
            }
            {
                addDimension = new JButton();
                addDimension.setText("add");
                addDimension.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent evt) {
                        swingUtil.invokeAction("add.actionPerformed", evt);
                    }
                });
            }
            {
                dimensionName = new JTextField();
            }
            {
                jLabel6 = new JLabel();
                jLabel6.setText("dimension chinese name");
            }
            {
                jLabel5 = new JLabel();
                jLabel5.setText("rscdzzzz id index");
            }
            {
                String[] idx = new String[20];
                for (int ii = 0; ii < idx.length; ii++) {
                    idx[ii] = "id" + (ii + 1);
                }
                ComboBoxModel rscdzzzzIdIndexModel = new DefaultComboBoxModel(idx);
                rscdzzzzIdIndex = new JComboBox();
                rscdzzzzIdIndex.setModel(rscdzzzzIdIndexModel);
            }
            {
                jLabel3 = new JLabel();
                jLabel3.setText("Dimension");
            }
            {
                jScrollPane1 = new JScrollPane();
                {
                    DefaultListModel dimensionListModel = new DefaultListModel();
                    dimensionList = new JList();
                    jScrollPane1.setViewportView(dimensionList);
                    dimensionList.setModel(dimensionListModel);
                    dimensionList.addKeyListener(new KeyAdapter() {
                        public void keyPressed(KeyEvent evt) {
                            JListUtil.newInstance(dimensionList).defaultJListKeyPressed(evt);
                        }
                    });
                }
            }
            {
                exportDir = new JButton();
                exportDir.setText("export dir");
                exportDir.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent evt) {
                        swingUtil.invokeAction("exportDir.actionPerformed", evt);
                    }
                });
            }
            {
                category = new JTextField();
            }
            {
                jLabel4 = new JLabel();
                jLabel4.setText("category");
            }
            {
                tableName = new JTextField();
            }
            {
                jLabel2 = new JLabel();
                jLabel2.setText("merge table name");
            }
            thisLayout
                    .setHorizontalGroup(thisLayout.createSequentialGroup().addContainerGap(12, 12)
                            .addGroup(thisLayout.createParallelGroup()
                                    .addComponent(jLabel3, GroupLayout.Alignment.LEADING,
                                            GroupLayout.PREFERRED_SIZE, 196, GroupLayout.PREFERRED_SIZE)
                                    .addGroup(thisLayout.createSequentialGroup().addGap(19).addGroup(thisLayout
                                            .createParallelGroup().addGroup(thisLayout.createSequentialGroup()
                                                    .addComponent(exportDir, GroupLayout.PREFERRED_SIZE, 119,
                                                            GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                                    .addComponent(
                                                            addDimension, GroupLayout.PREFERRED_SIZE, 119,
                                                            GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                                    .addGroup(thisLayout.createParallelGroup().addComponent(
                                                            addDimensionFromDb, GroupLayout.Alignment.LEADING,
                                                            GroupLayout.PREFERRED_SIZE, 191,
                                                            GroupLayout.PREFERRED_SIZE)
                                                            .addGroup(thisLayout.createSequentialGroup().addGap(
                                                                    88)
                                                                    .addComponent(create,
                                                                            GroupLayout.PREFERRED_SIZE, 119,
                                                                            GroupLayout.PREFERRED_SIZE))))
                                            .addGroup(thisLayout.createSequentialGroup().addGroup(thisLayout
                                                    .createParallelGroup()
                                                    .addComponent(jLabel6, GroupLayout.Alignment.LEADING,
                                                            GroupLayout.PREFERRED_SIZE, 196,
                                                            GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel5, GroupLayout.Alignment.LEADING,
                                                            GroupLayout.PREFERRED_SIZE, 196,
                                                            GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel4, GroupLayout.Alignment.LEADING,
                                                            GroupLayout.PREFERRED_SIZE, 196,
                                                            GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel8, GroupLayout.Alignment.LEADING,
                                                            GroupLayout.PREFERRED_SIZE, 196,
                                                            GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel2, GroupLayout.Alignment.LEADING,
                                                            GroupLayout.PREFERRED_SIZE, 196,
                                                            GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel7, GroupLayout.Alignment.LEADING,
                                                            GroupLayout.PREFERRED_SIZE, 196,
                                                            GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel1, GroupLayout.Alignment.LEADING,
                                                            GroupLayout.PREFERRED_SIZE, 196,
                                                            GroupLayout.PREFERRED_SIZE))
                                                    .addGap(39)
                                                    .addGroup(thisLayout.createParallelGroup()
                                                            .addComponent(dimensionName,
                                                                    GroupLayout.Alignment.LEADING,
                                                                    GroupLayout.PREFERRED_SIZE, 204,
                                                                    GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(rscdzzzzIdIndex,
                                                                    GroupLayout.Alignment.LEADING,
                                                                    GroupLayout.PREFERRED_SIZE, 204,
                                                                    GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(category,
                                                                    GroupLayout.Alignment.LEADING,
                                                                    GroupLayout.PREFERRED_SIZE, 204,
                                                                    GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(reportId,
                                                                    GroupLayout.Alignment.LEADING,
                                                                    GroupLayout.PREFERRED_SIZE, 204,
                                                                    GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(tableName,
                                                                    GroupLayout.Alignment.LEADING,
                                                                    GroupLayout.PREFERRED_SIZE, 204,
                                                                    GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(dataSourceTable,
                                                                    GroupLayout.Alignment.LEADING,
                                                                    GroupLayout.PREFERRED_SIZE, 204,
                                                                    GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(projectId,
                                                                    GroupLayout.Alignment.LEADING,
                                                                    GroupLayout.PREFERRED_SIZE, 204,
                                                                    GroupLayout.PREFERRED_SIZE)))
                                            .addComponent(jScrollPane1, GroupLayout.Alignment.LEADING,
                                                    GroupLayout.PREFERRED_SIZE, 436,
                                                    GroupLayout.PREFERRED_SIZE))))
                            .addContainerGap(11, 11));
            thisLayout.setVerticalGroup(thisLayout.createSequentialGroup().addContainerGap(12, 12)
                    .addGroup(thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                            .addComponent(projectId, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel1, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                            .addComponent(dataSourceTable, GroupLayout.Alignment.BASELINE,
                                    GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel7, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jLabel3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addGroup(thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                            .addComponent(tableName, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel2, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                            .addComponent(reportId, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel8, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                            .addComponent(category, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel4, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(thisLayout.createParallelGroup()
                            .addComponent(jLabel5, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                            .addComponent(rscdzzzzIdIndex, GroupLayout.Alignment.LEADING,
                                    GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                            .addComponent(dimensionName, GroupLayout.Alignment.BASELINE,
                                    GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel6, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                            .addComponent(addDimension, GroupLayout.Alignment.BASELINE,
                                    GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(exportDir, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                            .addComponent(addDimensionFromDb, GroupLayout.Alignment.BASELINE,
                                    GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE))
                    .addGap(11)
                    .addComponent(jScrollPane1, GroupLayout.PREFERRED_SIZE, 269, GroupLayout.PREFERRED_SIZE)
                    .addGap(12).addComponent(create, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(9, 9));
        }
        this.setSize(513, 632);

        swingUtil.addAction("exportDir.actionPerformed", new Action() {
            public void action(EventObject evt) throws Exception {
                File file = JFileChooserUtil.newInstance().selectDirectoryOnly().showOpenDialog()
                        .getApproveSelectedFile();
                if (file != null) {
                    baseDir = file;
                }
            }
        });

        swingUtil.addAction("addFromDb.actionPerformed", new Action() {
            public void action(EventObject evt) throws Exception {
                String project = projectId.getText();
                Validate.notEmpty(project, "projectId is null");
                Validate.notEmpty(dataSourceTable.getText(), "dataSourceTable is null");

                DefaultListModel model = (DefaultListModel) dimensionList.getModel();
                for (Dimension_ ddd : InformixDbConn.queryGetDaminsion(dataSourceTable.getText(), project)) {
                    model.addElement(ddd);
                }
            }
        });

        swingUtil.addAction("add.actionPerformed", new Action() {
            public void action(EventObject evt) throws Exception {
                // Validate.notEmpty(tableName.getText(),
                // "tableName is null");
                Validate.notEmpty(category.getText(), "category is null");
                Validate.notEmpty(dimensionName.getText(), "dimensionName is null");
                Validate.notEmpty(dataSourceTable.getText(), "dataSourceTable is null");
                // Validate.notEmpty(reportId.getText(),
                // "reportId is null");

                String report_id = StringUtils.defaultString(reportId.getText(), projectId.getText());

                String tName = tableName.getText();
                if (StringUtils.isEmpty(tName)) {
                    tName = randomTableName();
                }

                DefaultListModel model = (DefaultListModel) dimensionList.getModel();
                model.addElement(new Dimension_(dataSourceTable.getText(), tName, category.getText(),
                        (String) rscdzzzzIdIndex.getSelectedItem(), dimensionName.getText(), report_id));
            }
        });

        swingUtil.addAction("create.actionPerformed", new Action() {
            public void action(EventObject evt) throws Exception {

                String project = projectId.getText();
                Validate.notEmpty(project, "projectId is null");
                Validate.notNull(baseDir, "exportDir is null");

                File destDir = new File(baseDir, project);

                Map<String, Object> map = new HashMap<String, Object>();

                List<Map<String, String>> llist = new ArrayList<Map<String, String>>();

                int idx = 2;
                int categoryId = 1;
                DefaultListModel model = (DefaultListModel) dimensionList.getModel();
                for (Enumeration<?> enu = model.elements(); enu.hasMoreElements();) {
                    Dimension_ di = (Dimension_) enu.nextElement();

                    Map mmm = new HashMap();
                    mmm.put("rscdpg0901", di.dataSourceTable);//
                    mmm.put("rscdpg0901a", di.tableName);//
                    mmm.put("rscdpg0901a_category", di.category);//
                    mmm.put("rscdpg0901a_report_id", di.reportId);//
                    mmm.put("rscdzzzz_id", di.idIndex);//
                    mmm.put("rscdpg0901a_dname", di.dimensionName);//
                    llist.add(mmm);
                }

                map.put("PROJECT_ID", project);
                map.put("RSCDPG0901", llist);
                map.put("rscdpg0901", dataSourceTable.getText());

                ConfigCopy.getInstance().applyBaseDir(baseDir).applyProjectId(project).execute();

                Dimension.getInstance()//
                        .applyDestDir(destDir.getAbsolutePath())//
                        .applyParameter(map)//
                        .execute();

                JOptionPaneUtil.newInstance().iconInformationMessage()
                        .showMessageDialog(project + " create completed!!\r\n dir : " //
                                + destDir.getAbsolutePath(), project);

                Desktop.getDesktop().open(destDir);
            }
        });

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

From source file:userinterface.patientRole.LineChart.java

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor./*from  w w w . j a  va2  s.  co  m*/
 */
@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,
            710, Short.MAX_VALUE));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 579,
            Short.MAX_VALUE));

    pack();
}