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:gg.msn.ui.form.LicenseDialog.java

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

    jScrollPane1 = new javax.swing.JScrollPane();
    jEditorPane1 = new javax.swing.JEditorPane();
    licenseLabel = new javax.swing.JLabel();
    jScrollPane2 = new javax.swing.JScrollPane();
    licenseTextPane = new javax.swing.JEditorPane();

    jScrollPane1.setName("jScrollPane1"); // NOI18N

    jEditorPane1.setName("jEditorPane1"); // NOI18N
    jScrollPane1.setViewportView(jEditorPane1);

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setName("Form"); // NOI18N

    org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application
            .getInstance(gg.msn.ui.ChatClientApp.class).getContext().getResourceMap(LicenseDialog.class);
    licenseLabel.setFont(resourceMap.getFont("licenseLabel.font")); // NOI18N
    licenseLabel.setText(resourceMap.getString("licenseLabel.text")); // NOI18N
    licenseLabel.setName("licenseLabel"); // NOI18N

    jScrollPane2.setName("jScrollPane2"); // NOI18N

    licenseTextPane.setName("licenseTextPane"); // NOI18N
    jScrollPane2.setViewportView(licenseTextPane);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(
                            layout.createSequentialGroup().addContainerGap()
                                    .addGroup(layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    545, Short.MAX_VALUE)
                                            .addComponent(licenseLabel))
                                    .addContainerGap()));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addContainerGap().addComponent(licenseLabel)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 296, Short.MAX_VALUE)
                    .addContainerGap()));

    pack();
}

From source file:GeMSE.GS.Analysis.Stats.TwoSamplePearsonsCorrelationPanel.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 va 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();
    CovarianceL = new javax.swing.JLabel();

    jLabel1.setFont(new java.awt.Font("Lucida Grande", 0, 14)); // NOI18N
    jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jLabel1.setText("Covariance between the two arrays");

    CovarianceL.setFont(new java.awt.Font("Courier New", 0, 24)); // NOI18N
    CovarianceL.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    CovarianceL.setText("NaN");

    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(CovarianceL, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 336, Short.MAX_VALUE))
                    .addContainerGap()));
    jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addComponent(jLabel1)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(CovarianceL, javax.swing.GroupLayout.DEFAULT_SIZE, 37, Short.MAX_VALUE)
                    .addContainerGap()));

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addContainerGap(298, Short.MAX_VALUE)
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap()));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addContainerGap()
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
}

From source file:org.nekorp.workflow.desktop.view.EventoExtraGuardar.java

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

    jToolBar1 = new javax.swing.JToolBar();
    filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0),
            new java.awt.Dimension(32767, 0));
    guardar = new javax.swing.JButton();
    jSeparator1 = new javax.swing.JSeparator();

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

    jToolBar1.setBackground(new java.awt.Color(255, 255, 255));
    jToolBar1.setFloatable(false);
    jToolBar1.setRollover(true);
    jToolBar1.add(filler1);

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

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 769, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                            layout.createSequentialGroup().addContainerGap()
                                    .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addContainerGap()));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                    .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 20,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 0, 0)));
}

From source file:com.github.lynxdb.server.core.repository.EntryRepo.java

public void processMetric(Vhost _vhost, List<Insert> _list, Metric _metric) {
    int group = getGroup(_metric.getTime());
    String tags = TagsSerializer.serialize(_metric.getTags());

    _list.add(QueryBuilder.insertInto("series").value("vhostid", _vhost.getId())
            .value("name", _metric.getName()).value("tags", tags).value("group", group)
            .value("time", _metric.getTime()).value("random", (short) (Short.MAX_VALUE * Math.random()))
            .value("value", _metric.getValue()));
    _list.add(QueryBuilder.insertInto("list").value("vhostid", _vhost.getId()).value("name", _metric.getName())
            .value("group", group).value("tags", tags));
    _list.add(QueryBuilder.insertInto("suggest_name").value("vhostid", _vhost.getId()).value("name",
            _metric.getName()));//ww  w.  j  av  a 2  s .  c  o m
    for (Map.Entry t : _metric.getTags().entrySet()) {
        _list.add(QueryBuilder.insertInto("suggest_tagk").value("vhostid", _vhost.getId()).value("tagk",
                t.getKey()));
        _list.add(QueryBuilder.insertInto("suggest_tagv").value("vhostid", _vhost.getId()).value("tagv",
                t.getValue()));
    }
}

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

    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    un = new javax.swing.JTextField();
    pa = new javax.swing.JPasswordField();
    btnLogin = new javax.swing.JButton();
    jButton1 = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

    jLabel1.setText("Username");

    jLabel2.setText("Password");

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

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

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addGap(54, 54, 54)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(layout.createSequentialGroup().addComponent(jLabel2).addGap(18, 18, 18)
                                    .addComponent(pa, javax.swing.GroupLayout.PREFERRED_SIZE, 93,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup().addComponent(jLabel1).addGap(18, 18, 18)
                                    .addComponent(un)))
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup().addGap(46, 46, 46).addComponent(btnLogin)
                                    .addContainerGap(18, 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)
                                            .addComponent(jButton1).addContainerGap()))));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addGroup(layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup().addGap(45, 45, 45)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel1)
                                    .addComponent(un, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(layout.createSequentialGroup().addGap(59, 59, 59).addComponent(btnLogin)))
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(jLabel2)
                                            .addComponent(pa, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addContainerGap(24, 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)
                                            .addComponent(jButton1).addContainerGap()))));

    pack();
}

From source file:com.nicodemo.view.MainForm.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  av a  2  s .c  o m
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jTabbedPane_main = new javax.swing.JTabbedPane();
    jPanel_tabCurrentSale = new javax.swing.JPanel();
    jPanel_tabItems = new javax.swing.JPanel();
    jPanel_tabCurrentCashBox = new javax.swing.JPanel();
    jPanel_tabClients = new javax.swing.JPanel();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setMinimumSize(new java.awt.Dimension(500, 500));

    javax.swing.GroupLayout jPanel_tabCurrentSaleLayout = new javax.swing.GroupLayout(jPanel_tabCurrentSale);
    jPanel_tabCurrentSale.setLayout(jPanel_tabCurrentSaleLayout);
    jPanel_tabCurrentSaleLayout.setHorizontalGroup(jPanel_tabCurrentSaleLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 595, Short.MAX_VALUE));
    jPanel_tabCurrentSaleLayout.setVerticalGroup(jPanel_tabCurrentSaleLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 361, Short.MAX_VALUE));

    jTabbedPane_main.addTab("Venta Actual", jPanel_tabCurrentSale);

    javax.swing.GroupLayout jPanel_tabItemsLayout = new javax.swing.GroupLayout(jPanel_tabItems);
    jPanel_tabItems.setLayout(jPanel_tabItemsLayout);
    jPanel_tabItemsLayout.setHorizontalGroup(jPanel_tabItemsLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 595, Short.MAX_VALUE));
    jPanel_tabItemsLayout.setVerticalGroup(jPanel_tabItemsLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 361, Short.MAX_VALUE));

    jTabbedPane_main.addTab("Articulos", jPanel_tabItems);

    javax.swing.GroupLayout jPanel_tabCurrentCashBoxLayout = new javax.swing.GroupLayout(
            jPanel_tabCurrentCashBox);
    jPanel_tabCurrentCashBox.setLayout(jPanel_tabCurrentCashBoxLayout);
    jPanel_tabCurrentCashBoxLayout.setHorizontalGroup(jPanel_tabCurrentCashBoxLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 595, Short.MAX_VALUE));
    jPanel_tabCurrentCashBoxLayout.setVerticalGroup(jPanel_tabCurrentCashBoxLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 361, Short.MAX_VALUE));

    jTabbedPane_main.addTab("Caja", jPanel_tabCurrentCashBox);

    javax.swing.GroupLayout jPanel_tabClientsLayout = new javax.swing.GroupLayout(jPanel_tabClients);
    jPanel_tabClients.setLayout(jPanel_tabClientsLayout);
    jPanel_tabClientsLayout.setHorizontalGroup(jPanel_tabClientsLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 595, Short.MAX_VALUE));
    jPanel_tabClientsLayout.setVerticalGroup(jPanel_tabClientsLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 361, Short.MAX_VALUE));

    jTabbedPane_main.addTab("Clientes", jPanel_tabClients);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane_main));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addContainerGap().addComponent(jTabbedPane_main)));

    pack();
}

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

    mURL = new javax.swing.JTextField();
    jSlider1 = new javax.swing.JSlider();
    mChart = new javax.swing.JPanel();

    jSlider1.setOrientation(javax.swing.JSlider.VERTICAL);

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

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                    .addComponent(mURL, javax.swing.GroupLayout.PREFERRED_SIZE, 242,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(12, 521, Short.MAX_VALUE))
            .addGroup(layout.createSequentialGroup()
                    .addComponent(jSlider1, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(mChart,
                            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(mURL, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(mChart, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jSlider1, javax.swing.GroupLayout.DEFAULT_SIZE, 412, Short.MAX_VALUE))
                    .addContainerGap()));
}

From source file:com.tesora.dve.common.TestDataGenerator.java

protected Object getColumnValue(ColumnMetadata cm) {
    Object cv = null;/*w w  w .  j  a  v  a 2  s.c  o m*/
    Calendar cal = Calendar.getInstance();

    switch (cm.getDataType()) {
    case Types.BIT:
    case Types.BOOLEAN:
        cv = Boolean.TRUE;
        break;
    case Types.BIGINT:
        cv = Long.MAX_VALUE;
        break;
    case Types.CHAR:
    case Types.VARCHAR:
        cv = StringUtils.left(baseString, cm.getSize());
        break;
    case Types.SMALLINT:
        cv = Short.MAX_VALUE;
        break;
    case Types.TINYINT:
        cv = Byte.MAX_VALUE;
        break;
    case Types.INTEGER:
        cv = Integer.MAX_VALUE;
        break;
    case Types.DOUBLE:
        cv = new Double(1234.5678); // TODO need to handle s,p
        break;
    case Types.FLOAT:
        cv = new Float(123.56); // TODO need to handle s,p
        break;
    case Types.DECIMAL:
        cv = new BigDecimal("12345.6789"); // TODO need to handle s,p
        break;
    case Types.DATE:
        cal.setTimeInMillis(123456789);
        cal.set(Calendar.HOUR_OF_DAY, 0);
        cal.set(Calendar.MINUTE, 0);
        cal.set(Calendar.SECOND, 0);
        cal.set(Calendar.MILLISECOND, 0);
        cv = cal.getTime();
        break;
    case Types.TIMESTAMP:
        cal.setTimeInMillis(123456789);
        cv = cal.getTime();
        break;
    case Types.TIME:
        cv = new Time(123456789);
        break;
    default:
        break;
    }

    return cv;
}

From source file:org.jdal.swing.form.SimpleBoxFormBuilder.java

/**
 * Add a component to Form at position pointer by cursor, 
 * Increments cursor by one./*from   w ww.  j  a va 2 s.c om*/
 * @param c Component to add
 */
public void add(Component c) {
    if (debug) {
        if (c instanceof JComponent)
            ((JComponent) c).setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY));
    }
    addBox(c);

    if (rowHeight < Short.MAX_VALUE) {
        Dimension d = c.getPreferredSize();
        d.height = rowHeight;
        c.setPreferredSize(d);

        c.setMinimumSize(d);

        if (!c.isMaximumSizeSet() || c.getMaximumSize().getHeight() > rowHeight) {
            c.setMaximumSize(new Dimension(Short.MAX_VALUE, rowHeight));
        }
    }

}

From source file:ejerciciospsp.practicando.frameFTP.java

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

    jLabel1 = new javax.swing.JLabel();
    jTextField1 = new javax.swing.JTextField();
    jLabel2 = new javax.swing.JLabel();
    jTextField2 = new javax.swing.JTextField();
    jLabel3 = new javax.swing.JLabel();
    jPasswordField1 = new javax.swing.JPasswordField();
    jButton1 = new javax.swing.JButton();
    jScrollPane1 = new javax.swing.JScrollPane();
    jList1 = new javax.swing.JList();
    jButton2 = new javax.swing.JButton();
    jButton3 = new javax.swing.JButton();
    jButton4 = new javax.swing.JButton();
    jButton5 = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    addWindowListener(new java.awt.event.WindowAdapter() {
        public void windowOpened(java.awt.event.WindowEvent evt) {
            formWindowOpened(evt);
        }
    });

    jLabel1.setText("Servidor FTP: ");

    jLabel2.setText("Usuario: ");

    jLabel3.setText("Contrasea: ");

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

    jScrollPane1.setViewportView(jList1);

    jButton2.setText("Crear carpeta");

    jButton3.setText("Abrir");

    jButton4.setText("Descargar");

    jButton5.setText("Subir");

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING,
                            javax.swing.GroupLayout.DEFAULT_SIZE, 406, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel1).addComponent(jLabel2).addComponent(jLabel3))
                            .addGap(18, 18, 18)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jTextField2).addComponent(jPasswordField1)
                                    .addComponent(jTextField1))))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButton5, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButton1, javax.swing.GroupLayout.Alignment.TRAILING,
                                    javax.swing.GroupLayout.PREFERRED_SIZE, 157,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap()));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(layout.createSequentialGroup()
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel1))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel2))
                            .addGap(5, 5, 5)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel3)))
                    .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, 66, Short.MAX_VALUE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                    .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 40,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 40,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 40,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 40,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(0, 0, Short.MAX_VALUE))
                            .addComponent(jScrollPane1))
                    .addContainerGap()));

    pack();
}