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

    desktopPane = new javax.swing.JDesktopPane();
    statusPanel = new javax.swing.JPanel();
    statusLabel = new javax.swing.JLabel();
    jPanel2 = new javax.swing.JPanel();
    infoLabel = new javax.swing.JLabel();
    dcInicio = new datechooser.beans.DateChooserCombo();
    jLabel3 = new javax.swing.JLabel();
    dcFinal = new datechooser.beans.DateChooserCombo();
    jLabel4 = new javax.swing.JLabel();
    menuBar = new javax.swing.JMenuBar();
    fileMenu = new javax.swing.JMenu();
    exitMenuItem = new javax.swing.JMenuItem();
    jMenu1 = new javax.swing.JMenu();
    itemIniciarSesion = new javax.swing.JMenuItem();
    itemCerrarSesion = new javax.swing.JMenuItem();
    itemRegistrarNuevoUsuario = new javax.swing.JMenuItem();
    itemDarDeBajaMiUsuario = new javax.swing.JMenuItem();
    menuTabla = new javax.swing.JMenu();
    itemTablaTemperatura = new javax.swing.JMenuItem();
    itemTablaHumedadAmbiental = new javax.swing.JMenuItem();
    itemTablaHumedadSuelo = new javax.swing.JMenuItem();
    menuGrafico = new javax.swing.JMenu();
    itemGraficoTemperatura = new javax.swing.JMenuItem();
    itemGraficoHumedadAmbiental = new javax.swing.JMenuItem();
    itemGraficoHumedadSuelo = new javax.swing.JMenuItem();
    helpMenu = new javax.swing.JMenu();
    aboutMenuItem = new javax.swing.JMenuItem();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setTitle("SAMI - Sistema para la Automatizacion y Monitoreo de Invernaderos");
    setExtendedState(java.awt.Frame.MAXIMIZED_BOTH);

    statusPanel.setBackground(java.awt.SystemColor.desktop);

    statusLabel.setForeground(new java.awt.Color(254, 254, 254));
    statusLabel.setText("Status");

    javax.swing.GroupLayout statusPanelLayout = new javax.swing.GroupLayout(statusPanel);
    statusPanel.setLayout(statusPanelLayout);
    statusPanelLayout
            .setHorizontalGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(statusLabel, javax.swing.GroupLayout.DEFAULT_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE));
    statusPanelLayout
            .setVerticalGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, statusPanelLayout
                            .createSequentialGroup().addGap(0, 0, Short.MAX_VALUE).addComponent(statusLabel)));

    jPanel2.setBackground(java.awt.SystemColor.desktop);

    infoLabel.setForeground(new java.awt.Color(254, 254, 254));
    infoLabel.setText("Inicia sesin para continuar...");

    dcInicio.setCurrentView(new datechooser.view.appearance.AppearancesList("Light",
            new datechooser.view.appearance.ViewAppearance("custom",
                    new datechooser.view.appearance.swing.SwingCellAppearance(
                            new java.awt.Font("Ubuntu", java.awt.Font.PLAIN, 11),
                            new java.awt.Color(76, 76, 76), new java.awt.Color(0, 0, 255), false, true,
                            new datechooser.view.appearance.swing.ButtonPainter()),
                    new datechooser.view.appearance.swing.SwingCellAppearance(
                            new java.awt.Font("Ubuntu", java.awt.Font.PLAIN, 11),
                            new java.awt.Color(76, 76, 76), new java.awt.Color(0, 0, 255), true, true,
                            new datechooser.view.appearance.swing.ButtonPainter()),
                    new datechooser.view.appearance.swing.SwingCellAppearance(
                            new java.awt.Font("Ubuntu", java.awt.Font.PLAIN, 11), new java.awt.Color(0, 0, 255),
                            new java.awt.Color(0, 0, 255), false, true,
                            new datechooser.view.appearance.swing.ButtonPainter()),
                    new datechooser.view.appearance.swing.SwingCellAppearance(
                            new java.awt.Font("Ubuntu", java.awt.Font.PLAIN, 11),
                            new java.awt.Color(128, 128, 128), new java.awt.Color(0, 0, 255), false, true,
                            new datechooser.view.appearance.swing.LabelPainter()),
                    new datechooser.view.appearance.swing.SwingCellAppearance(
                            new java.awt.Font("Ubuntu", java.awt.Font.PLAIN, 11),
                            new java.awt.Color(76, 76, 76), new java.awt.Color(0, 0, 255), false, true,
                            new datechooser.view.appearance.swing.LabelPainter()),
                    new datechooser.view.appearance.swing.SwingCellAppearance(
                            new java.awt.Font("Ubuntu", java.awt.Font.PLAIN, 11),
                            new java.awt.Color(76, 76, 76), new java.awt.Color(255, 0, 0), false, false,
                            new datechooser.view.appearance.swing.ButtonPainter()),
                    (datechooser.view.BackRenderer) null, false, true)));
    dcInicio.setBorder(null);
    dcInicio.setMaxDate(java.util.Calendar.getInstance());
    dcInicio.setShowOneMonth(true);

    jLabel3.setForeground(new java.awt.Color(254, 254, 254));
    jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
    jLabel3.setText("Fecha final");

    dcFinal.setCurrentView(new datechooser.view.appearance.AppearancesList("Light",
            new datechooser.view.appearance.ViewAppearance("custom",
                    new datechooser.view.appearance.swing.SwingCellAppearance(
                            new java.awt.Font("Ubuntu", java.awt.Font.PLAIN, 11),
                            new java.awt.Color(76, 76, 76), new java.awt.Color(0, 0, 255), false, true,
                            new datechooser.view.appearance.swing.ButtonPainter()),
                    new datechooser.view.appearance.swing.SwingCellAppearance(
                            new java.awt.Font("Ubuntu", java.awt.Font.PLAIN, 11),
                            new java.awt.Color(76, 76, 76), new java.awt.Color(0, 0, 255), true, true,
                            new datechooser.view.appearance.swing.ButtonPainter()),
                    new datechooser.view.appearance.swing.SwingCellAppearance(
                            new java.awt.Font("Ubuntu", java.awt.Font.PLAIN, 11), new java.awt.Color(0, 0, 255),
                            new java.awt.Color(0, 0, 255), false, true,
                            new datechooser.view.appearance.swing.ButtonPainter()),
                    new datechooser.view.appearance.swing.SwingCellAppearance(
                            new java.awt.Font("Ubuntu", java.awt.Font.PLAIN, 11),
                            new java.awt.Color(128, 128, 128), new java.awt.Color(0, 0, 255), false, true,
                            new datechooser.view.appearance.swing.LabelPainter()),
                    new datechooser.view.appearance.swing.SwingCellAppearance(
                            new java.awt.Font("Ubuntu", java.awt.Font.PLAIN, 11),
                            new java.awt.Color(76, 76, 76), new java.awt.Color(0, 0, 255), false, true,
                            new datechooser.view.appearance.swing.LabelPainter()),
                    new datechooser.view.appearance.swing.SwingCellAppearance(
                            new java.awt.Font("Ubuntu", java.awt.Font.PLAIN, 11),
                            new java.awt.Color(76, 76, 76), new java.awt.Color(255, 0, 0), false, false,
                            new datechooser.view.appearance.swing.ButtonPainter()),
                    (datechooser.view.BackRenderer) null, false, true)));
    dcFinal.setBorder(null);
    dcFinal.setMaxDate(java.util.Calendar.getInstance());
    dcFinal.setShowOneMonth(true);

    jLabel4.setForeground(new java.awt.Color(254, 254, 254));
    jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
    jLabel4.setText("Fecha de Inicio");

    javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout
            .setHorizontalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup().addComponent(jLabel4).addGap(4, 4, 4)
                            .addComponent(dcInicio, javax.swing.GroupLayout.PREFERRED_SIZE, 106,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jLabel3).addGap(4, 4, 4)
                            .addComponent(dcFinal, javax.swing.GroupLayout.PREFERRED_SIZE, 108,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(infoLabel, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(infoLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                    Short.MAX_VALUE)
            .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 22,
                    javax.swing.GroupLayout.PREFERRED_SIZE)
            .addComponent(dcInicio, javax.swing.GroupLayout.PREFERRED_SIZE, 22,
                    javax.swing.GroupLayout.PREFERRED_SIZE)
            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                            Short.MAX_VALUE)
                    .addComponent(dcFinal, javax.swing.GroupLayout.Alignment.TRAILING,
                            javax.swing.GroupLayout.PREFERRED_SIZE, 22,
                            javax.swing.GroupLayout.PREFERRED_SIZE)));

    fileMenu.setMnemonic('A');
    fileMenu.setText("Archivo");

    exitMenuItem.setMnemonic('x');
    exitMenuItem.setText("Exit");
    exitMenuItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            exitMenuItemActionPerformed(evt);
        }
    });
    fileMenu.add(exitMenuItem);

    menuBar.add(fileMenu);

    jMenu1.setText("Usuarios");

    itemIniciarSesion.setText("Iniciar Sesin");
    itemIniciarSesion.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            itemIniciarSesionActionPerformed(evt);
        }
    });
    jMenu1.add(itemIniciarSesion);

    itemCerrarSesion.setText("Cerrar Sesin");
    itemCerrarSesion.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            itemCerrarSesionActionPerformed(evt);
        }
    });
    jMenu1.add(itemCerrarSesion);

    itemRegistrarNuevoUsuario.setText("Registrar nuevo usuario");
    itemRegistrarNuevoUsuario.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            itemRegistrarNuevoUsuarioActionPerformed(evt);
        }
    });
    jMenu1.add(itemRegistrarNuevoUsuario);

    itemDarDeBajaMiUsuario.setText("Dar de baja mi usuario");
    itemDarDeBajaMiUsuario.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            itemDarDeBajaMiUsuarioActionPerformed(evt);
        }
    });
    jMenu1.add(itemDarDeBajaMiUsuario);

    menuBar.add(jMenu1);

    menuTabla.setText("Tabla");
    menuTabla.setEnabled(false);

    itemTablaTemperatura.setText("Temperatura Ambiental");
    itemTablaTemperatura.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            itemTablaTemperaturaActionPerformed(evt);
        }
    });
    menuTabla.add(itemTablaTemperatura);

    itemTablaHumedadAmbiental.setText("Humedad Ambiental");
    itemTablaHumedadAmbiental.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            itemTablaHumedadAmbientalActionPerformed(evt);
        }
    });
    menuTabla.add(itemTablaHumedadAmbiental);

    itemTablaHumedadSuelo.setText("Humedad del Suelo");
    itemTablaHumedadSuelo.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            itemTablaHumedadSueloActionPerformed(evt);
        }
    });
    menuTabla.add(itemTablaHumedadSuelo);

    menuBar.add(menuTabla);

    menuGrafico.setText("Grafico");
    menuGrafico.setEnabled(false);

    itemGraficoTemperatura.setText("Temperatura Ambiental");
    itemGraficoTemperatura.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            itemGraficoTemperaturaActionPerformed(evt);
        }
    });
    menuGrafico.add(itemGraficoTemperatura);

    itemGraficoHumedadAmbiental.setText("Humedad Ambiental");
    itemGraficoHumedadAmbiental.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            itemGraficoHumedadAmbientalActionPerformed(evt);
        }
    });
    menuGrafico.add(itemGraficoHumedadAmbiental);

    itemGraficoHumedadSuelo.setText("Humedad del Suelo");
    itemGraficoHumedadSuelo.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            itemGraficoHumedadSueloActionPerformed(evt);
        }
    });
    menuGrafico.add(itemGraficoHumedadSuelo);

    menuBar.add(menuGrafico);

    helpMenu.setMnemonic('y');
    helpMenu.setText("Ayuda");

    aboutMenuItem.setMnemonic('a');
    aboutMenuItem.setText("Acerca de SAMI");
    helpMenu.add(aboutMenuItem);

    menuBar.add(helpMenu);

    setJMenuBar(menuBar);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(desktopPane, javax.swing.GroupLayout.DEFAULT_SIZE, 851, Short.MAX_VALUE)
            .addComponent(statusPanel, javax.swing.GroupLayout.DEFAULT_SIZE,
                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                    Short.MAX_VALUE));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(desktopPane, javax.swing.GroupLayout.DEFAULT_SIZE, 445, Short.MAX_VALUE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(statusPanel, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)));

    pack();
}

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

    jPanel1 = new javax.swing.JPanel();
    jButtonFechar = new javax.swing.JButton();
    jButtonGerar = new javax.swing.JButton();
    jPanel3 = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();
    pessoa = new javax.swing.JComboBox<>();
    jLabel2 = new javax.swing.JLabel();
    jLabel3 = new javax.swing.JLabel();
    dataIni = new org.jdesktop.swingx.JXDatePicker();
    dataFim = new org.jdesktop.swingx.JXDatePicker();
    pendente = new javax.swing.JCheckBox();

    setClosable(true);
    setIconifiable(true);
    setMaximizable(true);
    setTitle("Relatrio de Contas");

    jButtonFechar.setText("Fechar");
    jButtonFechar.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButtonFecharActionPerformed(evt);
        }
    });

    jButtonGerar.setText("Gerar");
    jButtonGerar.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButtonGerarActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                    .addContainerGap().addComponent(jButtonGerar)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 375, Short.MAX_VALUE)
                    .addComponent(jButtonFechar).addContainerGap()));
    jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jButtonFechar).addComponent(jButtonGerar))
                    .addContainerGap()));

    jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Filtros"));

    jLabel1.setText("Pessoa *");

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

    jLabel2.setText("Data inicial *");

    jLabel3.setText("Data final *");

    pendente.setSelected(true);
    pendente.setText("Somente ttulos em aberto");

    javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
    jPanel3.setLayout(jPanel3Layout);
    jPanel3Layout.setHorizontalGroup(jPanel3Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup().addContainerGap()
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel3).addComponent(jLabel2).addComponent(jLabel1))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(pessoa, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                    .addGroup(jPanel3Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(pendente)
                                            .addComponent(dataIni, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(dataFim, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGap(0, 0, Short.MAX_VALUE)))
                    .addContainerGap()));
    jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup().addContainerGap()
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel1).addComponent(pessoa, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2).addComponent(dataIni, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3).addComponent(dataFim, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(pendente).addContainerGap(25, 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)
            .addGroup(layout.createSequentialGroup().addContainerGap().addComponent(jPanel3,
                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap()));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(
            javax.swing.GroupLayout.Alignment.TRAILING,
            layout.createSequentialGroup().addContainerGap()
                    .addComponent(jPanel3, 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)
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)));

    pack();
}

From source file:GUI.TelaPrincipal.java

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

    buttonGroup1 = new javax.swing.ButtonGroup();
    jPanel1 = new javax.swing.JPanel();
    rbPorSemestre = new javax.swing.JRadioButton();
    comboDisciplinas1 = new javax.swing.JComboBox();
    comboDisciplinas2 = new javax.swing.JComboBox();
    botaoConsultar = new javax.swing.JButton();
    jLabel1 = new javax.swing.JLabel();
    rbPorDisciplina = new javax.swing.JRadioButton();
    rbMedia = new javax.swing.JRadioButton();
    jLabel2 = new javax.swing.JLabel();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

    buttonGroup1.add(rbPorSemestre);
    rbPorSemestre.setText("Por Semestre");

    comboDisciplinas1.setModel(new javax.swing.DefaultComboBoxModel(new String[] {
            "1- IMD0019 - RESOLUO DE PROBLEMAS MATEM?TICOS PARA TI ",
            "2- IMD0017 - PR?TICAS DE LEITURA E ESCRITA EM PORTUGUS I",
            "3- IMD0028 - FUNDAMENTOS MATEM?TICOS DA COMPUTAO I ",
            "4- IMD0012 - INTRODUO S TCNICAS DE PROGRAMAO",
            "5- IMD0029 - ESTRUTURA DE DADOS B?SICAS I ", "6- IMD0030 - LINGUAGEM DE PROGRAMAO I " }));
    comboDisciplinas1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            comboDisciplinas1ActionPerformed(evt);
        }
    });

    comboDisciplinas2.setModel(new javax.swing.DefaultComboBoxModel(new String[] {
            "1- IMD0024 - C?LCULO DIFERENCIAL E INTEGRAL I ",
            "2- IMD0027 - PR?TICAS DE LEITURA E ESCRITA EM PORTUGUS II",
            "3-IMD0038 - FUNDAMENTOS MATEM?TICOS DA COMPUTAO II",
            "4- IMD0030 - LINGUAGEM DE PROGRAMAO I ", "5- IMD0039 - ESTRUTURAS DE DADOS B?SICAS II ",
            "6- IMD0040 - LINGUAGEM DE PROGRAMAO II" }));

    botaoConsultar.setText("Consultar");
    botaoConsultar.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            botaoConsultarActionPerformed(evt);
        }
    });

    jLabel1.setText("DiamondV| Copyright  2015 v 1.0");

    buttonGroup1.add(rbPorDisciplina);
    rbPorDisciplina.setText("Por Disciplina");
    rbPorDisciplina.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            rbPorDisciplinaActionPerformed(evt);
        }
    });

    rbMedia.setText("Mdias");

    jLabel2.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
    jLabel2.setText("Grficos");

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup().addGap(341, 341, 341).addComponent(botaoConsultar)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                    .addContainerGap(170, Short.MAX_VALUE)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                    jPanel1Layout.createSequentialGroup()
                                            .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 208,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(279, 279, 279))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout
                                    .createSequentialGroup()
                                    .addGroup(jPanel1Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(rbPorSemestre).addComponent(rbPorDisciplina)
                                            .addGroup(jPanel1Layout.createSequentialGroup().addGap(17, 17, 17)
                                                    .addComponent(jLabel2))
                                            .addComponent(rbMedia))
                                    .addGap(91, 91, 91)
                                    .addGroup(jPanel1Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(comboDisciplinas1,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(comboDisciplinas2,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGap(66, 66, 66)))));
    jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup().addGap(118, 118, 118)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(comboDisciplinas1, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel2))
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup().addGap(21, 21, 21).addComponent(
                                    comboDisciplinas2, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(rbPorSemestre)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(rbPorDisciplina)))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(rbMedia)
                    .addGap(58, 58, 58).addComponent(botaoConsultar)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 57, Short.MAX_VALUE)
                    .addComponent(jLabel1).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).addGroup(
            javax.swing.GroupLayout.Alignment.TRAILING,
            layout.createSequentialGroup().addContainerGap().addComponent(jPanel1,
                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap()));

    pack();
}

From source file:ee.ioc.phon.android.speak.Utils.java

/**
 * <p>Returns a bitmap that visualizes the given waveform (byte array),
 * i.e. a sequence of 16-bit integers.</p>
 *
 * TODO: show to high/low points in other color
 * TODO: show end pause data with another color
 *//*from w  w  w  .j av  a2s. co  m*/
public static Bitmap drawWaveform(byte[] waveBuffer, int w, int h, int start, int end) {
    final Bitmap b = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
    final Canvas c = new Canvas(b);
    final Paint paint = new Paint();
    paint.setColor(0xFFFFFFFF); // 0xRRGGBBAA
    paint.setAntiAlias(true);
    paint.setStrokeWidth(0);

    final Paint redPaint = new Paint();
    redPaint.setColor(0xFF000080);
    redPaint.setAntiAlias(true);
    redPaint.setStrokeWidth(0);

    final ShortBuffer buf = ByteBuffer.wrap(waveBuffer).order(ByteOrder.LITTLE_ENDIAN).asShortBuffer();
    buf.position(0);

    final int numSamples = waveBuffer.length / 2;
    //final int delay = (SAMPLING_RATE * 100 / 1000);
    final int delay = 0;
    int endIndex = end / 2 + delay;
    if (end == 0 || endIndex >= numSamples) {
        endIndex = numSamples;
    }
    int index = start / 2 - delay;
    if (index < 0) {
        index = 0;
    }
    final int size = endIndex - index;
    int numSamplePerPixel = 32;
    int delta = size / (numSamplePerPixel * w);
    if (delta == 0) {
        numSamplePerPixel = size / w;
        delta = 1;
    }

    final float scale = 3.5f / 65536.0f;
    // do one less column to make sure we won't read past
    // the buffer.
    try {
        for (int i = 0; i < w - 1; i++) {
            final float x = i;
            for (int j = 0; j < numSamplePerPixel; j++) {
                final short s = buf.get(index);
                final float y = (h / 2) - (s * h * scale);
                if (s > Short.MAX_VALUE - 10 || s < Short.MIN_VALUE + 10) {
                    // TODO: make it work
                    c.drawPoint(x, y, redPaint);
                } else {
                    c.drawPoint(x, y, paint);
                }
                index += delta;
            }
        }
    } catch (IndexOutOfBoundsException e) {
        // this can happen, but we don't care
    }

    return b;
}

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

    GraphicsLayered = new javax.swing.JLayeredPane();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

    javax.swing.GroupLayout GraphicsLayeredLayout = new javax.swing.GroupLayout(GraphicsLayered);
    GraphicsLayered.setLayout(GraphicsLayeredLayout);
    GraphicsLayeredLayout.setHorizontalGroup(GraphicsLayeredLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 620, Short.MAX_VALUE));
    GraphicsLayeredLayout.setVerticalGroup(GraphicsLayeredLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 484, 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(GraphicsLayered));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(GraphicsLayered));

    pack();
}

From source file:org.streamspinner.harmonica.application.CQGraphTerminal.java

private JPanel getJPanel11() {
    if (jPanel11 != null)
        return jPanel11;
    jPanel11 = new JPanel();
    jPanel11.setMaximumSize(new Dimension(Short.MAX_VALUE, Short.MAX_VALUE));
    jPanel11.setPreferredSize(new Dimension(340, 150));
    jPanel11.setLayout(new BoxLayout(jPanel11, BoxLayout.LINE_AXIS));
    jPanel11.add(getJScrollPane());//from ww w . j  a  v a  2 s . c om

    return jPanel11;
}

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./*  w  ww  .  java  2  s .  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();
    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:gg.view.categoriesbalances.GraphCategoriesBalancesTopComponent.java

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

    jPanelCategoriesBalances = new javax.swing.JPanel();

    jPanelCategoriesBalances.setLayout(new java.awt.BorderLayout());

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(
                    jPanelCategoriesBalances, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(
            jPanelCategoriesBalances, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE));
}

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

    errorTag = new javax.swing.JLabel();
    jPanel1 = new javax.swing.JPanel();
    label1 = new java.awt.Label();
    jLabel1 = new javax.swing.JLabel();
    login = new javax.swing.JButton();
    picLabel = new javax.swing.JLabel();
    userIDTxt = new javax.swing.JTextField();
    errorTagLabel = new javax.swing.JLabel();

    errorTag.setFont(new java.awt.Font("Ubuntu", 1, 18)); // NOI18N
    errorTag.setForeground(new java.awt.Color(255, 0, 0));
    errorTag.setText("No result found");

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setBackground(new java.awt.Color(106, 161, 172));
    setResizable(false);

    jPanel1.setBackground(new java.awt.Color(23, 193, 111));
    jPanel1.setForeground(new java.awt.Color(74, 74, 74));

    label1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
    label1.setFont(new java.awt.Font("Ubuntu Medium", 1, 36)); // NOI18N
    label1.setForeground(new java.awt.Color(254, 254, 254));
    label1.setText("DVD Shop User Login");

    jLabel1.setFont(new java.awt.Font("Ubuntu", 0, 16)); // NOI18N
    jLabel1.setForeground(new java.awt.Color(254, 254, 254));
    jLabel1.setText("Enter UserID");

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

    picLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/pic7.jpg"))); // NOI18N
    picLabel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 2));

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

    errorTagLabel.setFont(new java.awt.Font("Ubuntu", 1, 18)); // NOI18N
    errorTagLabel.setForeground(new java.awt.Color(133, 20, 20));
    errorTagLabel.setText("Authentication Failed");

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(
                            javax.swing.GroupLayout.Alignment.TRAILING,
                            jPanel1Layout
                                    .createSequentialGroup()
                                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
                                            Short.MAX_VALUE)
                                    .addComponent(
                                            errorTagLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 275,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(184, 184, 184))
                    .addGroup(jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup().addGap(84, 84, 84)
                                    .addGroup(jPanel1Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanel1Layout.createSequentialGroup().addGap(46, 46, 46)
                                                    .addComponent(
                                                            label1, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addGroup(jPanel1Layout.createSequentialGroup()
                                                    .addComponent(jLabel1).addGap(20, 20, 20)
                                                    .addComponent(userIDTxt,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE, 208,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addGap(18, 18, 18).addComponent(login,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE, 125,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE))))
                            .addGroup(jPanel1Layout.createSequentialGroup().addGap(125, 125, 125)
                                    .addComponent(picLabel)))
                            .addContainerGap(97, Short.MAX_VALUE)));
    jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap()
                    .addComponent(label1, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel1)
                            .addComponent(userIDTxt, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(login))
                    .addGap(18, 18, 18).addComponent(errorTagLabel).addGap(18, 18, 18).addComponent(picLabel,
                            javax.swing.GroupLayout.PREFERRED_SIZE, 288, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(72, 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.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                    javax.swing.GroupLayout.PREFERRED_SIZE));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                    .addContainerGap(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:hwcdhackwaterloo.GUIMain.java

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

    menuPanel = new javax.swing.JPanel();
    titleLabel = new javax.swing.JLabel();
    closeButton = new javax.swing.JButton();
    topPanel = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();
    roomChoice = new javax.swing.JComboBox();
    jLabel3 = new javax.swing.JLabel();
    jLabel5 = new javax.swing.JLabel();
    timeField = new javax.swing.JTextField();
    findButton = new javax.swing.JButton();
    monthChoice = new javax.swing.JComboBox();
    dayChoice = new javax.swing.JComboBox();
    jLabel6 = new javax.swing.JLabel();
    middlePanel = new javax.swing.JPanel();
    resultHeader = new javax.swing.JLabel();
    result = new javax.swing.JLabel();
    bottomPanel = new javax.swing.JPanel();
    jLabel4 = new javax.swing.JLabel();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setTitle("Fuck_Nuts");
    setBackground(new java.awt.Color(0, 0, 0));
    setForeground(java.awt.Color.pink);
    setUndecorated(true);
    setResizable(false);

    menuPanel.setBackground(new java.awt.Color(10, 10, 10));

    titleLabel.setBackground(new java.awt.Color(255, 255, 255));
    titleLabel.setFont(new java.awt.Font("DejaVu Sans Condensed", 0, 18)); // NOI18N
    titleLabel.setForeground(new java.awt.Color(230, 230, 230));
    titleLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
    titleLabel.setText("WaterLOOKup");

    closeButton.setBackground(new java.awt.Color(0, 0, 0));
    closeButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/closeButtonAlt.png"))); // NOI18N
    closeButton.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            closeButtonMouseClicked(evt);
        }
    });

    javax.swing.GroupLayout menuPanelLayout = new javax.swing.GroupLayout(menuPanel);
    menuPanel.setLayout(menuPanelLayout);
    menuPanelLayout
            .setHorizontalGroup(menuPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(menuPanelLayout.createSequentialGroup()
                            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(titleLabel).addGap(156, 156, 156).addComponent(closeButton,
                                    javax.swing.GroupLayout.PREFERRED_SIZE, 27,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)));
    menuPanelLayout.setVerticalGroup(menuPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(menuPanelLayout.createSequentialGroup()
                    .addGroup(menuPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(titleLabel, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                    menuPanelLayout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE)
                                            .addComponent(closeButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    29, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addContainerGap()));

    topPanel.setBackground(new java.awt.Color(135, 0, 71));
    topPanel.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

    jLabel1.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    jLabel1.setForeground(new java.awt.Color(250, 250, 250));
    jLabel1.setText("SEARCH FOR AVAILABLE ROOMS");

    roomChoice.setBackground(new java.awt.Color(200, 50, 100));
    roomChoice.addItem("MC");

    roomChoice.addItemListener(new ItemListener() {
        Object state = new Object();
        //Object oldState = new Object();
        Object oldState = roomChoice.getSelectedItem();

        public void itemStateChanged(ItemEvent e) {

            state = e.getItem();
            if (state != oldState) {
                //System.out.println("changed to:"+ state);
                // code here to pass info to openroom.java
            }
            oldState = state;

        }
    });
    String json = getJSONData("/buildings/list");
    JSONObject obj = (JSONObject) JSONValue.parse(json);
    JSONArray courses = (JSONArray) obj.get("data");
    ArrayList<String> buildingNames = new ArrayList<>();
    for (Object course : courses) {
        JSONObject courseBlock = (JSONObject) course;
        buildingNames.add(courseBlock.get("building_code").toString());
    }
    Collections.sort(buildingNames);
    for (String buildingName : buildingNames) {
        roomChoice.addItem(buildingName);
    }

    jLabel3.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
    jLabel3.setForeground(new java.awt.Color(250, 250, 250));
    jLabel3.setText("WHAT'S DA CLOSEST BUILDIN TO YOU?");

    jLabel5.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
    jLabel5.setForeground(new java.awt.Color(250, 250, 250));
    jLabel5.setText("WHEN DO YOU WANT A ROOM, AND FOR HOW LONG?");

    timeField.setBackground(new java.awt.Color(255, 160, 202));
    timeField.setText("(minutes)");

    findButton.setBackground(new java.awt.Color(255, 170, 202));
    findButton.setText("FIND AVAILABLE ROOM!");
    Object comboBoxState = roomChoice.getSelectedItem();
    findButton.setActionCommand("FIND");
    //findButton.addActionListener(this);
    findButton.setToolTipText("Dooooo itttt!");

    //pubic void actionPerformed(ActionEvent e){
    //    if("FIND".equals(e.getActionCommand())){
    //        System.out.println("Press registered.");
    //    }
    //}
    findButton.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseReleased(java.awt.event.MouseEvent evt) {
            findButtonMouseReleased(evt);
        }
    });

    monthChoice.setBackground(new java.awt.Color(200, 50, 100));
    monthChoice.setModel(new javax.swing.DefaultComboBoxModel(
            new String[] { "<select month>", "January", "February", "March", "April", "May", "June", "July",
                    "August", "September", "October", "November", "December" }));
    monthChoice.addItemListener(new java.awt.event.ItemListener() {
        public void itemStateChanged(java.awt.event.ItemEvent evt) {
            monthChoiceItemStateChanged(evt);
        }
    });

    dayChoice.setBackground(new java.awt.Color(200, 50, 100));

    jLabel6.setForeground(new java.awt.Color(255, 255, 255));
    jLabel6.setText("DURATION:");

    javax.swing.GroupLayout topPanelLayout = new javax.swing.GroupLayout(topPanel);
    topPanel.setLayout(topPanelLayout);
    topPanelLayout.setHorizontalGroup(topPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(topPanelLayout.createSequentialGroup().addGroup(topPanelLayout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(topPanelLayout.createSequentialGroup().addGap(34, 34, 34)
                            .addGroup(topPanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel3)
                                    .addComponent(roomChoice, javax.swing.GroupLayout.PREFERRED_SIZE, 87,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel5)
                                    .addGroup(topPanelLayout.createSequentialGroup()
                                            .addComponent(monthChoice, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    122, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(dayChoice, javax.swing.GroupLayout.PREFERRED_SIZE, 55,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(jLabel6)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(timeField, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    108, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(topPanelLayout.createSequentialGroup().addGap(135, 135, 135).addComponent(
                            findButton, javax.swing.GroupLayout.PREFERRED_SIZE, 187,
                            javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGap(38, 38, 38))
            .addGroup(topPanelLayout.createSequentialGroup().addGap(93, 93, 93).addComponent(jLabel1)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    topPanelLayout.setVerticalGroup(topPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(topPanelLayout.createSequentialGroup()
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 25,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 23,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(roomChoice, javax.swing.GroupLayout.DEFAULT_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 23,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(topPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(timeField, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(monthChoice, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(dayChoice, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel6))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(findButton, javax.swing.GroupLayout.DEFAULT_SIZE, 34, Short.MAX_VALUE)
                    .addContainerGap()));

    middlePanel.setBackground(new java.awt.Color(0, 129, 16));
    middlePanel.setForeground(new java.awt.Color(240, 240, 240));

    resultHeader.setFont(new java.awt.Font("Tahoma", 0, 18));
    resultHeader.setForeground(new java.awt.Color(250, 250, 250));

    result.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
    result.setForeground(new java.awt.Color(255, 255, 255));

    javax.swing.GroupLayout middlePanelLayout = new javax.swing.GroupLayout(middlePanel);
    middlePanel.setLayout(middlePanelLayout);
    middlePanelLayout.setHorizontalGroup(middlePanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(middlePanelLayout.createSequentialGroup().addGap(84, 84, 84)
                    .addComponent(resultHeader, javax.swing.GroupLayout.PREFERRED_SIZE, 267,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(115, Short.MAX_VALUE))
            .addGroup(middlePanelLayout.createSequentialGroup().addContainerGap().addComponent(result,
                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap()));
    middlePanelLayout.setVerticalGroup(middlePanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(middlePanelLayout.createSequentialGroup()
                    .addComponent(resultHeader, javax.swing.GroupLayout.PREFERRED_SIZE, 27,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 49, Short.MAX_VALUE)
                    .addComponent(result, javax.swing.GroupLayout.PREFERRED_SIZE, 82,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(44, 44, 44)));

    bottomPanel.setBackground(new java.awt.Color(159, 238, 0));

    jLabel4.setFont(new java.awt.Font("Tahoma", 0, 10)); // NOI18N
    jLabel4.setText("BY: KERI WARR, ANTHONY CALANDRA, DANIEL HOPPER, NEIL DE VRIES");

    javax.swing.GroupLayout bottomPanelLayout = new javax.swing.GroupLayout(bottomPanel);
    bottomPanel.setLayout(bottomPanelLayout);
    bottomPanelLayout
            .setHorizontalGroup(bottomPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                            bottomPanelLayout.createSequentialGroup()
                                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 406,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addContainerGap()));
    bottomPanelLayout.setVerticalGroup(
            bottomPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(
                    javax.swing.GroupLayout.Alignment.TRAILING,
                    bottomPanelLayout.createSequentialGroup().addGap(0, 132, Short.MAX_VALUE).addComponent(
                            jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 23,
                            javax.swing.GroupLayout.PREFERRED_SIZE)));

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(middlePanel, javax.swing.GroupLayout.DEFAULT_SIZE,
                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(menuPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                    Short.MAX_VALUE)
            .addComponent(bottomPanel, javax.swing.GroupLayout.DEFAULT_SIZE,
                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(topPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                    Short.MAX_VALUE));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                    .addComponent(menuPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 33,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(topPanel, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(middlePanel, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(bottomPanel, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)));

    pack();
}