Examples of SpinnerModel


Examples of javax.swing.SpinnerModel

     * Creates one Spinner
     *
     * @return Spinner
     */
    private JSpinner createSpinner() {
        SpinnerModel model = new SpinnerNumberModel(100, 0, 255, 1);

        JSpinner ret = new JSpinner(model);
        ret.setMinimumSize(new Dimension(50, 10));
        ret.setPreferredSize(new Dimension(50, 10));
        return ret;
View Full Code Here

Examples of javax.swing.SpinnerModel

   * @return popup
   */
  private JPopupMenu createPopup() {
    JPopupMenu menu = new JPopupMenu();
   
    SpinnerModel model = new SpinnerNumberModel(1, 0, item.getQuantity(), 1);
    spinner = new JSpinner(model);
    /*
     * Setup a key listener for the editor field so that the drop is
     * performed when the user presses enter.
     */
 
View Full Code Here

Examples of javax.swing.SpinnerModel

    this.lheurePM = new JLabel("Heure de d�but ( en PM+X ) :");
    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);
View Full Code Here

Examples of javax.swing.SpinnerModel

    this.lheurePM = new JLabel("Heure de d�but ( en PM+X ) :");
    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);
View Full Code Here

Examples of javax.swing.SpinnerModel

{
  public void test(TestHarness harness)
  {
    harness.checkPoint("(SpinnerModel)");
    MyJSpinner s1 = new MyJSpinner();
    SpinnerModel m1 = new SpinnerNumberModel();
    JComponent e1 = s1.createEditor(m1);
    harness.check(e1 instanceof JSpinner.NumberEditor);
    // no listeners added to the editor yet
    EventListener[] e1l = e1.getListeners(ChangeListener.class);
    harness.check(e1l.length, 0);
   
    SpinnerModel m2 = new SpinnerDateModel();
    MyJSpinner s2 = new MyJSpinner(m2);
    JComponent e2 = s2.createEditor(m2);
    harness.check(e2 instanceof JSpinner.DateEditor);
    // no listeners added to the editor yet
    EventListener[] e2l = e2.getListeners(ChangeListener.class);
    harness.check(e2l.length, 0);
   
    SpinnerModel m3 = new SpinnerListModel();
    MyJSpinner s3 = new MyJSpinner(m3);
    JComponent e3 = s3.createEditor(m3);
    harness.check(e3 instanceof JSpinner.ListEditor);
    // no listeners added to the editor yet
    EventListener[] e3l = e3.getListeners(ChangeListener.class);
View Full Code Here

Examples of javax.swing.SpinnerModel

    linkControls.add(memBox);
    memBox.setSelectedIndex(0);
   
    JLabel procLabel = new JLabel(GT._("Number of Processors:"));
    linkLabels.add(procLabel);
    SpinnerModel procModel = new SpinnerNumberModel(1, 1, 16, 1);
    procSpinner = new JSpinner(procModel);
    procSpinner.setEditor(new JSpinner.NumberEditor(procSpinner, "#"));
    linkControls.add(procSpinner);
   
    linkPanel.add(linkLabels, BorderLayout.LINE_START);
    linkPanel.add(linkControls, BorderLayout.CENTER);
   
    showPanel.add(linkPanel, BorderLayout.NORTH);
   
    JPanel routePanel = new JPanel(new BorderLayout());
    TitledBorder routeTitle = BorderFactory.createTitledBorder(GT._("Route"));
    routePanel.setBorder(routeTitle);
   
    JPanel routeLabels = new JPanel(new GridLayout(4,1));
    JPanel routeControls = new JPanel(new GridLayout(4,1));
   
    JLabel methLabel = new JLabel(GT._("Method: "));
    routeLabels.add(methLabel);
    methBox = new JComboBox(METHOD_LIST);
    routeControls.add(methBox);
    methBox.setSelectedIndex(0);
    methBox.addActionListener(this);
   
    JLabel basisLabel = new JLabel(GT._("Basis Set: "));
    routeLabels.add(basisLabel);
    basisBox = new JComboBox(BASIS_LIST);
    routeControls.add(basisBox);
    basisBox.setSelectedIndex(3);
  
   
    JLabel dfLabel =
      new JLabel(GT._("Density Fitting Basis Set (DFT Only): "));
    routeLabels.add(dfLabel);
    dfBox = new JComboBox(DF_LIST);
    routeControls.add(dfBox);
    dfBox.setSelectedIndex(0);
   
    JLabel optsLabel = new JLabel(GT._("Job Options: "));
    routeLabels.add(optsLabel);
    optsField = new JTextField(20);
    routeControls.add(optsField);
    optsField.setText("opt");
   
    routePanel.add(routeLabels, BorderLayout.LINE_START);
    routePanel.add(routeControls, BorderLayout.CENTER);
   
    showPanel.add(routePanel, BorderLayout.CENTER);
   
    JPanel molPanel = new JPanel(new BorderLayout());
    TitledBorder molTitle =
      BorderFactory.createTitledBorder(GT._("Molecular Properties"));
    molPanel.setBorder(molTitle);
   
    JPanel molLabels = new JPanel(new GridLayout(3,1));
    JPanel molControls = new JPanel(new GridLayout(3,1));
   
    JLabel chargeLabel = new JLabel(GT._("Total Charge: "));
    molLabels.add(chargeLabel);
    SpinnerModel chargeModel = new SpinnerNumberModel(0, -10, 10, 1);
    chargeSpinner = new JSpinner(chargeModel);
    chargeSpinner.setEditor(new JSpinner.NumberEditor(chargeSpinner, "#"));
    molControls.add(chargeSpinner);
   
    JLabel multLabel = new JLabel(GT._("Multiplicity: "));
    molLabels.add(multLabel);
    SpinnerModel multModel = new SpinnerNumberModel(1, 0, 10, 1);
    multSpinner = new JSpinner(multModel);
    multSpinner.setEditor(new JSpinner.NumberEditor(multSpinner, "#"));
    molControls.add(multSpinner);
   
    JLabel selectLabel = new JLabel(GT._("Selection: "));
View Full Code Here

Examples of javax.swing.SpinnerModel

  private void defaultValuesInteger() {
    for (Entry<ConfigurationValueInteger, Object> entry : integerValues.entrySet()) {
      if ((entry.getValue() != null) && (entry.getKey() != null)) {
        if (entry.getValue() instanceof JSpinner) {
          JSpinner spinner = (JSpinner) entry.getValue();
          SpinnerModel model = spinner.getModel();
          model.setValue(Integer.valueOf(entry.getKey().getDefaultValue()));
        }
        if (entry.getValue() instanceof ButtonGroup) {
          ButtonGroup group = (ButtonGroup) entry.getValue();
          setButtonGroupSelection(group, entry.getKey().getDefaultValue());
        }
View Full Code Here

Examples of javax.swing.SpinnerModel

        return painterControl;
    }

    private JSpinner createSpinner(int min, int max, int value) {
        SpinnerModel model = new SpinnerNumberModel(value, min, max, 1);
        JSpinner spinner = new JSpinner(model);
        ((DefaultEditor) spinner.getEditor()).getTextField().setEditable(false);
        return spinner;
       
    }
View Full Code Here

Examples of javax.swing.SpinnerModel

    this.titleMessage = new JLabel("<html><b>NOTE:</b> <ul> <li>Database should be empty before start the generator (use the cleaning service) to prevent duplication error</li> " +
                    "<li>If a partitioned table has no partition for the random value the current version of the generator will fail!</li> " +
                    "<li>Restart the application before retry a filling activity, to reset the random generators.</li>" +
                    "</ul></html>");
   
    SpinnerModel model = new SpinnerNumberModel(SPINNER_INITIAL_VALUE,SPINNER_MIN_VALUE,spinnerMaxValue,SPINNER_STEP_SIZE);   
   
    recordToInsertSpinner = new JSpinner(model);
    // get the default editor of the spinner and disable it to prevent editing from keyboard
    JSpinner.DefaultEditor editor = (JSpinner.DefaultEditor) recordToInsertSpinner.getEditor();
    editor.getTextField().setEnabled(true);
View Full Code Here

Examples of javax.swing.SpinnerModel

        c.insets = new Insets(3, 5, 0, 3);
        c.gridwidth = GridBagConstraints.REMAINDER;

     add(new JLabel(I18N.gettext("fontsize.The_default_font_size_in_chat_windows")), c);

    SpinnerModel model = new SpinnerNumberModel(
            Preferences.getInteger("fontsize", "font-size", 14),
            4, 100, 1);
        size = new JSpinner(model);
        c.gridwidth = 1;
     add(new JLabel(I18N.gettext("fontsize.Font_Size")), c);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.