Example usage for javax.swing JSpinner setVisible

List of usage examples for javax.swing JSpinner setVisible

Introduction

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

Prototype

@BeanProperty(hidden = true, visualUpdate = true)
public void setVisible(boolean aFlag) 

Source Link

Document

Makes the component visible or invisible.

Usage

From source file:Forms.FrmPrincipal.java

private void genCapasOcultas() {
    pnlCapas.removeAll();//from   w ww.  ja  v a 2 s  .c o m
    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);
}