Package javax.swing

Examples of javax.swing.JSpinner$NumberEditorFormatter


    bg.add(valueSelector);
    bg.add(redSelector);
    bg.add(greenSelector);
    bg.add(blueSelector);

    hue = new JSpinner(new SpinnerNumberModel(0, 0, 359, 1));
    hue.addChangeListener(new HSBKeyboardInputHandler());
    saturation = new JSpinner(new SpinnerNumberModel(0, 0, 100, 1));
    saturation.addChangeListener(new HSBKeyboardInputHandler());
    value = new JSpinner(new SpinnerNumberModel(0, 0, 100, 1));
    value.addChangeListener(new HSBKeyboardInputHandler());

    red = new JSpinner(new SpinnerNumberModel(0, 0, 255, 1));
    red.addChangeListener(new RGBKeyboardInputHandler());
    green = new JSpinner(new SpinnerNumberModel(0, 0, 255, 1));
    green.addChangeListener(new RGBKeyboardInputHandler());
    blue = new JSpinner(new SpinnerNumberModel(0, 0, 255, 1));
    blue.addChangeListener(new RGBKeyboardInputHandler());

    colorCode = new JTextField();
    colorCode.setColumns(6);
    colorCode.getDocument().addDocumentListener(new ColorCodeInputHandler());
View Full Code Here


    dialogModel = new NamedDataSourceDialogModel();
    dialogModel.getQueries().addListDataListener(updateHandler);
    dialogModel.addPropertyChangeListener(confirmAction);

    maxPreviewRowsSpinner = new JSpinner(new SpinnerNumberModel(10000, 1, Integer.MAX_VALUE, 1));

    cubeConnectionNameField = new JTextField(null, 0);
    cubeConnectionNameField.setColumns(30);
    cubeConnectionNameField.getDocument().addDocumentListener(confirmAction);
View Full Code Here

    this.lheurePM.setBounds(20, 240, 180, 30);
   
   
    String[] dataCoef = {"45", "60", "90"};
    SpinnerModel modelCoef = new SpinnerListModel(dataCoef);
    this.sCoef = new JSpinner(modelCoef);
    this.sCoef.setBounds(180, 20, 100, 30);
   
    String[] data = {"Initiation", "Entrainement"};
    SpinnerModel model = new SpinnerListModel(data);
    this.sDiff = new JSpinner(model);
    this.sDiff.setBounds(180, 60, 100, 30);
   
    this.sbAvance = new JCheckBox("Activer les options avanc�es");
    this.sbAvance.setBounds(300, 20, 200, 30);
    this.sbAvance.addChangeListener(this);
   
    this.bValider = new JButton("Valider");
    this.bValider.setBounds(220, 300, 100, 30);
    this.bValider.addActionListener(this);
   
    String[] dataHeure = new String[24];
    for(int i = 0; i < 24; i++){
      dataHeure[i] = String.valueOf(i);
    }
    SpinnerModel modelHeure = new SpinnerListModel(dataHeure);
    this.sHeure = new JSpinner(modelHeure);
    this.sHeure.setBounds(220, 200, 150, 30);
    this.sHeure.setEnabled(false);
   
    String[] dataHeurePM = new String[12];
    for(int i = 0; i < 12; i++){
      dataHeurePM[i] = String.valueOf(i);
    }
    SpinnerModel modelHeurePM = new SpinnerListModel(dataHeurePM);
    this.sHeurePM = new JSpinner(modelHeurePM);
    this.sHeurePM.setBounds(220, 240, 150, 30);
    this.sHeurePM.setEnabled(false);
   
    this.add(this.lCoef);
    this.add(this.lDiff);
View Full Code Here

    this.lheurePM.setBounds(20, 240, 180, 30);
   
   
    String[] dataCoef = {"45", "60", "90"};
    SpinnerModel modelCoef = new SpinnerListModel(dataCoef);
    this.sCoef = new JSpinner(modelCoef);
    this.sCoef.setBounds(180, 20, 100, 30);
   
    String[] data = {"Initiation", "Entrainement"};
    SpinnerModel model = new SpinnerListModel(data);
    this.sDiff = new JSpinner(model);
    this.sDiff.setBounds(180, 60, 100, 30);
   
    this.sbAvance = new JCheckBox("Activer les options avanc�es");
    this.sbAvance.setBounds(300, 20, 200, 30);
    this.sbAvance.addChangeListener(this);
   
    this.bValider = new JButton("Valider");
    this.bValider.setBounds(220, 300, 100, 30);
    this.bValider.addActionListener(this);
   
    String[] dataHeure = new String[24];
    for(int i = 0; i < 24; i++){
      dataHeure[i] = String.valueOf(i);
    }
    SpinnerModel modelHeure = new SpinnerListModel(dataHeure);
    this.sHeure = new JSpinner(modelHeure);
    this.sHeure.setBounds(220, 200, 150, 30);
    this.sHeure.setEnabled(false);
   
    String[] dataHeurePM = new String[12];
    for(int i = 0; i < 12; i++){
      dataHeurePM[i] = String.valueOf(i);
    }
    SpinnerModel modelHeurePM = new SpinnerListModel(dataHeurePM);
    this.sHeurePM = new JSpinner(modelHeurePM);
    this.sHeurePM.setBounds(220, 240, 150, 30);
    this.sHeurePM.setEnabled(false);
   
    this.add(this.lCoef);
    this.add(this.lDiff);
View Full Code Here

    super(null);
  }

  @Override
  protected Component createWidget() {
    JSpinner spinner = new JSpinner();
    Dimension size = spinner.getPreferredSize();
    spinner.setSize(size);
    spinner.doLayout();
    spinner.validate();
    return spinner;
  }
View Full Code Here

    return spinner;
  }

  @Override
  protected Component newWidget() {
    return new JSpinner();
  }
View Full Code Here

  }
 
  public void testConstructor1(TestHarness harness)
  {
    harness.checkPoint("(JSpinner)");
    JSpinner s = new JSpinner();
    JSpinner.NumberEditor e = new JSpinner.NumberEditor(s);
    harness.check(e.getLayout(), e);
    harness.check(e.getFormat(), NumberFormat.getInstance());
    JFormattedTextField ftf = e.getTextField();
    NumberFormatter nf = (NumberFormatter) ftf.getFormatter();
    harness.check(nf.getMinimum(), null);
    harness.check(nf.getMaximum(), null);
   
    SpinnerNumberModel m = new SpinnerNumberModel(50.0, 0.0, 100.0, 5.0);
    s = new JSpinner(m);
    e = new JSpinner.NumberEditor(s);
    harness.check(e.getFormat(), NumberFormat.getInstance());
    ftf = e.getTextField();
    nf = (NumberFormatter) ftf.getFormatter();
    harness.check(nf.getMinimum(), new Double(0.0));
View Full Code Here

  }

  public void testConstructor2(TestHarness harness)
  {
    harness.checkPoint("(JSpinner, String)");
    JSpinner s = new JSpinner();
    JSpinner.NumberEditor e = new JSpinner.NumberEditor(s, "0.00");
    harness.check(e.getLayout(), e);
    harness.check(e.getFormat(), new DecimalFormat("0.00"));
   
    // try null spinner argument
View Full Code Here

public class getFormat implements Testlet
{
  public void test(TestHarness harness)
  {
    harness.checkPoint("()");
    JSpinner s = new JSpinner();
    JSpinner.NumberEditor e = new JSpinner.NumberEditor(s);
    harness.check(e.getTextField().getFormatterFactory()
        instanceof DefaultFormatterFactory);
    harness.check(e.getFormat(), NumberFormat.getInstance());
  }
View Full Code Here

  public void test(TestHarness harness)
  {
    harness.checkPoint("()");
    SpinnerNumberModel m = new SpinnerNumberModel(50.0, 0.0, 100.0, 5.0);
    JSpinner s = new JSpinner(m);
    JSpinner.NumberEditor editor = (JSpinner.NumberEditor) s.getEditor();
    harness.check(editor.getModel(), m);
  }
View Full Code Here

TOP

Related Classes of javax.swing.JSpinner$NumberEditorFormatter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.