Example usage for javax.swing GroupLayout setHorizontalGroup

List of usage examples for javax.swing GroupLayout setHorizontalGroup

Introduction

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

Prototype

public void setHorizontalGroup(Group group) 

Source Link

Document

Sets the Group that positions and sizes components along the horizontal axis.

Usage

From source file:misc.TextAreaPrintingDemo.java

/** This method is called from within the constructor to
 * initialize the form.// ww w  .j a  v  a 2s. c  om
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
// <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:org.nekorp.workflow.desktop.view.EventoDiagnosticoView.java

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

    jToolBar1 = new javax.swing.JToolBar();
    evidencias = new javax.swing.JButton();
    borrar = new javax.swing.JButton();
    jLabel1 = new javax.swing.JLabel();
    responsable = new org.nekorp.workflow.desktop.view.binding.SimpleBindableJTextField();
    fechaCreacionLabel = new org.nekorp.workflow.desktop.view.binding.FormatedJLabel(dateConverter);
    jLabel2 = new javax.swing.JLabel();
    jLabel3 = new javax.swing.JLabel();
    jScrollPane2 = new org.nekorp.workflow.desktop.view.resource.imp.MouseFreeJScrollPane();
    diagnostico = new org.nekorp.workflow.desktop.view.binding.SimpleBindableJTextArea();

    setBackground(new java.awt.Color(255, 255, 255));
    setMaximumSize(new java.awt.Dimension(32767, 65));

    jToolBar1.setBorder(null);
    jToolBar1.setFloatable(false);
    jToolBar1.setRollover(true);

    evidencias.setBackground(new java.awt.Color(255, 255, 255));
    evidencias.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
    evidencias.setText("Evidencias");
    evidencias.setFocusable(false);
    evidencias.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    evidencias.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    evidencias.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            evidenciasActionPerformed(evt);
        }
    });
    jToolBar1.add(evidencias);

    borrar.setBackground(new java.awt.Color(255, 255, 255));
    borrar.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
    borrar.setText("Borrar");
    borrar.setFocusable(false);
    borrar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    borrar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    borrar.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            borrarActionPerformed(evt);
        }
    });
    jToolBar1.add(borrar);

    jLabel1.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
    jLabel1.setText("Responsable:");

    responsable.setBackground(new java.awt.Color(224, 230, 230));
    responsable.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
    responsable.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(224, 230, 230), 4));

    fechaCreacionLabel.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
    fechaCreacionLabel.setText("12/12/2012");

    jLabel2.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
    jLabel2.setText("Creado el dia:");

    jLabel3.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
    jLabel3.setText("Diagnostico:");

    jScrollPane2.setBorder(null);
    jScrollPane2.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    jScrollPane2.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
    jScrollPane2.setWheelScrollingEnabled(false);

    diagnostico.setBackground(new java.awt.Color(224, 230, 230));
    diagnostico.setColumns(20);
    diagnostico.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
    diagnostico.setLineWrap(true);
    diagnostico.setRows(2);
    diagnostico.setBorder(null);
    jScrollPane2.setViewportView(diagnostico);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addContainerGap()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                    .addComponent(responsable, javax.swing.GroupLayout.DEFAULT_SIZE, 59,
                                            Short.MAX_VALUE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jLabel2)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(fechaCreacionLabel, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jScrollPane2))
                    .addContainerGap()));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel1)
                                    .addComponent(responsable, javax.swing.GroupLayout.PREFERRED_SIZE, 20,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(fechaCreacionLabel).addComponent(jLabel2))
                            .addComponent(jToolBar1, 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.LEADING)
                            .addComponent(jLabel3).addComponent(jScrollPane2,
                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))));
}

From source file:ANNFileDetect.detectFile.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  v a  2 s.co m
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    FileBox = new javax.swing.JTextField();
    jButton1 = new javax.swing.JButton();
    Result = new javax.swing.JLabel();
    ResField = new javax.swing.JTextField();
    jLabel1 = new javax.swing.JLabel();
    Detection = new javax.swing.JButton();
    GPanel = new javax.swing.JPanel();
    jButton2 = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

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

    Result.setText("Result:");

    ResField.setEnabled(false);

    jLabel1.setText("Result Breakdown");

    Detection.setText("Detect!");
    Detection.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            DetectionActionPerformed(evt);
        }
    });

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

    jButton2.setText("Get detailed results");
    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().addContainerGap().addGroup(layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(GPanel, javax.swing.GroupLayout.Alignment.TRAILING,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                            Short.MAX_VALUE)
                    .addComponent(ResField)
                    .addGroup(layout.createSequentialGroup().addGroup(layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(layout.createSequentialGroup()
                                            .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 178,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(FileBox, javax.swing.GroupLayout.PREFERRED_SIZE, 623,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addComponent(jLabel1).addComponent(Result)
                                    .addComponent(Detection, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addComponent(jButton2)).addGap(0, 0, Short.MAX_VALUE)))
                    .addContainerGap()));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addContainerGap()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jButton1).addComponent(FileBox,
                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(9, 9, 9).addComponent(Detection).addGap(18, 18, 18).addComponent(Result)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(ResField, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel1)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(GPanel, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jButton2)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    pack();
}

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

    jLabel1 = new javax.swing.JLabel();
    jSeparator1 = new javax.swing.JSeparator();
    jScrollPane2 = new javax.swing.JScrollPane();
    table = new javax.swing.JTable();
    goBackBtn = new javax.swing.JButton();
    graphPanel = new javax.swing.JPanel();
    stockPerfm = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setResizable(false);

    jLabel1.setText("Stock Market");

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

    }, new String[] { "Symbol", "Stock Name", "Public", "Sector", "Volume", "Currency", "Opening Price",
            "Closing Price", "High", "Low", "Date" }) {
        Class[] types = new Class[] { java.lang.String.class, java.lang.String.class, java.lang.String.class,
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class,
                java.lang.String.class, java.lang.String.class, java.lang.String.class,
                java.lang.String.class };
        boolean[] canEdit = new boolean[] { false, false, false, false, false, false, false, false, false,
                false, false };

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

        public boolean isCellEditable(int rowIndex, int columnIndex) {
            return canEdit[columnIndex];
        }
    });
    table.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
    jScrollPane2.setViewportView(table);

    goBackBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/stockit/rsz_undo.png"))); // NOI18N
    goBackBtn.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
    goBackBtn.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            goBackBtnActionPerformed(evt);
        }
    });

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

    stockPerfm.setText("View Stock Performance");
    stockPerfm.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
    stockPerfm.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            stockPerfmActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.TRAILING)
            .addGroup(layout.createSequentialGroup().addGroup(layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 829, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup().addGap(364, 364, 364).addComponent(jLabel1)
                            .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup().addContainerGap()
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(goBackBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 124,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(stockPerfm, javax.swing.GroupLayout.PREFERRED_SIZE, 184,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(graphPanel, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addContainerGap()));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addContainerGap().addComponent(jLabel1)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 94,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                    .addComponent(stockPerfm, javax.swing.GroupLayout.PREFERRED_SIZE, 34,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 297,
                                            Short.MAX_VALUE)
                                    .addComponent(goBackBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 100,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(29, 29, 29))
                            .addGroup(layout.createSequentialGroup()
                                    .addComponent(graphPanel, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addContainerGap()))));

    pack();
}

From source file:userInterface.cdcRole.OverviewJPanel.java

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

    jPanel1 = new javax.swing.JPanel();
    jComboBox1 = new javax.swing.JComboBox();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTable1 = new javax.swing.JTable();
    jButton2 = new javax.swing.JButton();
    jScrollPane2 = new javax.swing.JScrollPane();
    jTable2 = new javax.swing.JTable();
    jButton1 = new javax.swing.JButton();

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

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

    jComboBox1.setModel(// w  w w  . j a v a 2  s.  com
            new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
    jComboBox1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jComboBox1ActionPerformed(evt);
        }
    });

    jTable1.setModel(
            new javax.swing.table.DefaultTableModel(new Object[][] { { null } }, new String[] { "Hospials" }));
    jScrollPane1.setViewportView(jTable1);

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

    jTable2.setModel(new javax.swing.table.DefaultTableModel(new Object[][] { { null, null } },
            new String[] { "Vaccine", "Inventory" }));
    jScrollPane2.setViewportView(jTable2);

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

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup().addGap(618, 618, 618).addComponent(
                                    jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 176,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup().addGap(43, 43, 43)
                                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 695,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(18, 18, 18).addComponent(jButton2).addGap(18, 18, 18)
                                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 191,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(18, 18, 18).addComponent(jButton1).addGap(18, 18, 18)
                                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 289,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addContainerGap(1304, Short.MAX_VALUE)));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addGap(11, 11, 11)
                    .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup().addGap(48, 48, 48)
                                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 468,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(46, 46, 46))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                                    layout.createSequentialGroup()
                                                            .addComponent(jButton2,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 160,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addGap(194, 194, 194))
                                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                                    layout.createSequentialGroup()
                                                            .addComponent(jButton1,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 167,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addGap(193, 193, 193))))))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                    layout.createSequentialGroup().addContainerGap()
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 533,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 533,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addContainerGap()));
}

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

    panelDescriptionJLabel = new javax.swing.JLabel();
    jScrollPane1 = new javax.swing.JScrollPane();
    vaccineJTable = new javax.swing.JTable();
    viewJLabel = new javax.swing.JLabel();
    jScrollPane2 = new javax.swing.JScrollPane();
    wastageJTable = new javax.swing.JTable();
    backJButton = new javax.swing.JButton();
    clickJButton = new javax.swing.JButton();
    listJLabel = new javax.swing.JLabel();
    totalWastageJLabel = new javax.swing.JLabel();
    totalWastageJTextField = new javax.swing.JTextField();
    summarizeJButton = new javax.swing.JButton();

    panelDescriptionJLabel.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N
    panelDescriptionJLabel.setText("Vaccine Wastage Record");

    vaccineJTable.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
    vaccineJTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object[][] { { null, null }, { null, null }, { null, null }, { null, null } },
            new String[] { "Vaccines", "Disease" }));
    vaccineJTable.setRowHeight(25);
    jScrollPane1.setViewportView(vaccineJTable);

    viewJLabel.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
    viewJLabel.setText("View Wastage Details");

    wastageJTable.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
    wastageJTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object[][] { { null, null }, { null, null }, { null, null }, { null, null } },
            new String[] { "Manufacturing Batch", "Wasted Quantity" }));
    wastageJTable.setRowHeight(25);
    jScrollPane2.setViewportView(wastageJTable);

    backJButton.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
    backJButton.setText("<< Back");
    backJButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            backJButtonActionPerformed(evt);
        }
    });

    clickJButton.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
    clickJButton.setText("Click Here!");
    clickJButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            clickJButtonActionPerformed(evt);
        }
    });

    listJLabel.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
    listJLabel.setText("List of vaccines:");

    totalWastageJLabel.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
    totalWastageJLabel.setText("Total Wastage");

    totalWastageJTextField.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N

    summarizeJButton.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
    summarizeJButton.setText("Summarize graphically");
    summarizeJButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            summarizeJButtonActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup().addGroup(layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 817,
                                    Short.MAX_VALUE)
                            .addGroup(layout.createSequentialGroup().addGroup(layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(panelDescriptionJLabel)
                                    .addGroup(layout.createSequentialGroup().addComponent(viewJLabel)
                                            .addGap(18, 18, 18).addComponent(clickJButton))
                                    .addComponent(listJLabel)
                                    .addGroup(layout.createSequentialGroup()
                                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    542, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(31, 31, 31).addComponent(summarizeJButton,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 201,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addGap(0, 0, Short.MAX_VALUE)))
                            .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                            .addGap(0, 0, Short.MAX_VALUE).addComponent(totalWastageJLabel).addGap(31, 31, 31)
                            .addComponent(totalWastageJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 92,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(121, 121, 121))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                            layout.createSequentialGroup().addComponent(backJButton)
                                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addContainerGap().addComponent(panelDescriptionJLabel)
                    .addGap(24, 24, 24).addComponent(listJLabel)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 127,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(28, 28, 28))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                    layout.createSequentialGroup().addComponent(summarizeJButton).addGap(69, 69,
                                            69)))
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(viewJLabel).addComponent(clickJButton))
                    .addGap(18, 18, 18)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 127,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(totalWastageJLabel).addComponent(totalWastageJTextField,
                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(30, 30, 30).addComponent(backJButton).addContainerGap(23, Short.MAX_VALUE)));
}

From source file:qmod.generator.MainWindow.java

@SuppressWarnings("unchecked")
public MainWindow() {
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setTitle("Quick Mod Generator");

    JLabel lblAuthors = new JLabel("Authors:");

    authorField1 = new JTextField();
    authorField1.setColumns(25);//from  ww  w. j a v a2  s. c  o m

    JButton btnGenerateFile = new JButton("Generate File");
    btnGenerateFile.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            writeFiles();
        }
    });

    authCombo1.setFont(new Font("Dialog", Font.BOLD, 8));
    authCombo1.setModel(
            (ComboBoxModel<Object>) new DefaultComboBoxModel<Object>(new String[] { "Author", "Maintainer" }));
    authCombo1.setSelectedIndex(0);

    authCombo2.setFont(new Font("Dialog", Font.BOLD, 8));
    authCombo2.setModel(
            (ComboBoxModel<Object>) new DefaultComboBoxModel<Object>(new String[] { "Author", "Maintainer" }));
    authCombo2.setSelectedIndex(0);

    authorField2 = new JTextField();
    authorField2.setColumns(25);

    authCombo3.setFont(new Font("Dialog", Font.BOLD, 8));
    authCombo3.setModel(
            (ComboBoxModel<Object>) new DefaultComboBoxModel<Object>(new String[] { "Author", "Maintainer" }));
    authCombo3.setSelectedIndex(0);

    authorField3 = new JTextField();
    authorField3.setColumns(25);

    JLabel lblCategories = new JLabel("Categories:");

    categoriesField = new JTextField();
    categoriesField.setColumns(10);

    JLabel lblDescription = new JLabel("Description:");

    JEditorPane descriptionField = new JEditorPane();

    JLabel lblLicense = new JLabel("License:");

    licenseField = new JTextField();
    licenseField.setColumns(10);
    GroupLayout groupLayout = new GroupLayout(getContentPane());
    groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.LEADING)
            .addGroup(groupLayout.createSequentialGroup().addContainerGap()
                    .addGroup(groupLayout.createParallelGroup(Alignment.LEADING).addGroup(groupLayout
                            .createSequentialGroup()
                            .addGroup(groupLayout.createParallelGroup(Alignment.LEADING).addGroup(groupLayout
                                    .createParallelGroup(Alignment.TRAILING).addComponent(btnGenerateFile)
                                    .addGroup(groupLayout.createSequentialGroup().addComponent(lblAuthors)
                                            .addPreferredGap(ComponentPlacement.RELATED).addGroup(groupLayout
                                                    .createParallelGroup(Alignment.LEADING).addGroup(groupLayout
                                                            .createSequentialGroup()
                                                            .addComponent(
                                                                    authCombo2, GroupLayout.PREFERRED_SIZE, 81,
                                                                    GroupLayout.PREFERRED_SIZE)
                                                            .addGap(6).addComponent(authorField2,
                                                                    GroupLayout.PREFERRED_SIZE, 192,
                                                                    GroupLayout.PREFERRED_SIZE))
                                                    .addGroup(groupLayout.createSequentialGroup().addComponent(
                                                            authCombo1, GroupLayout.PREFERRED_SIZE, 81,
                                                            GroupLayout.PREFERRED_SIZE).addPreferredGap(
                                                                    ComponentPlacement.RELATED)
                                                            .addComponent(
                                                                    authorField1, GroupLayout.DEFAULT_SIZE, 264,
                                                                    Short.MAX_VALUE))
                                                    .addGroup(groupLayout.createSequentialGroup()
                                                            .addComponent(authCombo3,
                                                                    GroupLayout.PREFERRED_SIZE, 81,
                                                                    GroupLayout.PREFERRED_SIZE)
                                                            .addGap(6).addGroup(groupLayout.createParallelGroup(
                                                                    Alignment.LEADING).addComponent(
                                                                            descriptionField)
                                                                    .addGroup(groupLayout
                                                                            .createParallelGroup(
                                                                                    Alignment.LEADING, false)
                                                                            .addComponent(categoriesField)
                                                                            .addComponent(
                                                                                    authorField3,
                                                                                    GroupLayout.DEFAULT_SIZE,
                                                                                    192, Short.MAX_VALUE))
                                                                    .addGroup(groupLayout
                                                                            .createSequentialGroup()
                                                                            .addComponent(licenseField,
                                                                                    GroupLayout.DEFAULT_SIZE,
                                                                                    192, Short.MAX_VALUE)
                                                                            .addPreferredGap(
                                                                                    ComponentPlacement.RELATED)))))))
                                    .addComponent(lblCategories).addComponent(lblDescription))
                            .addGap(84))
                            .addGroup(groupLayout.createSequentialGroup().addComponent(lblLicense)
                                    .addContainerGap(377, Short.MAX_VALUE)))));
    groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.LEADING).addGroup(groupLayout
            .createSequentialGroup().addContainerGap()
            .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE).addComponent(lblAuthors)
                    .addComponent(authorField1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addComponent(authCombo1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE))
            .addPreferredGap(ComponentPlacement.RELATED)
            .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                    .addComponent(authCombo2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addGroup(groupLayout.createSequentialGroup().addGap(3).addComponent(authorField2,
                            GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
            .addPreferredGap(ComponentPlacement.RELATED)
            .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                    .addComponent(authCombo3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addGroup(groupLayout.createSequentialGroup().addGap(3).addComponent(authorField3,
                            GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
            .addPreferredGap(ComponentPlacement.RELATED)
            .addGroup(groupLayout.createParallelGroup(Alignment.LEADING).addComponent(lblCategories)
                    .addComponent(categoriesField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE))
            .addPreferredGap(ComponentPlacement.RELATED)
            .addGroup(groupLayout.createParallelGroup(Alignment.LEADING).addComponent(lblDescription)
                    .addComponent(descriptionField, GroupLayout.PREFERRED_SIZE, 100,
                            GroupLayout.PREFERRED_SIZE))
            .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                    .addGroup(groupLayout.createSequentialGroup().addGap(9).addComponent(lblLicense))
                    .addGroup(groupLayout.createSequentialGroup().addPreferredGap(ComponentPlacement.RELATED)
                            .addComponent(licenseField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE)))
            .addPreferredGap(ComponentPlacement.RELATED, 322, Short.MAX_VALUE).addComponent(btnGenerateFile)
            .addContainerGap()));
    getContentPane().setLayout(groupLayout);

    JMenuBar menuBar = new JMenuBar();
    setJMenuBar(menuBar);

    JMenu mnFile = new JMenu("File");
    mnFile.setMnemonic('F');
    menuBar.add(mnFile);

    JMenuItem mntmNew = new JMenuItem("New");
    mntmNew.setMnemonic(KeyEvent.VK_N);
    mnFile.add(mntmNew);

    JMenuItem mntmOpen = new JMenuItem("Open");
    mnFile.add(mntmOpen);

    JMenuItem mntmSave = new JMenuItem("Save");
    mnFile.add(mntmSave);

    JMenuItem mntmExit = new JMenuItem("Exit");
    mntmExit.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            System.exit(0);
        }
    });
    mntmExit.setMnemonic(KeyEvent.VK_X);
    mnFile.add(mntmExit);
}

From source file:com.akman.excel.view.frmSelectImage.java

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor.//from  w  ww. j  a v a 2  s  .  com
 */
@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();
    lblImage = new javax.swing.JLabel();
    txtPath = new javax.swing.JTextField();
    btnSelectImage = new javax.swing.JButton();
    btnSave = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

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

    jLabel1.setBackground(new java.awt.Color(0, 102, 153));
    jLabel1.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    jLabel1.setForeground(new java.awt.Color(255, 255, 255));
    jLabel1.setText(" Select Image File");
    jLabel1.setOpaque(true);

    lblImage.setBackground(new java.awt.Color(102, 102, 102));
    lblImage.setOpaque(true);

    txtPath.setEnabled(false);

    btnSelectImage.setText("Attach Image");
    btnSelectImage.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnSelectImageActionPerformed(evt);
        }
    });

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

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                    Short.MAX_VALUE)
            .addGroup(jPanel1Layout.createSequentialGroup().addGap(47, 47, 47)
                    .addGroup(jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(lblImage, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(txtPath, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
                            .addComponent(btnSelectImage, javax.swing.GroupLayout.Alignment.TRAILING,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, 128, Short.MAX_VALUE)
                            .addComponent(btnSave, javax.swing.GroupLayout.Alignment.TRAILING,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE))
                    .addContainerGap(61, Short.MAX_VALUE)));
    jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 41,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(lblImage, javax.swing.GroupLayout.PREFERRED_SIZE, 102,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(48, 48, 48)
                    .addComponent(txtPath, javax.swing.GroupLayout.PREFERRED_SIZE, 30,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(btnSelectImage, javax.swing.GroupLayout.DEFAULT_SIZE, 30, Short.MAX_VALUE)
                    .addGap(30, 30, 30).addComponent(btnSave, javax.swing.GroupLayout.PREFERRED_SIZE, 35,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap()));

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .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();
    setLocationRelativeTo(null);
}

From source file:examples.monalisa.gui.GeneticDrawingView.java

/** This method is called from within the constructor to
 * initialize the form.// w  ww  .j a  va2s .c  om
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
    mainPanel = new javax.swing.JPanel();
    chooseImage = new javax.swing.JButton();
    startEvolution = new javax.swing.JToggleButton();
    targetImageLabel = new javax.swing.JLabel();
    JFreeChart chart = ChartFactory.createXYLineChart("Fitness versus Generation", "Generation", "Fitness",
            new XYSeriesCollection(new XYSeries("")), org.jfree.chart.plot.PlotOrientation.VERTICAL, false,
            false, false);
    chartPanel = new ChartPanel(chart);
    menuBar = new javax.swing.JMenuBar();
    javax.swing.JMenu fileMenu = new javax.swing.JMenu();
    javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem();
    javax.swing.JMenu helpMenu = new javax.swing.JMenu();
    javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem();
    mainPanel.setName("mainPanel"); // NOI18N
    javax.swing.ActionMap actionMap = org.jdesktop.application.Application
            .getInstance(examples.monalisa.gui.GeneticDrawingApp.class).getContext()
            .getActionMap(GeneticDrawingView.class, this);
    chooseImage.setAction(actionMap.get("chooseImage")); // NOI18N
    org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application
            .getInstance(examples.monalisa.gui.GeneticDrawingApp.class).getContext()
            .getResourceMap(GeneticDrawingView.class);
    chooseImage.setText(resourceMap.getString("chooseImage.text")); // NOI18N
    chooseImage.setName("chooseImage"); // NOI18N
    startEvolution.setAction(actionMap.get("startEvolution")); // NOI18N
    startEvolution.setText(resourceMap.getString("startEvolution.text")); // NOI18N
    startEvolution.setName("startEvolution"); // NOI18N
    targetImageLabel.setIcon(resourceMap.getIcon("targetImageLabel.icon")); // NOI18N
    targetImageLabel.setText(resourceMap.getString("targetImageLabel.text")); // NOI18N
    targetImageLabel.setName("targetImageLabel"); // NOI18N
    chartPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    chartPanel.setName("chartPanel"); // NOI18N
    org.jdesktop.layout.GroupLayout chartPanelLayout = new org.jdesktop.layout.GroupLayout(chartPanel);
    chartPanel.setLayout(chartPanelLayout);
    chartPanelLayout.setHorizontalGroup(chartPanelLayout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(0, 399, Short.MAX_VALUE));
    chartPanelLayout.setVerticalGroup(chartPanelLayout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(0, 234, Short.MAX_VALUE));
    org.jdesktop.layout.GroupLayout mainPanelLayout = new org.jdesktop.layout.GroupLayout(mainPanel);
    mainPanel.setLayout(mainPanelLayout);
    mainPanelLayout.setHorizontalGroup(mainPanelLayout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(mainPanelLayout.createSequentialGroup().add(mainPanelLayout
                    .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(mainPanelLayout.createSequentialGroup().add(47, 47, 47).add(chooseImage)
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED).add(startEvolution)
                            .add(38, 38, 38))
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, mainPanelLayout.createSequentialGroup()
                            .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .add(targetImageLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 200,
                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(80, 80, 80)))
                    .add(chartPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap()));
    mainPanelLayout.setVerticalGroup(mainPanelLayout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, mainPanelLayout.createSequentialGroup()
                    .addContainerGap()
                    .add(mainPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(org.jdesktop.layout.GroupLayout.LEADING, chartPanel,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .add(mainPanelLayout.createSequentialGroup()
                                    .add(targetImageLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 202,
                                            Short.MAX_VALUE)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(mainPanelLayout
                                            .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                            .add(startEvolution).add(chooseImage))))
                    .addContainerGap()));
    chooseImage.getAccessibleContext()
            .setAccessibleName(resourceMap.getString("jButton1.AccessibleContext.accessibleName")); // NOI18N
    menuBar.setName("menuBar"); // NOI18N
    fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N
    fileMenu.setName("fileMenu"); // NOI18N
    exitMenuItem.setAction(actionMap.get("quit")); // NOI18N
    exitMenuItem.setName("exitMenuItem"); // NOI18N
    fileMenu.add(exitMenuItem);
    menuBar.add(fileMenu);
    helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N
    helpMenu.setName("helpMenu"); // NOI18N
    aboutMenuItem.setAction(actionMap.get("showAboutBox")); // NOI18N
    aboutMenuItem.setName("aboutMenuItem"); // NOI18N
    helpMenu.add(aboutMenuItem);
    menuBar.add(helpMenu);
    setComponent(mainPanel);
    setMenuBar(menuBar);
}

From source file:metodosnumericos.VentanaMetododeNewton.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 v a 2 s  .c om
 */
@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();
    txtX0 = new javax.swing.JTextField();
    txtTolerancia = new javax.swing.JTextField();
    txtIteraciones = new javax.swing.JTextField();
    jButton1 = new javax.swing.JButton();
    butCalcular = new javax.swing.JButton();
    jLabel1 = new javax.swing.JLabel();
    txtFdx = new javax.swing.JTextField();
    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("Xo:");

    jLabel3.setText("Tolerancia:");

    jLabel4.setText("Iteraciones:");

    txtX0.setText("Xo");

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

    jLabel1.setText("f'(x)=");

    txtFdx.setText("f'(x)");

    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().addContainerGap().addGroup(layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jLabel3).addComponent(jLabel2).addComponent(jLabel4)
                                    .addComponent(jLabel1))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup(
                                    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addComponent(txtX0).addComponent(txtTolerancia)
                                            .addComponent(txtIteraciones, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    95, Short.MAX_VALUE)
                                            .addComponent(txtFdx)))
                    .addGroup(layout.createSequentialGroup().addComponent(jButton1).addGap(53, 53, 53)
                            .addComponent(butCalcular))
                    .addGroup(layout.createSequentialGroup().addGap(4, 4, 4).addComponent(jButton2)))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 391,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addContainerGap().addComponent(jButton2).addGap(39, 39, 39)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2).addComponent(txtX0, 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(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(jLabel4).addComponent(txtIteraciones,
                                    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(jLabel1).addComponent(txtFdx, 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))
                    .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                    layout.createSequentialGroup().addGap(0, 36, Short.MAX_VALUE).addComponent(jTabbedPane1,
                            javax.swing.GroupLayout.PREFERRED_SIZE, 327,
                            javax.swing.GroupLayout.PREFERRED_SIZE)));

    pack();
}