Example usage for java.lang Short MAX_VALUE

List of usage examples for java.lang Short MAX_VALUE

Introduction

In this page you can find the example usage for java.lang Short MAX_VALUE.

Prototype

short MAX_VALUE

To view the source code for java.lang Short MAX_VALUE.

Click Source Link

Document

A constant holding the maximum value a short can have, 215-1.

Usage

From source file:ca.sfu.federation.viewer.propertysheet.ParametricModelPropertySheetPanel.java

/**
 * ParametricModelPropertySheet constructors.
 *///from   w  w  w.j av a 2s.com
public ParametricModelPropertySheetPanel() {
    lblINamedObject = new JLabel();
    lblINamedObject.setFont(new java.awt.Font("Tahoma", 0, 14));
    lblName = new JLabel();
    lblDescription = new JLabel();
    lblCanonicalName = new JLabel();
    lblClass = new JLabel();
    jtfClass = new JTextField();
    jtfName = new JTextField();
    jtfCanonicalName = new JTextField();
    jtfDescription = new JTextField();

    lblINamedObject.setText("jLabel1");
    lblClass.setText("Class");
    lblName.setText("Name");
    lblDescription.setText("Description");
    lblCanonicalName.setText("Canonical Name");

    jtfClass.setEditable(false);
    jtfCanonicalName.setEditable(false);

    org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout
                    .createSequentialGroup().addContainerGap().add(
                            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(lblINamedObject)
                                    .add(layout
                                            .createSequentialGroup().add(layout
                                                    .createParallelGroup(
                                                            org.jdesktop.layout.GroupLayout.LEADING)
                                                    .add(lblCanonicalName).add(lblClass).add(lblName)
                                                    .add(lblDescription))
                                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                            .add(layout
                                                    .createParallelGroup(
                                                            org.jdesktop.layout.GroupLayout.LEADING)
                                                    .add(jtfName, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                            221, Short.MAX_VALUE)
                                                    .add(jtfClass, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                            221, Short.MAX_VALUE)
                                                    .add(jtfDescription,
                                                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 221,
                                                            Short.MAX_VALUE)
                                                    .add(org.jdesktop.layout.GroupLayout.TRAILING, layout
                                                            .createSequentialGroup()
                                                            .addPreferredGap(
                                                                    org.jdesktop.layout.LayoutStyle.RELATED)
                                                            .add(jtfCanonicalName,
                                                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                                    221, Short.MAX_VALUE)))))
                    .addContainerGap()));
    layout.setVerticalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup().addContainerGap().add(lblINamedObject)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jtfClass, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(lblClass))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jtfName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(lblName))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(lblCanonicalName)
                            .add(jtfCanonicalName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(lblDescription).add(jtfDescription,
                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(168, Short.MAX_VALUE)));

    // get the current object
    this.target = Application.getContext().getModel();

    // disable non editable fields
    this.jtfCanonicalName.setEditable(false);
    this.jtfClass.setEditable(false);

    // set field values
    this.setValues();

    // add action listeners
    jtfName.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jtfNameActionListener(evt);
        }
    });
    jtfDescription.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jtfDescriptionActionListener(evt);
        }
    });
}

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

    jPanel1 = new javax.swing.JPanel();
    promptName = new javax.swing.JLabel();
    promptPass = new javax.swing.JLabel();
    fieldName = new javax.swing.JTextField();
    LoginButton = new javax.swing.JButton();
    Title = new javax.swing.JLabel();
    RegisterButton = new javax.swing.JButton();
    fieldPass = new javax.swing.JPasswordField();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

    promptName.setText("User Name:");

    promptPass.setText("Password:");

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

    LoginButton.setText("Login");
    LoginButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            LoginButtonActionPerformed(evt);
        }
    });

    Title.setText("SSL Chat System");

    RegisterButton.setText("Register");
    RegisterButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            RegisterButtonActionPerformed(evt);
        }
    });

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

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap()
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(promptPass).addComponent(promptName)
                            .addComponent(fieldName, javax.swing.GroupLayout.PREFERRED_SIZE, 150,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(Title)
                            .addGroup(jPanel1Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(fieldPass, javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING,
                                            jPanel1Layout.createSequentialGroup().addComponent(LoginButton)
                                                    .addGap(18, 18, 18).addComponent(RegisterButton))))
                    .addContainerGap(240, Short.MAX_VALUE)));
    jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup().addGap(33, 33, 33).addComponent(Title)
                    .addGap(18, 18, 18).addComponent(promptName)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(fieldName, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(22, 22, 22).addComponent(promptPass)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(fieldPass, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(LoginButton).addComponent(RegisterButton))
                    .addContainerGap(82, Short.MAX_VALUE)));

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

    pack();
}

From source file:gui.configurar.GerarAssinatura.java

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

    jScrollPane1 = new javax.swing.JScrollPane();
    jTextArea1 = new javax.swing.JTextArea();
    jLabel1 = new javax.swing.JLabel();
    jTextField1 = new javax.swing.JTextField();
    jButton1 = new javax.swing.JButton();
    jLabel2 = new javax.swing.JLabel();
    tSenha = new javax.swing.JTextField();
    jLabel3 = new javax.swing.JLabel();
    tContribuinte = new javax.swing.JTextField();
    tDev = new javax.swing.JTextField();
    jLabel4 = new javax.swing.JLabel();
    jButton2 = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

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

    jLabel1.setText("Certificado");

    jTextField1.setEditable(false);

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

    jLabel2.setText("Senha");

    jLabel3.setText("CNPJ Contribuinte");

    jLabel4.setText("CNPJ Desenvolvedor");

    jButton2.setText("Gerar Assinatura Digital");
    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(javax.swing.GroupLayout.Alignment.TRAILING,
                    layout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE).addComponent(jButton2)
                            .addGap(12, 12, 12))
            .addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup().addGroup(layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel3).addComponent(jLabel4))
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addGroup(layout
                                                    .createParallelGroup(
                                                            javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(tDev).addComponent(tContribuinte)))
                                    .addGroup(layout.createSequentialGroup().addComponent(jLabel1)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    108, Short.MAX_VALUE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jButton1)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jLabel2)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(tSenha, javax.swing.GroupLayout.PREFERRED_SIZE, 94,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addContainerGap())
                    .addGroup(layout.createSequentialGroup().addComponent(jScrollPane1).addGap(12, 12, 12)))));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(
            javax.swing.GroupLayout.Alignment.TRAILING,
            layout.createSequentialGroup().addContainerGap().addGroup(layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel1)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton1).addComponent(jLabel2).addComponent(tSenha,
                            javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                            javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3).addComponent(tContribuinte,
                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel4).addComponent(tDev, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jButton2)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 155, Short.MAX_VALUE)
                    .addContainerGap()));

    pack();
}

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

    fileChooser = new javax.swing.JFileChooser();
    jFrame1 = new javax.swing.JFrame();
    jFrame2 = new javax.swing.JFrame();
    jScrollPane1 = new javax.swing.JScrollPane();
    textarea = new javax.swing.JTextArea();
    progressBar = new javax.swing.JProgressBar();
    startButton = new javax.swing.JButton();
    jLabel2 = new javax.swing.JLabel();
    jLabel4 = new javax.swing.JLabel();
    jButton1 = new javax.swing.JButton();
    jScrollPane2 = new javax.swing.JScrollPane();
    jTextPane2 = new javax.swing.JTextPane();
    jLabel1 = new javax.swing.JLabel();
    jLabel3 = new javax.swing.JLabel();
    jLabel5 = new javax.swing.JLabel();
    jLabel6 = new javax.swing.JLabel();
    jLabel7 = new javax.swing.JLabel();
    jLabel8 = new javax.swing.JLabel();
    jLabel9 = new javax.swing.JLabel();
    jLabel10 = new javax.swing.JLabel();
    jLabel11 = new javax.swing.JLabel();
    jMenuBar = new javax.swing.JMenuBar();
    open = new javax.swing.JMenu();
    NewFile = new javax.swing.JMenuItem();
    Open = new javax.swing.JMenuItem();
    Clear = new javax.swing.JMenuItem();
    exit = new javax.swing.JMenuItem();
    jMenu2 = new javax.swing.JMenu();
    jMenuItem1 = new javax.swing.JMenuItem();

    fileChooser.setDialogTitle("This is my open dialog");
    fileChooser.setFileFilter(new MyCustomFilter());

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

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

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

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

    startButton.setIcon(new javax.swing.ImageIcon("C:\\resources\\unnamed.png")); // NOI18N
    startButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            startButtonActionPerformed(evt);
        }
    });

    jLabel2.setIcon(new javax.swing.ImageIcon("C:\\resources\\header.jpg")); // NOI18N

    jLabel4.setText("Input File");

    jButton1.setIcon(new javax.swing.ImageIcon("C:\\resources\\NextButton.jpg")); // NOI18N
    jButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton1ActionPerformed(evt);
        }
    });

    jScrollPane2.setViewportView(jTextPane2);

    jLabel1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
    jLabel1.setText("Before uploading file please make sure:");

    jLabel3.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
    jLabel3.setText("- The code is built through structured programming.");

    jLabel5.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
    jLabel5.setText("- The code is programmed in C/C++.");

    jLabel6.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
    jLabel6.setText("- The code is free of syntax errors.");

    jLabel8.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
    jLabel8.setForeground(new java.awt.Color(255, 51, 51));
    jLabel8.setText("Warning : Please make sure you have a backup available.");

    jLabel9.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
    jLabel9.setText("Steps to run the program:");

    jLabel10.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
    jLabel10.setText("1. Make a new project (File -> New Project) and specify path for output files.");

    jLabel11.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
    jLabel11.setText("2. Select Input File (File -> Open File)");

    jMenuBar.setForeground(new java.awt.Color(51, 51, 255));

    open.setBackground(new java.awt.Color(51, 102, 255));
    open.setText("File");
    open.setMaximumSize(new java.awt.Dimension(30, 32767));
    open.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            openActionPerformed(evt);
        }
    });

    NewFile.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N,
            java.awt.event.InputEvent.CTRL_MASK));
    NewFile.setIcon(new javax.swing.ImageIcon("C:\\resources\\Actions-project-open-icon.png")); // NOI18N
    NewFile.setText("New Project");
    NewFile.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            NewFileActionPerformed(evt);
        }
    });
    open.add(NewFile);

    Open.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F,
            java.awt.event.InputEvent.CTRL_MASK));
    Open.setIcon(new javax.swing.ImageIcon("C:\\resources\\images.jpg")); // NOI18N
    Open.setText("Open File");
    Open.setMaximumSize(new java.awt.Dimension(40000, 32767));
    Open.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            OpenActionPerformed(evt);
        }
    });
    open.add(Open);

    Clear.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C,
            java.awt.event.InputEvent.CTRL_MASK));
    Clear.setIcon(new javax.swing.ImageIcon("C:\\resources\\Broom_icon.png")); // NOI18N
    Clear.setText("Clear");
    Clear.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            ClearActionPerformed(evt);
        }
    });
    open.add(Clear);

    exit.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_E,
            java.awt.event.InputEvent.CTRL_MASK));
    exit.setIcon(new javax.swing.ImageIcon("C:\\resources\\Delete.png")); // NOI18N
    exit.setText("Exit");
    exit.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            exitActionPerformed(evt);
        }
    });
    open.add(exit);

    jMenuBar.add(open);

    jMenu2.setText("Help");

    jMenuItem1.setIcon(new javax.swing.ImageIcon("C:\\resources\\Actions-help-about-icon.png")); // NOI18N
    jMenuItem1.setText("About");
    jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem1ActionPerformed(evt);
        }
    });
    jMenu2.add(jMenuItem1);

    jMenuBar.add(jMenu2);

    setJMenuBar(jMenuBar);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(progressBar, javax.swing.GroupLayout.DEFAULT_SIZE,
                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup().addGroup(layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup().addContainerGap().addComponent(jScrollPane2)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(startButton, javax.swing.GroupLayout.PREFERRED_SIZE, 41,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup().addGroup(layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup().addGap(10, 10, 10).addComponent(jLabel4))
                            .addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 625,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(layout.createSequentialGroup().addGroup(layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel1).addComponent(jLabel9)
                                            .addGroup(layout.createSequentialGroup().addGap(10, 10, 10)
                                                    .addGroup(layout
                                                            .createParallelGroup(
                                                                    javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addComponent(jLabel5).addComponent(jLabel3)
                                                            .addComponent(jLabel6).addComponent(jLabel10)
                                                            .addComponent(jLabel11))))
                                            .addGap(35, 35, 35).addComponent(jLabel7))
                                    .addComponent(jButton1, javax.swing.GroupLayout.Alignment.TRAILING,
                                            javax.swing.GroupLayout.PREFERRED_SIZE, 116,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))))
                            .addGap(0, 0, Short.MAX_VALUE)))
                    .addContainerGap())
            .addGroup(layout.createSequentialGroup().addContainerGap().addComponent(jLabel8)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 59,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                    layout.createSequentialGroup().addGap(177, 177, 177).addComponent(jLabel7))
                            .addGroup(layout.createSequentialGroup().addGap(18, 18, 18).addComponent(jLabel1)
                                    .addGap(33, 33, 33).addComponent(jLabel3)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jLabel5)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jLabel6).addGap(18, 18, 18).addComponent(jLabel8)))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(jLabel9)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel10)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel11)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 19, Short.MAX_VALUE)
                    .addComponent(jLabel4).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 23,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(startButton))
                    .addGap(52, 52, 52)
                    .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 36,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)));

    pack();
}

From source file:com.jwmsolutions.timeCheck.gui.TodoForm.java

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

    GroupLayout layout = new GroupLayout((JComponent) getContentPane());
    getContentPane().setLayout(layout);
    layout.setVerticalGroup(layout.createSequentialGroup().add(getJpnlTime(), 0, 353, Short.MAX_VALUE));
    layout.setHorizontalGroup(layout.createSequentialGroup().add(getJpnlTime(), 0, 352, Short.MAX_VALUE));

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

    pack();
    this.setSize(360, 357);
}

From source file:UserInterface.AdministrativeRole.RequestAnalysis.java

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

    jButton3 = new javax.swing.JButton();
    jButton1 = new javax.swing.JButton();
    backjButton1 = new javax.swing.JButton();
    jButton2 = new javax.swing.JButton();
    ExportBtn = new javax.swing.JButton();

    jButton3.setText("jButton3");

    setBackground(new java.awt.Color(0, 204, 153));
    setPreferredSize(new java.awt.Dimension(1000, 700));

    jButton1.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N
    jButton1.setText("All Request Processing Time");
    jButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton1ActionPerformed(evt);
        }
    });

    backjButton1.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N
    backjButton1.setText("<< Back");
    backjButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            backjButton1ActionPerformed(evt);
        }
    });

    jButton2.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N
    jButton2.setText("Search Request");
    jButton2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton2ActionPerformed(evt);
        }
    });

    ExportBtn.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N
    ExportBtn.setText("Export Request To Excel");
    ExportBtn.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            ExportBtnActionPerformed(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().addGap(325, 325, 325)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(backjButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 112,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(ExportBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 253,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(501, Short.MAX_VALUE)));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addGap(49, 49, 49).addComponent(jButton1)
                    .addGap(18, 18, 18).addComponent(jButton2).addGap(18, 18, 18).addComponent(ExportBtn)
                    .addGap(53, 53, 53).addComponent(backjButton1).addContainerGap(314, Short.MAX_VALUE)));
}

From source file:org.schedoscope.metascope.task.MetastoreTask.java

@Override
@Transactional(propagation = Propagation.REQUIRES_NEW)
public boolean run(long start) {
    LOG.info("Sync repository with metastore");
    HiveConf conf = new HiveConf();
    conf.set("hive.metastore.local", "false");
    conf.setVar(HiveConf.ConfVars.METASTOREURIS, config.getMetastoreThriftUri());
    String principal = config.getKerberosPrincipal();
    if (principal != null && !principal.isEmpty()) {
        conf.setBoolVar(HiveConf.ConfVars.METASTORE_USE_THRIFT_SASL, true);
        conf.setVar(HiveConf.ConfVars.METASTORE_KERBEROS_PRINCIPAL, principal);
        conf.set("hadoop.security.authentication", "kerberos");
        UserGroupInformation.setConfiguration(conf);
    }// w  w  w .j a va 2 s .  co  m

    HiveMetaStoreClient client = null;
    try {
        client = new HiveMetaStoreClient(conf);
    } catch (Exception e) {
        LOG.info("[MetastoreSyncTask] FAILED: Could not connect to hive metastore", e);
        return false;
    }

    FileSystem fs;
    try {
        Configuration hadoopConfig = new Configuration();
        hadoopConfig.set("fs.defaultFS", config.getHdfs());
        fs = FileSystem.get(hadoopConfig);
    } catch (IOException e) {
        LOG.info("[MetastoreSyncTask] FAILED: Could not connect to HDFS", e);
        client.close();
        return false;
    }

    LOG.info("Connected to metastore (" + config.getMetastoreThriftUri() + ")");

    List<String> allTables = metascopeTableRepository.getAllTablesNames();

    for (String fqdn : allTables) {
        //load table
        MetascopeTable table = metascopeTableRepository.findOne(fqdn);
        LOG.info("Get metastore information for table " + table.getFqdn());

        try {
            Table mTable = client.getTable(table.getDatabaseName(), table.getTableName());
            List<Partition> partitions = client.listPartitions(table.getDatabaseName(), table.getTableName(),
                    Short.MAX_VALUE);

            table.setTableOwner(mTable.getOwner());
            table.setCreatedAt(mTable.getCreateTime() * 1000L);
            table.setInputFormat(mTable.getSd().getInputFormat());
            table.setOutputFormat(mTable.getSd().getOutputFormat());
            table.setDataPath(mTable.getSd().getLocation());
            try {
                table.setDataSize(getDirectorySize(fs, table.getDataPath()));
                table.setPermissions(getPermission(fs, table.getDataPath()));
            } catch (IllegalArgumentException e) {
                LOG.warn("Could not retrieve dir size: " + e.getMessage());
                LOG.debug("ERROR: Could not read HDFS metadata", e);
            }

            long maxLastTransformation = -1;

            Hibernate.initialize(table.getViews());
            table.setViewsSize(table.getViews().size());

            for (Partition partition : partitions) {
                MetascopeView view = getView(table.getViews(), partition);
                if (view == null) {
                    //a view which is not registered as a partition in hive metastore should not exists ...
                    continue;
                }
                String numRows = partition.getParameters().get("numRows");
                if (numRows != null) {
                    view.setNumRows(Long.parseLong(numRows));
                }
                String totalSize = partition.getParameters().get("totalSize");
                if (totalSize != null) {
                    view.setTotalSize(Long.parseLong(totalSize));
                }
                String lastTransformation = partition.getParameters().get(SCHEDOSCOPE_TRANSFORMATION_TIMESTAMP);
                if (lastTransformation != null) {
                    long ts = Long.parseLong(lastTransformation);
                    view.setLastTransformation(ts);
                    if (ts > maxLastTransformation) {
                        maxLastTransformation = ts;
                    }
                }
                solrFacade.updateViewEntity(view, false);
            }

            if (maxLastTransformation != -1) {
                table.setLastTransformation(maxLastTransformation);
            } else {
                String ts = mTable.getParameters().get(SCHEDOSCOPE_TRANSFORMATION_TIMESTAMP);
                if (ts != null) {
                    long lastTransformationTs = Long.parseLong(ts);
                    table.setLastTransformation(lastTransformationTs);
                    MetascopeView rootView = table.getViews().get(0);
                    rootView.setLastTransformation(lastTransformationTs);
                    solrFacade.updateViewEntity(rootView, false);
                }
            }

            metascopeTableRepository.save(table);
            solrFacade.updateTablePartial(table, true);
        } catch (Exception e) {
            LOG.warn("Could not retrieve table from metastore", e);
            continue;
        }

    }

    /* commit to index */
    solrFacade.commit();

    client.close();
    try {
        fs.close();
    } catch (IOException e) {
        LOG.warn("Could not close connection to HDFS", e);
    }

    LOG.info("Sync with metastore finished");
    return true;
}

From source file:com.gwac.job.FitsFileCutServiceImpl.java

public void addMissedCutImages() {

    List<OtLevel2> otlv2s = otlv2Dao.getMissedFFCLv2OT();
    //    log.debug(otlv2s.size() + " otlv2s wait to be cut.");
    for (OtLevel2 otlv2 : otlv2s) {
        //      log.debug("otlv2(id=" + otlv2.getOtId() + ") add it's uncutted image to DB.");
        int cuttedFfNumber = otlv2.getCuttedFfNumber();
        List<FitsFileCut> ffcs = ffcDao.getUnCutImageByOtId(otlv2.getOtId(), cuttedFfNumber);
        if (ffcs.isEmpty()) {
            log.warn("otlv2 " + otlv2.getOtId() + " is not cut done, but uncuted ffcs is empty.");
            continue;
        }/*from w  w w .  j a v  a  2 s .co m*/
        otlv2.setCuttedFfNumber(ffcs.get(ffcs.size() - 1).getNumber());
        //      otlv2Dao.update(otlv2);
        otlv2Dao.updateCuttedFfNumber(otlv2);

        //add head missed image
        FitsFileCut headFFC = ffcs.get(0);
        int headNum = headFFC.getNumber();

        if (headNum == otlv2.getFirstFfNumber()) {
            int tNum = headNum - headTailCutNumber;
            if (tNum < 1) {
                tNum = 1; //number start from 1
            }
            for (int i = tNum; i < headNum; i++) {
                String ffName = String.format("%s_%04d.fit", otlv2.getIdentify(), i);
                FitsFile tff = ffDao.getByName(ffName);
                if (tff == null) {
                    log.warn("can't find orig fits file " + ffName);
                    continue;
                }
                FitsFileCut ffc = new FitsFileCut();
                ffc.setFfId(tff.getFfId());
                ffc.setStorePath(headFFC.getStorePath());
                ffc.setFileName(String.format("%s_%04d", otlv2.getName(), i));
                ffc.setOtId(otlv2.getOtId());
                ffc.setNumber(i);
                ffc.setDpmId(headFFC.getDpmId());
                ffc.setImgX(headFFC.getImgX());
                ffc.setImgY(headFFC.getImgY());
                ffc.setRequestCut(false);
                ffc.setSuccessCut(false);
                ffc.setIsMissed(true);
                ffc.setPriority(Short.MAX_VALUE);
                ffcDao.save(ffc);
            }
        }

        //      log.info("add center missed image");
        //add center missed image
        for (int i = 0; i < ffcs.size() - 1; i++) {

            FitsFileCut curFFC = ffcs.get(i);
            int firstNum = curFFC.getNumber();
            int secondNum = ffcs.get(i + 1).getNumber();

            for (int j = firstNum + 1; j < secondNum; j++) {
                //          log.info("add number " + j);
                String ffName = String.format("%s_%04d.fit", otlv2.getIdentify(), j);
                FitsFile tff = ffDao.getByName(ffName);
                FitsFileCut ffc = new FitsFileCut();
                if (tff == null) {
                    log.warn("can't find orig fits file " + ffName);
                    ffc.setFfId((long) 0);
                } else {
                    ffc.setFfId(tff.getFfId());
                }
                ffc.setStorePath(curFFC.getStorePath());
                ffc.setFileName(String.format("%s_%04d", otlv2.getName(), j));
                ffc.setOtId(otlv2.getOtId());
                ffc.setNumber(j);
                ffc.setDpmId(curFFC.getDpmId());
                ffc.setImgX(curFFC.getImgX());
                ffc.setImgY(curFFC.getImgY());
                ffc.setRequestCut(false);
                ffc.setSuccessCut(false);
                ffc.setIsMissed(true);
                ffc.setPriority((short) (j - otlv2.getFirstFfNumber()));
                ffcDao.save(ffc);
            }
        }

        //      log.info("add tail missed image");
        //add tail missed image
        DataProcessMachine dpm = dpmDao.getDpmById(otlv2.getDpmId());
        int curProcessNumber = dpm.getCurProcessNumber();
        FitsFileCut lastFFC = ffcs.get(ffcs.size() - 1);
        int lastNumber = lastFFC.getNumber();
        //      int lastNumber = otlv2.getLastFfNumber();
        //      log.info("curProcessNumber " + curProcessNumber);

        //5(successiveImageNumber)??OT???
        if (curProcessNumber - lastNumber >= successiveImageNumber) {
            int tNum = lastNumber + headTailCutNumber;
            for (int i = lastNumber + 1; i <= tNum; i++) {
                //          log.info("add number " + i);
                String ffName = String.format("%s_%04d.fit", otlv2.getIdentify(), i);
                FitsFile tff = ffDao.getByName(ffName);
                if (tff == null) {
                    log.warn("add missed cut fits file, can't find orig fits file " + ffName);
                    continue;
                }
                FitsFileCut ffc = new FitsFileCut();
                ffc.setFfId(tff.getFfId());
                ffc.setStorePath(lastFFC.getStorePath());
                ffc.setFileName(String.format("%s_%04d", otlv2.getName(), i));
                ffc.setOtId(otlv2.getOtId());
                ffc.setNumber(i);
                ffc.setDpmId(lastFFC.getDpmId());
                ffc.setImgX(lastFFC.getImgX());
                ffc.setImgY(lastFFC.getImgY());
                ffc.setRequestCut(false);
                ffc.setSuccessCut(false);
                ffc.setIsMissed(true);
                ffc.setPriority(Short.MAX_VALUE);
                ffcDao.save(ffc);
            }
            otlv2Dao.updateAllFileCuttedById(otlv2.getOtId());
        }
    }
}

From source file:arduinouno.MainWindow.java

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor./* www. j  a v  a 2s  . c  o m*/
 */
@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();
    jLabel2 = new javax.swing.JLabel();
    jLabel3 = new javax.swing.JLabel();
    jTextA0Reading = new javax.swing.JTextField();
    jTextA1Reading = new javax.swing.JTextField();
    jButtonExit = new javax.swing.JButton();
    jLabel4 = new javax.swing.JLabel();
    jLabel5 = new javax.swing.JLabel();
    jTextA2Reading = new javax.swing.JTextField();
    jTextA3Reading = new javax.swing.JTextField();
    jSeparator3 = new javax.swing.JSeparator();
    jTextA4Reading = new javax.swing.JTextField();
    jLabel6 = new javax.swing.JLabel();
    jTextA5Reading = new javax.swing.JTextField();
    jLabel7 = new javax.swing.JLabel();
    jCheckBoxA0 = new javax.swing.JCheckBox();
    jCheckBoxA1 = new javax.swing.JCheckBox();
    jCheckBoxA2 = new javax.swing.JCheckBox();
    jCheckBoxA3 = new javax.swing.JCheckBox();
    jCheckBoxA4 = new javax.swing.JCheckBox();
    jCheckBoxA5 = new javax.swing.JCheckBox();
    jButtonGuardar = new javax.swing.JButton();
    jButtonSelectFile = new javax.swing.JButton();
    jTextFieldSaveFile = new javax.swing.JTextField();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

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

    jLabel1.setText("Grafico");

    jLabel2.setText("A0");

    jLabel3.setText("A1");

    jTextA0Reading.setEditable(false);
    jTextA0Reading.setHorizontalAlignment(javax.swing.JTextField.CENTER);
    jTextA0Reading.setText("0");

    jTextA1Reading.setEditable(false);
    jTextA1Reading.setHorizontalAlignment(javax.swing.JTextField.CENTER);
    jTextA1Reading.setText("0");

    jButtonExit.setText("Salir");
    jButtonExit.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            jButtonExitMouseClicked(evt);
        }
    });

    jLabel4.setText("A2");

    jLabel5.setText("A3");

    jTextA2Reading.setEditable(false);
    jTextA2Reading.setHorizontalAlignment(javax.swing.JTextField.CENTER);
    jTextA2Reading.setText("0");

    jTextA3Reading.setEditable(false);
    jTextA3Reading.setHorizontalAlignment(javax.swing.JTextField.CENTER);
    jTextA3Reading.setText("0");

    jTextA4Reading.setEditable(false);
    jTextA4Reading.setHorizontalAlignment(javax.swing.JTextField.CENTER);
    jTextA4Reading.setText("0");

    jLabel6.setText("A5");

    jTextA5Reading.setEditable(false);
    jTextA5Reading.setHorizontalAlignment(javax.swing.JTextField.CENTER);
    jTextA5Reading.setText("0");

    jLabel7.setText("A4");

    jCheckBoxA0.setText("jCheckBox1");
    jCheckBoxA0.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            jCheckBoxA0MouseClicked(evt);
        }
    });

    jCheckBoxA1.setText("jCheckBox1");

    jCheckBoxA2.setText("jCheckBox1");

    jCheckBoxA3.setText("jCheckBox1");

    jCheckBoxA4.setText("jCheckBox1");

    jCheckBoxA5.setText("jCheckBox1");

    jButtonGuardar.setText("Guardar");
    jButtonGuardar.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            jButtonGuardarMouseClicked(evt);
        }
    });
    jButtonGuardar.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButtonGuardarActionPerformed(evt);
        }
    });

    jButtonSelectFile.setText("Select File");
    jButtonSelectFile.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButtonSelectFileActionPerformed(evt);
        }
    });

    jTextFieldSaveFile.setEditable(false);
    jTextFieldSaveFile.setHorizontalAlignment(javax.swing.JTextField.LEFT);
    jTextFieldSaveFile.setText("None");

    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().addContainerGap().addComponent(jPanel1,
                            javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                            javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup().addGap(378, 378, 378).addComponent(jLabel1)))
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addGroup(layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
                                                    false)
                                            .addGroup(layout.createSequentialGroup().addGap(2, 2, 2)
                                                    .addGroup(layout
                                                            .createParallelGroup(
                                                                    javax.swing.GroupLayout.Alignment.LEADING,
                                                                    false)
                                                            .addGroup(layout.createSequentialGroup()
                                                                    .addGap(24, 24, 24).addComponent(jLabel4))
                                                            .addGroup(layout.createSequentialGroup()
                                                                    .addGap(25, 25, 25).addComponent(jLabel5))
                                                            .addComponent(jTextA2Reading,
                                                                    javax.swing.GroupLayout.DEFAULT_SIZE, 70,
                                                                    Short.MAX_VALUE)
                                                            .addComponent(jTextA3Reading)))
                                            .addGroup(layout.createSequentialGroup().addGap(27, 27, 27)
                                                    .addComponent(jLabel7))
                                            .addGroup(layout.createSequentialGroup().addGap(28, 28, 28)
                                                    .addComponent(jLabel6))
                                            .addComponent(jTextA5Reading).addComponent(jTextA4Reading))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addGroup(layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jCheckBoxA2, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jCheckBoxA3, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jCheckBoxA4, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jCheckBoxA5, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    20, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addGroup(layout.createSequentialGroup().addGap(14, 14, 14).addGroup(layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jTextA0Reading, javax.swing.GroupLayout.PREFERRED_SIZE, 70,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(layout.createSequentialGroup().addGap(24, 24, 24)
                                                    .addComponent(jLabel2))
                                            .addGroup(layout.createSequentialGroup().addGap(25, 25, 25)
                                                    .addComponent(jLabel3))
                                            .addComponent(jTextA1Reading,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 70,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addGroup(layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jCheckBoxA0, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jCheckBoxA1, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    20, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGap(0, 23, Short.MAX_VALUE))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addGroup(layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                                    false)
                                            .addComponent(jButtonExit, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(jSeparator3, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    111, Short.MAX_VALUE)
                                            .addComponent(jButtonGuardar, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(jButtonSelectFile,
                                                    javax.swing.GroupLayout.Alignment.LEADING,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(jTextFieldSaveFile))
                                    .addContainerGap()))));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addComponent(jLabel1).addGroup(layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup().addGap(15, 15, 15).addComponent(jLabel2)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jTextA0Reading, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jCheckBoxA0))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jLabel3)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jTextA1Reading, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jCheckBoxA1))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jLabel4)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jTextA2Reading, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jCheckBoxA2))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jLabel5)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jTextA3Reading, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jCheckBoxA3))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jLabel7)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jTextA4Reading, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jCheckBoxA4))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jLabel6)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jTextA5Reading, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jCheckBoxA5))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, 12,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jTextFieldSaveFile, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jButtonSelectFile)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButtonGuardar)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jButtonExit).addContainerGap())
                    .addGroup(layout.createSequentialGroup()
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)))));

    pack();
}

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

    backButton = new javax.swing.JButton();
    viewButton = new javax.swing.JButton();
    jLabel5 = new javax.swing.JLabel();
    jLabel6 = new javax.swing.JLabel();
    jLabel7 = new javax.swing.JLabel();
    jLabel10 = new javax.swing.JLabel();
    jDateChooser1 = new com.toedter.calendar.JDateChooser();
    jDateChooser2 = new com.toedter.calendar.JDateChooser();
    tankName = new javax.swing.JTextField();
    jPanel1 = new javax.swing.JPanel();
    report = new javax.swing.JPanel();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

    backButton.setText("Back");
    backButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            backButtonActionPerformed(evt);
        }
    });

    viewButton.setText("Graphical view");
    viewButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            viewButtonActionPerformed(evt);
        }
    });

    jLabel5.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N
    jLabel5.setText("Search Water Level & other Details");

    jLabel6.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
    jLabel6.setText("Tank Name :");

    jLabel7.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
    jLabel7.setText("Start Date  :");

    jLabel10.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
    jLabel10.setText("End Date  :");

    jDateChooser1.setDateFormatString("yyyy-MM-dd");

    jDateChooser2.setDateFormatString("yyyy-MM-dd");

    jPanel1.setLayout(new javax.swing.BoxLayout(jPanel1, javax.swing.BoxLayout.LINE_AXIS));

    report.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Report",
            javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
            javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 18))); // NOI18N
    report.setLayout(new javax.swing.BoxLayout(report, javax.swing.BoxLayout.LINE_AXIS));

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addGap(181, 181, 181).addComponent(jLabel5).addGap(0, 0,
                    Short.MAX_VALUE))
            .addGroup(layout.createSequentialGroup()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup().addGap(37, 37, 37)
                                    .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 82,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(tankName, javax.swing.GroupLayout.PREFERRED_SIZE, 176,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(46, 46, 46)
                                    .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 74,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jDateChooser1, javax.swing.GroupLayout.PREFERRED_SIZE, 120,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(18, 18, 18)
                                    .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 68,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                            jDateChooser2, javax.swing.GroupLayout.PREFERRED_SIZE, 120,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup().addGap(24, 24, 24)
                                    .addComponent(report, javax.swing.GroupLayout.PREFERRED_SIZE, 694,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                            jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
                                                    false)
                                            .addComponent(viewButton, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(backButton, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(
            javax.swing.GroupLayout.Alignment.TRAILING,
            layout.createSequentialGroup().addContainerGap()
                    .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 33,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel6)
                                    .addComponent(tankName, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel7))
                            .addComponent(jDateChooser1, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jDateChooser2, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel10))
                    .addGap(18, 18, 18)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup().addGap(49, 49, 49).addComponent(
                                            jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(layout.createSequentialGroup().addComponent(viewButton)
                                            .addPreferredGap(
                                                    javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(backButton)))
                            .addComponent(report, javax.swing.GroupLayout.PREFERRED_SIZE, 406,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(24, Short.MAX_VALUE)));

    pack();
}