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:metodosnumericos.VentanaBiseccion.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  .ja v a2 s. c o m
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jLabel2 = new javax.swing.JLabel();
    jLabel3 = new javax.swing.JLabel();
    jLabel4 = new javax.swing.JLabel();
    jLabel5 = new javax.swing.JLabel();
    txtXi = new javax.swing.JTextField();
    txtXs = new javax.swing.JTextField();
    txtTolerancia = new javax.swing.JTextField();
    txtIteraciones = new javax.swing.JTextField();
    jButton1 = new javax.swing.JButton();
    butCalcular = new javax.swing.JButton();
    jTabbedPane1 = new javax.swing.JTabbedPane();
    panelGrafica = new javax.swing.JPanel();
    canvas1 = new java.awt.Canvas();
    panelTabla = new javax.swing.JPanel();
    jButton2 = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

    jLabel2.setText("Xi");

    jLabel3.setText("Xs:");

    jLabel4.setText("Tolerancia:");

    jLabel5.setText("Iteraciones:");

    txtXi.setText("Xi");
    txtXi.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            txtXiActionPerformed(evt);
        }
    });

    txtXs.setText("Xs");
    txtXs.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            txtXsActionPerformed(evt);
        }
    });

    txtTolerancia.setText("Tolerancia");

    txtIteraciones.setText("Iteraciones");

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

    butCalcular.setText("Calcular");
    butCalcular.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            butCalcularActionPerformed(evt);
        }
    });

    panelGrafica.add(canvas1);

    jTabbedPane1.addTab("Grafica", panelGrafica);

    panelTabla.setLayout(new java.awt.BorderLayout());
    jTabbedPane1.addTab("Tabla", panelTabla);

    jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/info.png"))); // NOI18N
    jButton2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton2ActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addGroup(layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup().addGap(33, 33, 33).addComponent(jButton1)
                            .addGap(60, 60, 60).addComponent(butCalcular))
                    .addGroup(layout.createSequentialGroup().addContainerGap()
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jLabel3).addComponent(jLabel2).addComponent(jLabel4)
                                    .addComponent(jLabel5))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(txtTolerancia, javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(txtXs, javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(txtXi, javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(txtIteraciones, javax.swing.GroupLayout.DEFAULT_SIZE, 90,
                                            Short.MAX_VALUE)))
                    .addGroup(layout.createSequentialGroup().addContainerGap().addComponent(jButton2)))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 391,
                            javax.swing.GroupLayout.PREFERRED_SIZE)));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(layout.createSequentialGroup().addComponent(jButton2).addGap(23, 23, 23)
                                    .addGroup(layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(jLabel2).addComponent(txtXi,
                                                    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(jLabel3)
                                            .addComponent(txtXs, 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(jLabel4).addComponent(txtTolerancia,
                                                    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(jLabel5).addComponent(txtIteraciones,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addGroup(layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(jButton1).addComponent(butCalcular)))
                            .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 327,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap()));

    pack();
}

From source file:com.github.lucapino.sheetmaker.PreviewJFrame.java

public static void main(String[] args) {
    System.setProperty("awt.useSystemAAFontSettings", "on");
    System.setProperty("swing.aatext", "true");
    SwingUtilities.invokeLater(new Runnable() {

        @Override/*from   ww w  .  j a  va  2 s  . c  o  m*/
        public void run() {
            try {
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                File tmpFolder = new File("/tmp/images");
                tmpFolder.mkdir();

                String coverPath = tmpFolder.getAbsolutePath().replaceAll("\\\\", "/") + "/cover.jpg";
                String backdropPath = tmpFolder.getAbsolutePath().replaceAll("\\\\", "/") + "/backdrop.jpg";
                String fanart1Path = tmpFolder.getAbsolutePath().replaceAll("\\\\", "/") + "/fanart1.jpg";
                String fanart2Path = tmpFolder.getAbsolutePath().replaceAll("\\\\", "/") + "/fanart2.jpg";
                String fanart3Path = tmpFolder.getAbsolutePath().replaceAll("\\\\", "/") + "/fanart3.jpg";

                PreviewJFrame frame = new PreviewJFrame();
                logger.info("Creating parser...");
                InfoRetriever parser = new MediaInfoRetriever();
                MovieInfo movieInfo = parser.getMovieInfo("/media/tagliani/Elements/Film/JackRyan.mkv");
                logger.info("Retrieving movie file info...");
                logger.info("Creating dataretriever...");
                DataRetriever retriever = new DataRetrieverImpl();
                logger.info("Retrieving movie data...");
                Movie movie = retriever.retrieveMovieFromImdbID("tt1205537", "IT");
                logger.info("Retrieving backdrops and fanart...");
                List<Artwork> images = movie.getBackdrops();
                // background
                logger.info("Saving backdrop...");
                IOUtils.copyLarge(new URL(images.get(0).getImageURL()).openStream(),
                        new FileOutputStream(backdropPath));
                for (int i = 1; i < 4; i++) {
                    // fanart1
                    // fanart2
                    // fanart3
                    String imageURL = images.get(i).getImageURL();
                    logger.info("Saving fanart{}...", i);
                    IOUtils.copyLarge(new URL(imageURL).openStream(),
                            new FileOutputStream(tmpFolder.getAbsolutePath() + "/fanart" + i + ".jpg"));
                }
                // cover
                logger.info("Retrieving cover...");
                Artwork cover = movie.getPosters().get(0);
                String imageURL = cover.getImageURL();
                logger.info("Saving cover...");
                IOUtils.copyLarge(new URL(imageURL).openStream(), new FileOutputStream(coverPath));

                Map<String, String> tokenMap = TemplateFilter.createTokenMap(movie, movieInfo, null);

                logger.info("Creating renderer...");
                JavaTemplateRenderer renderer = new JavaTemplateRenderer();
                JPanel imagePanel = null;
                try {
                    logger.info("Rendering image...");
                    imagePanel = renderer.renderTemplate(
                            this.getClass().getResource("/templates/simplicity/template.xml"), tokenMap,
                            backdropPath, fanart1Path, fanart2Path, fanart3Path, coverPath);
                    logger.info("Adding image to frame...");
                    frame.add(imagePanel);

                } catch (Exception ex) {
                    ex.printStackTrace();
                }
                imagePanel.setPreferredSize(new Dimension(imagePanel.getWidth(), imagePanel.getHeight()));
                frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
                frame.setVisible(true);
                frame.pack();
                logger.info("Creating image for save...");
                BufferedImage imageTosave = ScreenImage.createImage(imagePanel);
                logger.info("Saving image...");
                ScreenImage.writeImage(imageTosave, "/tmp/images/final.png");
                logger.info("Image saved...");
            } catch (Exception ex) {
                logger.error("Error: ", ex);
            }
        }

    });

}

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

private void initGUI() {
    try {//  w  w w.  j  ava  2 s. co  m
        GroupLayout thisLayout = new GroupLayout((JComponent) getContentPane());
        getContentPane().setLayout(thisLayout);
        this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        {
            jTextField1 = new JTextField();
        }
        {
            jLabel1 = new JLabel();
            jLabel1.setText("Class");
        }
        {
            jTextField2 = new JTextField();
        }
        {
            jLabel2 = new JLabel();
            jLabel2.setText("Package");
        }
        {
            jTextField3 = new JTextField();
        }
        {
            jLabel3 = new JLabel();
            jLabel3.setText("fieldName");
        }
        {
            jTextArea1 = new JTextArea();
        }
        {
            jButton1 = new JButton();
            jButton1.setText("execute");
            jButton1.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent evt) {
                    jButton1ActionPerformed(evt);
                }
            });
        }
        {
            jButton3 = new JButton();
            jButton3.setText("validate");
            jButton3.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent evt) {
                    jButton3ActionPerformed(evt);
                }
            });
        }
        {
            jTextField4 = new JTextField();
        }
        {
            jLabel4 = new JLabel();
            jLabel4.setText("dest");
        }
        {
            jButton2 = new JButton();
            jButton2.setText("choice");
            jButton2.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent evt) {
                    jButton2ActionPerformed(evt);
                }
            });
        }
        thisLayout.setVerticalGroup(thisLayout.createSequentialGroup().addContainerGap()
                .addGroup(thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                        .addComponent(jTextField1, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE,
                                25, GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel1, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE,
                                GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                        .addComponent(jTextField2, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE,
                                25, GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel2, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE,
                                GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                        .addComponent(jTextField3, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE,
                                25, GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel3, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE,
                                GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                        .addComponent(jTextField4, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE,
                                25, GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel4, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE,
                                GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
                        .addComponent(jButton2, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE,
                                GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jTextArea1, GroupLayout.PREFERRED_SIZE, 164, GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                        .addComponent(jButton1, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE,
                                GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
                        .addGroup(GroupLayout.Alignment.LEADING,
                                thisLayout.createSequentialGroup()
                                        .addComponent(jButton3, GroupLayout.PREFERRED_SIZE, 24,
                                                GroupLayout.PREFERRED_SIZE)
                                        .addGap(0, 0, Short.MAX_VALUE)))
                .addGap(6));
        thisLayout.setHorizontalGroup(thisLayout.createSequentialGroup().addContainerGap().addGroup(thisLayout
                .createParallelGroup()
                .addGroup(thisLayout.createSequentialGroup().addGroup(thisLayout.createParallelGroup()
                        .addComponent(jLabel4, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 85,
                                GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel3, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 85,
                                GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel2, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 85,
                                GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel1, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 85,
                                GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(thisLayout.createParallelGroup()
                                .addGroup(GroupLayout.Alignment.LEADING,
                                        thisLayout.createSequentialGroup()
                                                .addComponent(jTextField4, GroupLayout.PREFERRED_SIZE, 200,
                                                        GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jButton2, GroupLayout.PREFERRED_SIZE, 73,
                                                        GroupLayout.PREFERRED_SIZE))
                                .addGroup(thisLayout.createSequentialGroup().addComponent(jTextField3,
                                        GroupLayout.PREFERRED_SIZE, 279, GroupLayout.PREFERRED_SIZE))
                                .addGroup(thisLayout.createSequentialGroup().addComponent(jTextField2,
                                        GroupLayout.PREFERRED_SIZE, 279, GroupLayout.PREFERRED_SIZE))
                                .addGroup(thisLayout.createSequentialGroup().addComponent(jTextField1,
                                        GroupLayout.PREFERRED_SIZE, 279, GroupLayout.PREFERRED_SIZE)))
                        .addGap(0, 0, Short.MAX_VALUE))
                .addGroup(
                        thisLayout.createSequentialGroup()
                                .addComponent(jTextArea1, GroupLayout.PREFERRED_SIZE, 376,
                                        GroupLayout.PREFERRED_SIZE)
                                .addGap(0, 0, Short.MAX_VALUE))
                .addGroup(GroupLayout.Alignment.LEADING, thisLayout.createSequentialGroup().addGap(78)
                        .addComponent(jButton3, GroupLayout.PREFERRED_SIZE, 82, GroupLayout.PREFERRED_SIZE)
                        .addGap(73)
                        .addComponent(jButton1, GroupLayout.PREFERRED_SIZE, 82, GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 61, Short.MAX_VALUE)))
                .addContainerGap(17, 17));
        this.setSize(421, 380);
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:com.cactus.ClientLoginGUI.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  av a  2  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();
    Password_TextField = new JPasswordField();
    Username_Label = new JLabel();
    Password_label = new JLabel();
    Login_Button = new JButton();
    Register_Button = new JButton();

    setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

    Username_TextField.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            Username_TextFieldActionPerformed(evt);
        }
    });

    Password_TextField.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            Password_TextFieldActionPerformed(evt);
        }
    });

    Username_Label.setText("Username:");

    Password_label.setText("Password:");

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

    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();
            }
        }
    });

    javax.swing.GroupLayout layout = new GroupLayout(getContentPane());
    layout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout
            .createSequentialGroup().addGap(101)
            .addGroup(layout.createParallelGroup(Alignment.LEADING, false).addComponent(Password_label)
                    .addComponent(Username_TextField)
                    .addComponent(Password_TextField, GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup().addComponent(Register_Button)
                            .addPreferredGap(ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE)
                            .addComponent(Login_Button))
                    .addComponent(Username_Label, GroupLayout.PREFERRED_SIZE, 109, GroupLayout.PREFERRED_SIZE))
            .addContainerGap(128, Short.MAX_VALUE)));
    layout.setVerticalGroup(layout.createParallelGroup(Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addGap(71).addComponent(Username_Label)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(Username_TextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addGap(27).addComponent(Password_label).addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(Password_TextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addGap(33).addGroup(layout.createParallelGroup(Alignment.BASELINE)
                            .addComponent(Register_Button).addComponent(Login_Button))
                    .addContainerGap(48, Short.MAX_VALUE)));
    getContentPane().setLayout(layout);

    pack();
}

From source file:com.github.rholder.gradle.ui.DependencyViewerStandalone.java

public DependencyViewerStandalone() {
    super(TITLE);
    this.dependencyCellRenderer = new DependencyCellRenderer();
    this.information = new JTextArea();
    this.information.setEditable(false);

    setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    setSize(1024, 768);/*from ww  w . ja v  a  2s  . com*/
    setLocation(128, 128);

    initMenu();
    initToolingLogger();
    initContent();
}

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

    jPanel1 = new javax.swing.JPanel();
    jPanel2 = new javax.swing.JPanel();
    jButton1 = new javax.swing.JButton();
    jButton2 = new javax.swing.JButton();
    jButton3 = new javax.swing.JButton();
    jButton4 = new javax.swing.JButton();
    jPanel3 = new javax.swing.JPanel();
    jPanel4 = new javax.swing.JPanel();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTable1 = new javax.swing.JTable();
    jPanel5 = new javax.swing.JPanel();
    jScrollPane2 = new javax.swing.JScrollPane();
    jTable2 = new javax.swing.JTable();
    jPanel6 = new javax.swing.JPanel();
    jScrollPane3 = new javax.swing.JScrollPane();
    jTable3 = new javax.swing.JTable();
    jButton5 = new javax.swing.JButton();
    jButton6 = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setLocationByPlatform(true);
    setMaximumSize(new java.awt.Dimension(650, 400));
    setMinimumSize(new java.awt.Dimension(650, 400));
    setUndecorated(true);

    jPanel1.setBackground(new java.awt.Color(153, 153, 153));

    jPanel2.setBackground(new java.awt.Color(204, 204, 204));
    jPanel2.setLayout(new java.awt.BorderLayout());
    jPanel2.add(jButton1, java.awt.BorderLayout.CENTER);

    jButton2.setText("Patient List");
    jButton2.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED,
            java.awt.Color.lightGray, java.awt.Color.darkGray, java.awt.Color.lightGray,
            java.awt.Color.lightGray));
    jButton2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton2ActionPerformed(evt);
        }
    });
    jPanel2.add(jButton2, java.awt.BorderLayout.PAGE_START);

    jButton3.setText("Lab Results");
    jButton3.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton3ActionPerformed(evt);
        }
    });
    jPanel2.add(jButton3, java.awt.BorderLayout.PAGE_END);

    jButton4.setText("Analytics");
    jButton4.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton4ActionPerformed(evt);
        }
    });
    jPanel2.add(jButton4, java.awt.BorderLayout.LINE_END);

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

    jPanel4.setBackground(new java.awt.Color(153, 153, 153));

    jTable1.setModel(
            new javax.swing.table.DefaultTableModel(
                    new Object[][] { { null, null, null, null }, { null, null, null, null },
                            { null, null, null, null }, { null, null, null, null } },
                    new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
    jScrollPane1.setViewportView(jTable1);

    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().addComponent(jScrollPane1,
                            javax.swing.GroupLayout.DEFAULT_SIZE, 502, Short.MAX_VALUE)));
    jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 397, Short.MAX_VALUE));

    jPanel3.add(jPanel4, "card2");

    jPanel5.setBackground(new java.awt.Color(204, 204, 204));

    jTable2.setModel(
            new javax.swing.table.DefaultTableModel(
                    new Object[][] { { null, null, null, null }, { null, null, null, null },
                            { null, null, null, null }, { null, null, null, null } },
                    new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
    jScrollPane2.setViewportView(jTable2);

    javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
    jPanel5.setLayout(jPanel5Layout);
    jPanel5Layout
            .setHorizontalGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING,
                            javax.swing.GroupLayout.DEFAULT_SIZE, 512, Short.MAX_VALUE));
    jPanel5Layout.setVerticalGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING,
                    javax.swing.GroupLayout.DEFAULT_SIZE, 397, Short.MAX_VALUE));

    jPanel3.add(jPanel5, "card2");

    jPanel6.setBackground(new java.awt.Color(153, 153, 153));

    jTable3.setModel(
            new javax.swing.table.DefaultTableModel(
                    new Object[][] { { null, null, null, null }, { null, null, null, null },
                            { null, null, null, null }, { null, null, null, null } },
                    new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
    jScrollPane3.setViewportView(jTable3);

    javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
    jPanel6.setLayout(jPanel6Layout);
    jPanel6Layout
            .setHorizontalGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 512, Short.MAX_VALUE));
    jPanel6Layout.setVerticalGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.TRAILING,
                    javax.swing.GroupLayout.DEFAULT_SIZE, 397, Short.MAX_VALUE));

    jPanel3.add(jPanel6, "card2");

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

    jButton6.setText("BAR CHART");
    jButton6.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton6ActionPerformed(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()
                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButton6).addGap(84, 84, 84).addComponent(jButton5).addGap(24, 24, 24)));
    jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jPanel3, 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))
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup().addGap(11, 11, 11).addComponent(
                                    jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 18,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 18,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)))));

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

    pack();
    setLocationRelativeTo(null);
}

From source file:com.cactus.ClientChatGUI.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 ava  2s . c  om*/
 */

// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
    Message_Area = new JTextField();
    Send_Button = new JButton();
    Back_Button = new JButton();
    jScrollPane1 = new JScrollPane();
    Chat_Area = new JTextArea();

    setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

    Send_Button.setText("Send");
    Send_Button.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            try {
                Send_ButtonActionPerformed(evt);
            } catch (ClientProtocolException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (UnsupportedEncodingException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
    });

    Chat_Area.setColumns(20);
    Chat_Area.setRows(5);
    Chat_Area.setEditable(false);
    jScrollPane1.setViewportView(Chat_Area);

    try {
        updateChatBox();
    } catch (ClientProtocolException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (JSONException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    Back_Button.setText("Back");
    Back_Button.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            Back_ButtonActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout layout = new GroupLayout(getContentPane());
    layout.setHorizontalGroup(layout.createParallelGroup(Alignment.TRAILING).addGroup(layout
            .createSequentialGroup().addContainerGap()
            .addGroup(layout.createParallelGroup(Alignment.TRAILING)
                    .addComponent(jScrollPane1, GroupLayout.DEFAULT_SIZE, 412, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                            .addComponent(
                                    Message_Area, GroupLayout.PREFERRED_SIZE, 337, GroupLayout.PREFERRED_SIZE)
                            .addGap(18)
                            .addGroup(layout.createParallelGroup(Alignment.TRAILING, false)
                                    .addComponent(Back_Button, 0, 0, Short.MAX_VALUE).addComponent(Send_Button,
                                            GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE,
                                            Short.MAX_VALUE))))
            .addContainerGap()));
    layout.setVerticalGroup(layout.createParallelGroup(Alignment.TRAILING).addGroup(layout
            .createSequentialGroup().addContainerGap()
            .addComponent(jScrollPane1, GroupLayout.DEFAULT_SIZE, 199, Short.MAX_VALUE).addGap(18)
            .addGroup(layout.createParallelGroup(Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup().addComponent(Send_Button)
                            .addPreferredGap(ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE)
                            .addComponent(Back_Button))
                    .addComponent(Message_Area, GroupLayout.PREFERRED_SIZE, 68, GroupLayout.PREFERRED_SIZE))
            .addContainerGap()));
    getContentPane().setLayout(layout);

    pack();
}

From source file:gtu.zcognos.SimpleUI.java

private void initGUI() {
    try {//from w  w w.j a  v  a2 s.  com

        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();
            }
            {
                packageId = new JTextField();
            }
            {
                jLabel1 = new JLabel();
                jLabel1.setText("PROJECT_ID");
            }
            {
                jLabel2 = new JLabel();
                jLabel2.setText("PACKAGE_ID");
            }
            {
                jLabel3 = new JLabel();
                jLabel3.setText("DATATABLE");
            }
            {
                jScrollPane1 = new JScrollPane();
                {
                    dataTable = new JTextArea();
                    jScrollPane1.setViewportView(dataTable);
                }
            }
            {
                create = new JButton();
                create.setText("create");
                create.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent evt) {
                        swingUtil.invokeAction("create.actionPerformed", evt);
                    }
                });
            }
            thisLayout.setVerticalGroup(thisLayout.createSequentialGroup().addContainerGap(16, 16)
                    .addGroup(thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                            .addComponent(projectId, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel1, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(thisLayout.createParallelGroup().addGroup(GroupLayout.Alignment.LEADING,
                            thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                                    .addComponent(packageId, GroupLayout.Alignment.BASELINE,
                                            GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel2, GroupLayout.Alignment.BASELINE,
                                            GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
                                            GroupLayout.PREFERRED_SIZE))
                            .addGroup(GroupLayout.Alignment.LEADING,
                                    thisLayout.createSequentialGroup()
                                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 0,
                                                    Short.MAX_VALUE)
                                            .addComponent(create, GroupLayout.PREFERRED_SIZE, 22,
                                                    GroupLayout.PREFERRED_SIZE)))
                    .addComponent(jLabel3, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jScrollPane1, GroupLayout.PREFERRED_SIZE, 217, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap());
            thisLayout.setHorizontalGroup(thisLayout.createSequentialGroup().addContainerGap(31, 31).addGroup(
                    thisLayout.createParallelGroup().addGroup(GroupLayout.Alignment.LEADING, thisLayout
                            .createSequentialGroup()
                            .addGroup(thisLayout.createParallelGroup()
                                    .addComponent(jLabel2, GroupLayout.Alignment.LEADING,
                                            GroupLayout.PREFERRED_SIZE, 103, GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel1, GroupLayout.Alignment.LEADING,
                                            GroupLayout.PREFERRED_SIZE, 103, GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel3, GroupLayout.Alignment.LEADING,
                                            GroupLayout.PREFERRED_SIZE, 103, GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(thisLayout.createParallelGroup()
                                    .addComponent(packageId, GroupLayout.Alignment.LEADING,
                                            GroupLayout.PREFERRED_SIZE, 204, GroupLayout.PREFERRED_SIZE)
                                    .addComponent(projectId, GroupLayout.Alignment.LEADING,
                                            GroupLayout.PREFERRED_SIZE, 204, GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(create, GroupLayout.PREFERRED_SIZE, 88, GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 0, Short.MAX_VALUE))
                            .addGroup(thisLayout.createSequentialGroup()
                                    .addComponent(jScrollPane1, GroupLayout.PREFERRED_SIZE, 417,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addGap(0, 0, Short.MAX_VALUE)))
                    .addContainerGap(17, 17));
        }
        this.setSize(473, 356);

        swingUtil.addAction("create.actionPerformed", new Action() {
            public void action(EventObject evt) throws Exception {
                String project = projectId.getText();
                String dataTab = dataTable.getText();
                Validate.notEmpty(project);
                Validate.notEmpty(dataTab);
                String pkgId = StringUtils.defaultIfEmpty(packageId.getText(), project);

                List<String> dataTableList = new ArrayList<String>();
                StringTokenizer tok = new StringTokenizer(dataTab);
                for (int ii = 0; tok.hasMoreElements(); ii++) {
                    String column = (String) tok.nextElement();
                    System.out.format("%d -- %s\n", ii, column);
                    if (StringUtils.isBlank(column)) {
                        continue;
                    }
                    dataTableList.add(column.trim());
                }

                File destDir = new File(CREATE_DEST + "\\" + project);
                destDir.mkdirs();

                Map<String, Object> map = new HashMap<String, Object>();
                map.put("PROJECT_ID", project);
                map.put("PACKAGE_ID", pkgId);
                map.put("DATATABLE", dataTableList);

                ConfigCopy.getInstance().applyBaseDir(new File(CREATE_DEST)).applyProjectId(project).execute();

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

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

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

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

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

private void initGUI() {
    try {//from   w w  w. j a  va 2s . co m
        BorderLayout thisLayout = new BorderLayout();
        getContentPane().setLayout(thisLayout);
        this.setTitle("\u8b80\u53d6Jsp\u8cc7\u8a0a");
        this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        {
            jTabbedPane1 = new JTabbedPane();
            getContentPane().add(jTabbedPane1, BorderLayout.CENTER);
            {
                jPanel1 = new JPanel();
                BorderLayout jPanel1Layout = new BorderLayout();
                jPanel1.setLayout(jPanel1Layout);
                jTabbedPane1.addTab("jPanel1", null, jPanel1, null);
                {
                    jScrollPane1 = new JScrollPane();
                    jPanel1.add(jScrollPane1, BorderLayout.CENTER);
                    jScrollPane1.setPreferredSize(new java.awt.Dimension(475, 328));
                    {
                        jTree1 = new JTree();
                        jScrollPane1.setViewportView(jTree1);
                        jTree1.setModel(null);
                        jTree1.addMouseListener(new MouseAdapter() {
                            public void mouseClicked(MouseEvent evt) {
                                jTree1MouseClicked(evt);
                            }
                        });
                        jTree1.addTreeSelectionListener(new TreeSelectionListener() {
                            public void valueChanged(TreeSelectionEvent evt) {
                                jTree1ValueChanged(evt);
                            }
                        });
                    }
                }
            }
            {
                jPanel2 = new JPanel();
                jTabbedPane1.addTab("jPanel2", null, jPanel2, null);
                {
                    subFileNameText = new JTextField();
                    jPanel2.add(subFileNameText);
                    subFileNameText.setPreferredSize(new java.awt.Dimension(95, 24));
                    subFileNameText.setText("xhtml");
                }
                {
                    ComboBoxModel jComboBox1Model = new DefaultComboBoxModel(
                            new String[] { "??", "?" });
                    modifyFileBox = new JComboBox();
                    jPanel2.add(modifyFileBox);
                    modifyFileBox.setModel(jComboBox1Model);
                }
                {
                    exportReportToogleBtn = new JToggleButton();
                    jPanel2.add(exportReportToogleBtn);
                    exportReportToogleBtn.setText("\u662f\u5426\u532f\u51fa\u5831\u8868");
                    exportReportToogleBtn.setPreferredSize(new java.awt.Dimension(120, 24));
                    exportReportToogleBtn.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            JCommonUtil.setJToggleButtonText(exportReportToogleBtn,
                                    new String[] { "", "?" });
                        }
                    });
                }
                {
                    projectSrcPathBtn = new JButton();
                    jPanel2.add(projectSrcPathBtn);
                    projectSrcPathBtn.setText("\u8a2d\u5b9a\u5c08\u6848\u76ee\u8def\u4e26\u6383\u63cf");
                    projectSrcPathBtn.setPreferredSize(new java.awt.Dimension(233, 95));
                    projectSrcPathBtn.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            jButton1ActionPerformed(evt);
                        }
                    });
                }
            }
        }
        this.setSize(496, 395);
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:banking.modules.salary_comp.java

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

    jPanel1 = new javax.swing.JPanel();
    jScrollPane1 = new javax.swing.JScrollPane();
    table_salary_comp = new javax.swing.JTable();
    txtBasic = new javax.swing.JTextField();
    txtHouse = new javax.swing.JTextField();
    txtDearness = new javax.swing.JTextField();
    txtTransport = new javax.swing.JTextField();
    txtEntertainment = new javax.swing.JTextField();
    txtMedical = new javax.swing.JTextField();
    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    jLabel3 = new javax.swing.JLabel();
    jLabel4 = new javax.swing.JLabel();
    jLabel5 = new javax.swing.JLabel();
    jLabel6 = new javax.swing.JLabel();
    jButton1 = new javax.swing.JButton();
    Cmd_Save = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

    table_salary_comp
            .setModel(new javax.swing.table.DefaultTableModel(
                    new Object[][] { { null, null, null, null }, { null, null, null, null },
                            { null, null, null, null }, { null, null, null, null } },
                    new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
    table_salary_comp.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            table_salary_compMouseClicked(evt);
        }
    });
    jScrollPane1.setViewportView(table_salary_comp);

    jLabel1.setText("Basic Salary");

    jLabel2.setText("House Allowance");

    jLabel3.setText("Dearness Allowance");

    jLabel4.setText("Transport Allowance");

    jLabel5.setText("Entertainment Allowance");

    jLabel6.setText("Medical Allowance");

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

    Cmd_Save.setText("UPDATE NEW RULES");
    Cmd_Save.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            Cmd_SaveActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING)
            .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap()
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 89,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel3).addComponent(jLabel2))
                    .addGap(85, 85, 85)
                    .addGroup(
                            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(txtBasic, javax.swing.GroupLayout.PREFERRED_SIZE, 130,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(txtHouse, javax.swing.GroupLayout.PREFERRED_SIZE, 130,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(txtDearness, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    130, javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                    38, Short.MAX_VALUE)
                                            .addGroup(jPanel1Layout
                                                    .createParallelGroup(
                                                            javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jLabel4).addComponent(jLabel6)
                                                    .addComponent(jLabel5))
                                            .addGap(45, 45, 45))
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                            .addComponent(Cmd_Save, javax.swing.GroupLayout.PREFERRED_SIZE, 225,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtMedical, javax.swing.GroupLayout.PREFERRED_SIZE, 146,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel1Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(txtTransport, javax.swing.GroupLayout.DEFAULT_SIZE, 146,
                                            Short.MAX_VALUE)
                                    .addComponent(txtEntertainment)))
                    .addGap(98, 98, 98))
            .addGroup(jPanel1Layout.createSequentialGroup().addComponent(jButton1).addGap(0, 0,
                    Short.MAX_VALUE)));
    jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup().addGap(57, 57, 57)
                                    .addComponent(jLabel1).addGap(18, 18, 18))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                    jPanel1Layout.createSequentialGroup().addContainerGap()
                                            .addComponent(txtTransport, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(26, 26, 26)))
                            .addGroup(jPanel1Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(txtHouse, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jLabel5).addComponent(txtEntertainment,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addComponent(jLabel2))
                            .addGap(13, 13, 13)
                            .addGroup(jPanel1Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(txtDearness, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 27,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(txtMedical, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel1Layout.createSequentialGroup().addGap(13, 13, 13)
                                            .addComponent(jLabel3)))
                            .addGap(24, 24, 24).addComponent(Cmd_Save))
                    .addGroup(jPanel1Layout.createSequentialGroup().addGap(49, 49, 49)
                            .addGroup(jPanel1Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(txtBasic, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel4))))
                    .addGap(18, 33, Short.MAX_VALUE)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 45,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18).addComponent(jButton1).addGap(38, 38, 38)));

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

    pack();
}