Example usage for javax.swing JSpinner setSize

List of usage examples for javax.swing JSpinner setSize

Introduction

In this page you can find the example usage for javax.swing JSpinner setSize.

Prototype

public void setSize(int width, int height) 

Source Link

Document

Resizes this component so that it has width width and height height .

Usage

From source file:Forms.FrmPrincipal.java

private void genCapasOcultas() {
    pnlCapas.removeAll();//from w w  w . j a  va 2 s . c  om
    int n = Integer.parseInt(spIntermedias.getValue().toString()) + 2;
    for (int i = 0; i < n; i++) {
        JSpinner spinner = new JSpinner();
        spinner.setName("capa" + String.valueOf(i));
        spinner.setValue(100);
        spinner.setSize(70, 20);
        spinner.setVisible(false);
        spinner.setVisible(true);
        pnlCapas.add(spinner);
        if (i == 0) {
            spinner.setValue(matrizPatrones[0].length - 1);
            spinner.setEnabled(false);
        } else if (i == n - 1) {
            spinner.setValue(String.valueOf(matrizPatrones[0][matrizPatrones[0].length - 1]).length());
            spinner.setEnabled(false);
        }
    }
    pnlCapas.setVisible(false);
    pnlCapas.setVisible(true);
}