Package javax.swing

Examples of javax.swing.SpinnerNumberModel


   * @param e
   *            the ChangeEvent
   */
    @Override
  public void stateChanged(ChangeEvent e) {
    SpinnerNumberModel model = (SpinnerNumberModel) spinner.getModel();
    int intValue = model.getNumber().intValue();
    setValue(intValue);
  }
View Full Code Here


           int intMaxValue,
           int intStep)
   {
        super(strWhat);

      super._spinner = new JSpinner(new SpinnerNumberModel(
              intValue,
              intMinValue,
              intMaxValue,
              intStep));
View Full Code Here

           double dblStep,
           int intFractionDigits)
   {
      super(strWhat);

      super._spinner = new JSpinner(new SpinnerNumberModel(
              dblValue,
              dblMinValue,
              dblMaxValue,
              dblStep));
View Full Code Here

    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

    listLabel = GT._("These names will be used for button labels");
    //description = "Create a web page containing a text and button pane that scrolls next to a resizable Jmol applet";
  }

  JPanel appletParamPanel() {
    SpinnerNumberModel appletSizeModel = new SpinnerNumberModel(WebExport.getScriptButtonPercent(), //initial value
        20, //min
        100, //max
        5); //step size
    appletSizeSpinnerP = new JSpinner(appletSizeModel);
    //panel to hold spinner and label
View Full Code Here

  }

  JPanel appletParamPanel() {
    // Create the appletSize spinner so the user can decide how big
    // the applet should be.
    SpinnerNumberModel appletSizeModelW = new SpinnerNumberModel(WebExport
        .getPopInWidth(), // initial value
        50, // min
        1000, // max
        25); // step size
    SpinnerNumberModel appletSizeModelH = new SpinnerNumberModel(WebExport
        .getPopInHeight(), // initial value
        50, // min
        1000, // max
        25); // step size
    appletSizeSpinnerW = new JSpinner(appletSizeModelW);
View Full Code Here

    JLabel timeLimitLbl = new JLabel("Time limit for each screening page:");
    timeLimitLayout.add(timeLimitLbl);
   
    timeLimitLayout.add(Box.createHorizontalGlue());
   
    timeLimitSpinnerModel = new SpinnerNumberModel(0// inital value
                            0// min
                            300// max
                            1)// step
    JSpinner timeLimitSpinner = new JSpinner(timeLimitSpinnerModel);
    timeLimitSpinner.setMaximumSize(maxRightSide);
    timeLimitLayout.add(timeLimitSpinner);
   
    Box timeLimitMsgBox = new Box(BoxLayout.X_AXIS);
    timeLimitPanel.add(timeLimitMsgBox);
   
    JLabel timeLimitMsgLbl = new JLabel("Time out message:");
    timeLimitMsgBox.add(timeLimitMsgLbl);
   
    //timeLimitMsgBox.add( Box.createHorizontalGlue() );
   
    timeoutMsgField = new JTextField();
    timeoutMsgField.setPreferredSize( fieldPrefSize );
    timeoutMsgField.setMaximumSize(maxRightSide);
    timeLimitMsgBox.add(timeoutMsgField);
    /*************************************************/
   
    JPanel threatImagesPanel = new JPanel();
    threatImagesPanel.setBorder( BorderFactory.createTitledBorder("Images with a threat")  );
    threatImagesPanel.setLayout( new BoxLayout(threatImagesPanel, BoxLayout.Y_AXIS) );
    pan.add(threatImagesPanel);
    pan.add( Box.createVerticalStrut( 8 ));
   
    Box threatImgCnLayout = new Box( BoxLayout.X_AXIS );
    threatImagesPanel.add(threatImgCnLayout);
   
    JLabel threatImagesNum = new JLabel("Number of images:");
    threatImgCnLayout.add(threatImagesNum);
   
    threatImgCnLayout.add(Box.createHorizontalGlue());
   
    threatImagesSpinnerModel = new SpinnerNumberModel(1, //initial value
                        1, //min
                        99, // max
                        1); // step
    JSpinner threatImagesSpinner = new JSpinnerthreatImagesSpinnerModel );
    threatImagesSpinner.setMaximumSize(maxRightSide);
    threatImgCnLayout.add(threatImagesSpinner);
   
    Box threatAlertLayout = new Box(BoxLayout.X_AXIS);
    threatImagesPanel.add(threatAlertLayout);
   
    JLabel threatAlertLbl = new JLabel("Number of images to show alert for:");
    threatAlertLayout.add(threatAlertLbl);
   
    threatAlertLayout.add(Box.createHorizontalGlue());
   
    threatAlertSpinnerModel = new SpinnerNumberModel(1, //initial value
                             1, // min
                             99, // max
                             1);// step
    JSpinner threatAlertSpinner = new JSpinner(threatAlertSpinnerModel);
    threatAlertSpinner.setMaximumSize(maxRightSide);
    threatAlertLayout.add(threatAlertSpinner);   
   
    /*************************************************/
    JPanel noThreatImagesPanel = new JPanel();
    noThreatImagesPanel.setBorder( BorderFactory.createTitledBorder("Images without a threat")  );
    noThreatImagesPanel.setLayout( new BoxLayout(noThreatImagesPanel, BoxLayout.Y_AXIS) );
    pan.add(noThreatImagesPanel);
    pan.add( Box.createVerticalStrut( 8 ));
   
    Box noThreatImgCnlayout = new Box( BoxLayout.X_AXIS );
    noThreatImagesPanel.add(noThreatImgCnlayout);
   
    JLabel noThreatImagesNum = new JLabel("Number Of Images:");
    noThreatImgCnlayout.add(noThreatImagesNum);
   
    noThreatImgCnlayout.add(Box.createHorizontalGlue());
   
    noThreatImagesSpinnerModel = new SpinnerNumberModel(1, // initial value
                              1, // min
                              99, // max
                              1); // step
    JSpinner noThreatImagesSpinner  = new JSpinner( noThreatImagesSpinnerModel );
    noThreatImagesSpinner.setMaximumSize(maxRightSide);
    noThreatImgCnlayout.add(noThreatImagesSpinner);
   
    Box noThreatAlertLayout = new Box( BoxLayout.X_AXIS );
    noThreatImagesPanel.add(noThreatAlertLayout);
   
    JLabel noThreatAlertLbl = new JLabel("Number of images to show alert for:");
    noThreatAlertLayout.add(noThreatAlertLbl);
   
    noThreatAlertLayout.add(Box.createHorizontalGlue());
   
    noThreatAlertSpinnerModel = new SpinnerNumberModel(1, // initial value
                              1, // min
                              99, // max
                              1); // step
    JSpinner noThreatAlertSpinner = new JSpinner(noThreatAlertSpinnerModel);
    noThreatAlertSpinner.setMaximumSize(maxRightSide);
    noThreatAlertLayout.add(noThreatAlertSpinner);
   
    /*************************************************/
   
    JPanel passFailPanel = new JPanel();
    passFailPanel.setLayout( new BoxLayout(passFailPanel, BoxLayout.Y_AXIS));
    passFailPanel.setBorder( BorderFactory.createTitledBorder("Button Caption"));
    pan.add(passFailPanel);
    pan.add( Box.createVerticalStrut( 8 ));
   
    Box passBox = new Box(BoxLayout.X_AXIS);
    passFailPanel.add(passBox);
   
    JLabel passLbl = new JLabel("Pass Caption");
    passBox.add(passLbl);
   
    passBox.add(Box.createHorizontalGlue());
   
    passCaptionTField = new JTextField(conf.defaultPassBtnCaption);
    passCaptionTField.setMaximumSize(new Dimension(200, 20) );
    passBox.add(passCaptionTField);
   
    Box failBox = new Box(BoxLayout.X_AXIS);
    passFailPanel.add(failBox);
   
    JLabel failLbl = new JLabel("Pass Caption");
    failBox.add(failLbl);
   
    failBox.add(Box.createHorizontalGlue());
   
    failCaptionTField = new JTextField(conf.defaultFailBtnCaption);
    failCaptionTField.setMaximumSize(new Dimension(200, 20) );
    failBox.add(failCaptionTField);
   
   
    /*************** Confidence *************************/
    JPanel confidencePanel = new JPanel();
    confidencePanel.setLayout( new BoxLayout(confidencePanel, BoxLayout.Y_AXIS));
    confidencePanel.setBorder( BorderFactory.createTitledBorder("Confidence Level"));
    pan.add(confidencePanel);
    pan.add( Box.createVerticalStrut( 8 ));
   
    Box confidenceLevelLayout = new Box( BoxLayout.X_AXIS );
    confidencePanel.add(confidenceLevelLayout);
   
    JLabel confidenceLbl = new JLabel("Scale");
    confidenceLevelLayout.add(confidenceLbl);
   
    confidenceLevelLayout.add(Box.createHorizontalGlue());
   
    confidenceLevelModel = new SpinnerNumberModel(0, // initial value
                            0, // min
                            10// max
                            1); // step
    JSpinner confidenceLevelSpinner = new JSpinner(confidenceLevelModel);
    confidenceLevelSpinner.setMaximumSize(maxRightSide);
    confidenceLevelLayout.add(confidenceLevelSpinner);
   
    // ***** msg title
    Box confiMsgLayout = new Box( BoxLayout.X_AXIS );
    confidencePanel.add( confiMsgLayout );
   
    JLabel confiMsgCaptionLbl = new JLabel("Caption");
    confiMsgLayout.add(confiMsgCaptionLbl);
   
    confiMsgLayout.add( Box.createHorizontalGlue() );
    confiCaptionField = new JTextField( conf.defaultConfidenceTitle );
    confiCaptionField.setMaximumSize( maxRightSide );
    confiCaptionField.setPreferredSize( fieldPrefSize );
    confiMsgLayout.add(confiCaptionField);
   
    // ***** left caption row
    Box confiLeftCaptionLayout = new Box( BoxLayout.X_AXIS);
    confidencePanel.add(confiLeftCaptionLayout);
   
    JLabel confiLeftCaptionLbl = new JLabel("Left caption");
    confiLeftCaptionLayout.add(confiLeftCaptionLbl);
   
    confiLeftCaptionLayout.add(Box.createHorizontalGlue());
   
    confiLeftCaptionTField= new JTextField(conf.defaultConfidenceLeft);
    confiLeftCaptionTField.setMaximumSize(maxRightSide);
    confiLeftCaptionLayout.add(confiLeftCaptionTField);
   
    // ***** right caption row
    Box confiRightCaptionLayout = new Box( BoxLayout.X_AXIS);
    confidencePanel.add(confiRightCaptionLayout);
   
    JLabel confiRightCaptionLbl = new JLabel("Right caption");
    confiRightCaptionLayout.add(confiRightCaptionLbl);
   
    confiRightCaptionLayout.add(Box.createHorizontalGlue());
   
    confiRightCaptionTField= new JTextField(conf.defaultConfidenceRight);
    confiRightCaptionTField.setMaximumSize(maxRightSide);
    confiRightCaptionLayout.add(confiRightCaptionTField);
   
    /*************************************************/
    JPanel alarmPanel = new JPanel();
    alarmPanel.setLayout( new BoxLayout(alarmPanel, BoxLayout.Y_AXIS));
    alarmPanel.setBorder(BorderFactory.createTitledBorder("Alarm and Image Apearance"));
    pan.add(alarmPanel);
    pan.add( Box.createVerticalStrut( 8 ));
   
    // alarm duration spinner
    Box alarmDurationLayout = new Box( BoxLayout.X_AXIS);
    alarmPanel.add(alarmDurationLayout);
   
    JLabel alarmDurationLbl = new JLabel("Alarm duration");
    alarmDurationLayout.add(alarmDurationLbl);
   
    alarmDurationLayout.add(Box.createHorizontalGlue());
   
    alarmDurationSpinnerModel = new SpinnerNumberModel(0, // initial value
                                        0, // min
                                        59, // max
                                        1);
    JSpinner alarmDurationSpinner = new JSpinner(alarmDurationSpinnerModel);
    alarmDurationSpinner.setMaximumSize(maxRightSide);
    alarmDurationLayout.add(alarmDurationSpinner);
   
    // alarm delay spinner
    Box alarmDelayLayout = new Box( BoxLayout.X_AXIS);
    alarmPanel.add(alarmDelayLayout);
   
    JLabel alarmDelayLbl = new JLabel("Alarm delay");
    alarmDelayLayout.add(alarmDelayLbl);
   
    alarmDelayLayout.add(Box.createHorizontalGlue());
   
    alarmDelaySpinnerModel = new SpinnerNumberModel(0, // initial value
                                        0, // min
                                        59, // max
                                        1);
    JSpinner alarmDelaySpinner = new JSpinner(alarmDelaySpinnerModel);
    alarmDelaySpinner.setMaximumSize(maxRightSide);
    alarmDelayLayout.add(alarmDelaySpinner);
   
    // image delay spinner
    Box imgDelayLayout = new Box( BoxLayout.X_AXIS);
    alarmPanel.add(imgDelayLayout);
   
    JLabel imgDelayLbl = new JLabel("Image delay");
    imgDelayLayout.add(imgDelayLbl);
   
    imgDelayLayout.add(Box.createHorizontalGlue());
   
    imgDelaySpinnerModel = new SpinnerNumberModel(0, // initial value
                                        0, // min
                                        59, // max
                                        1);
    JSpinner imgDelaySpinner = new JSpinner(imgDelaySpinnerModel);
    imgDelaySpinner.setMaximumSize(maxRightSide);
View Full Code Here

    JLabel delayOkLbl = new JLabel("Delay button Ok (sec)");
    delayOkBox.add(delayOkLbl);
   
    delayOkBox.add(Box.createHorizontalGlue());
   
    delayOkSpinnerModel = new SpinnerNumberModel(0//initial value
                          0,   // min
                          30, // max
                          1); // step
    JSpinner delayOkSpinner = new JSpinner(delayOkSpinnerModel);
    delayOkSpinner.setMaximumSize(maxRightSide);
View Full Code Here

    lblC.gridx=0;
    lblC.gridy=0;

    panel.add(lbl, lblC);

    spinnerModel = new SpinnerNumberModel();
    spinnerModel.setValue( defaultValue );
    JSpinner spinner = new JSpinner( spinnerModel );
    GridBagConstraints fieldC = new GridBagConstraints();
    fieldC.gridx=1;
    fieldC.gridy=0;
View Full Code Here

     
      GridBagConstraints defaultSpinnerConstraint = new GridBagConstraints();
      defaultSpinnerConstraint.gridx = 1;
      defaultSpinnerConstraint.gridy = 1;
      defaultSpinnerConstraint.fill = GridBagConstraints.HORIZONTAL;
      defaultModel= new SpinnerNumberModel();
      JSpinner defaultSpinner = new JSpinner( defaultModel );
      defaultSpinner.addChangeListener( this );
      panel.add(defaultSpinner, defaultSpinnerConstraint);

      // ***** 3rt row
      GridBagConstraints minLblConstraint = new GridBagConstraints();
      minLblConstraint.gridx = 0;
      minLblConstraint.gridy = 2;
      minLblConstraint.anchor = GridBagConstraints.FIRST_LINE_START;
     
      JLabel minLbl = new JLabel("Min value");
      panel.add(minLbl, minLblConstraint);

      GridBagConstraints minSpinnerConstraint = new GridBagConstraints();
      minSpinnerConstraint.gridx = 1;
      minSpinnerConstraint.gridy = 2;
      minSpinnerConstraint.fill = GridBagConstraints.HORIZONTAL;

     
      minModel = new SpinnerNumberModel();
      JSpinner minSpinner = new JSpinner( minModel );
      minSpinner.addChangeListener( this );
      panel.add(minSpinner , minSpinnerConstraint);
     
      // ***** 4th row
      GridBagConstraints maxLblConstraint = new GridBagConstraints();
      maxLblConstraint.gridx = 0;
      maxLblConstraint.gridy = 3;
      maxLblConstraint.anchor = GridBagConstraints.FIRST_LINE_START;
     
      JLabel maxLbl = new JLabel("Max value");
      panel.add(maxLbl, maxLblConstraint);

      GridBagConstraints maxSpinnerConstraint = new GridBagConstraints();
      maxSpinnerConstraint.gridx = 1;
      maxSpinnerConstraint.gridy = 3;
      maxSpinnerConstraint.fill = GridBagConstraints.HORIZONTAL;
   
     
      maxModel = new SpinnerNumberModel();
      maxModel.setValue( 100 );
      JSpinner maxSpinner = new JSpinner( maxModel );
      maxSpinner.addChangeListener( this );
      panel.add(maxSpinner , maxSpinnerConstraint);

      // ***** 5th row
      GridBagConstraints stepSizeLblConstraint = new GridBagConstraints();
      stepSizeLblConstraint.gridx = 0;
      stepSizeLblConstraint.gridy = 4;
      JLabel stepSizeLbl = new JLabel("Step size value");
      panel.add(stepSizeLbl, stepSizeLblConstraint);

      GridBagConstraints stepSizeSpinnerConstraint = new GridBagConstraints();
      stepSizeSpinnerConstraint.gridx = 1;
      stepSizeSpinnerConstraint.gridy = 4;
      stepSizeSpinnerConstraint.fill = GridBagConstraints.HORIZONTAL;
      stepSizeSpinnerConstraint.anchor = GridBagConstraints.FIRST_LINE_START;
     
      stepSizeModel = new SpinnerNumberModel();
      stepSizeModel.setValue(1);
      stepSizeModel.setMinimum(1);
      JSpinner stepSizeSpinner = new JSpinner( stepSizeModel );
      stepSizeSpinner.addChangeListener( this );
      panel.add(stepSizeSpinner , stepSizeSpinnerConstraint);
View Full Code Here

TOP

Related Classes of javax.swing.SpinnerNumberModel

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.