Package javax.swing

Examples of javax.swing.JSpinner


    @RunsInEDT
    public JSpinner createNew() {
      return execute(new GuiQuery<JSpinner>() {
        @Override
        protected JSpinner executeInEDT() {
          JSpinner spinner = new JSpinner();
          if (!isNullOrEmpty(values)) {
            spinner.setModel(new SpinnerListModel(values));
          }
          spinner.setName(name);
          return spinner;
        }
      });
    }
View Full Code Here


    m_lblToDay.setFont(m_lblToDay.getFont().deriveFont(Font.BOLD, m_lblToDay.getFont().getSize() - 2));
    m_lblToDay.setBackground(Color.BLACK);
    m_lblToDay.setForeground(Color.YELLOW);
    m_lblToDay.setOpaque(true);

    m_spinYear = new JSpinner();
    m_vMonthLIstener = new Vector<MonthListener>();
  }
View Full Code Here

    EvolutionPanel() {
      super(new FlowLayout(FlowLayout.LEFT, 0, 0));
      JPanel innerPanel = new JPanel(new SpringLayout());
     
      populationLabel = new JLabel("Population Size: ");
      populationSpinner = new JSpinner(new SpinnerNumberModel(300, 2, 10000, 1));
      populationLabel.setLabelFor(populationSpinner);
      innerPanel.add(populationLabel);
      innerPanel.add(populationSpinner);
     
      elitismLabel = new JLabel("Elitism: ");
      elitismSpinner = new JSpinner(new SpinnerNumberModel(3, 0, 10000, 1));
      elitismLabel.setLabelFor(elitismSpinner);
      innerPanel.add(elitismLabel);
      innerPanel.add(elitismSpinner);
     
      generationsLabel = new JLabel("Number of Generations: ");
      generationsSpinner = new JSpinner(new SpinnerNumberModel(100, 1, 10000, 1));
      generationsLabel.setLabelFor(generationsSpinner);
      innerPanel.add(generationsLabel);
      innerPanel.add(generationsSpinner);
     
      selectionLabel = new JLabel("Selection Strategy: ");
View Full Code Here

    rowsLabel.setToolTipText(rb.getString("Set number of rows"));
    colsLabel = new JLabel();
    colsLabel.setToolTipText(rb.getString("Set number of columns"));
    rowsLabel.setIcon(Utils.createImageIcon("resize-rows36.png","Rows"));
    colsLabel.setIcon(Utils.createImageIcon("resize-columns36.png","Columns"));
    final JSpinner rowSpinner=new JSpinner(new SpinnerNumberModel(rows,MINIMUM_SELECTABLE_PIXELS,Resource.MAXIMUM_GRID_SIZE,1));
    final JSpinner columnSpinner=new JSpinner(new SpinnerNumberModel(cols,MINIMUM_SELECTABLE_PIXELS,Resource.MAXIMUM_GRID_SIZE,1));
   
    rowSpinner.addChangeListener(new ChangeListener(){
      public void stateChanged(ChangeEvent e){
        int r=((Integer)(rowSpinner.getValue())).intValue();
        if(lockAspectRatio){
          columnSpinner.setValue(new Integer(Math.max(MINIMUM_SELECTABLE_PIXELS,(int)((double)r/imageAspectRatio))));
        }
        int c=((Integer)(columnSpinner.getValue())).intValue();
        if(!lockAspectRatio)imageAspectRatio=(double)r/(double)c;
        updateFinalImage(r,c);
      }
    });
    columnSpinner.addChangeListener(new ChangeListener(){
      public void stateChanged(ChangeEvent e){
        if(!lockAspectRatio){
          int c=((Integer)(columnSpinner.getValue())).intValue();
          int r=((Integer)(rowSpinner.getValue())).intValue();
          imageAspectRatio=(double)r/(double)c;
          updateFinalImage(r,c);
        }
      }
    });
    JPanel rowColPanel=new JPanel(new GridLayout(1,0));
    JPanel rp=new JPanel(new BorderLayout()); rp.add(rowsLabel,BorderLayout.LINE_START); rp.add(rowSpinner,BorderLayout.LINE_END);
    JPanel cp=new JPanel(new BorderLayout()); cp.add(colsLabel,BorderLayout.LINE_START); cp.add(columnSpinner,BorderLayout.LINE_END);
    rowColPanel.add(rp); rowColPanel.add(cp);
    rowColPanel.setBorder(BorderFactory.createEtchedBorder());

    JPanel upperPanel=new JPanel(new GridLayout(0,1));
    upperPanel.add(rowColPanel);
    upperPanel.add(backgroundPanel);
    upperPanel.add(invertPanel);

    JPanel thresholdPanel=new JPanel(new GridLayout(0,1));
    thresholdPanel.add(redThresholdPanel);
    thresholdPanel.add(greenThresholdPanel);
    thresholdPanel.add(blueThresholdPanel);
    thresholdPanel.add(alphaThresholdPanel);

    JCheckBox lockCheckBox = new JCheckBox();
    lockCheckBox.setIcon(Utils.createImageIcon("unlocked36.png","Unlocked"));
    lockCheckBox.setSelectedIcon(Utils.createImageIcon("locked36.png","Locked"));
    lockCheckBox.setRolloverEnabled(false);
    lockCheckBox.setContentAreaFilled(false);
    lockCheckBox.setSelected(false);
    lockAspectRatio=false;
    lockCheckBox.setHorizontalAlignment(SwingConstants.LEFT);
    lockCheckBox.setToolTipText(rb.getString("Lock Aspect Ratio"));
    lockCheckBox.addChangeListener(new ChangeListener(){
        public void stateChanged(ChangeEvent e){
          //ignore irrelevant events
          if(lockAspectRatio=((JCheckBox)(e.getSource())).isSelected())return;
          lockAspectRatio=!lockAspectRatio;
          columnSpinner.setEnabled(!lockAspectRatio);
          if(lockAspectRatio)originalImagePanel.selectAll();
        }
      });
     
    JPanel controlPanel=new JPanel(new BorderLayout());
View Full Code Here

                      maxBlockSizeFactor2);
            advancedPanel.setVisible(false);
            infoPane.add(advancedPanel,c);
           
           
            rowSpinner=new JSpinner(new SpinnerNumberModel(rows,1,Resource.MAXIMUM_GRID_SIZE,1));
            columnSpinner=new JSpinner(new SpinnerNumberModel(cols,1,Resource.MAXIMUM_GRID_SIZE,1));
            pointsizeSpinner=new JSpinner(new SpinnerNumberModel(pointsize,Resource.MINIMUM_CLUE_POINTSIZE,Resource.MAXIMUM_CLUE_POINTSIZE,1));

            int max=(int)Resource.MAXIMUM_GRADE;
            gradeSlider=new JSlider(1, max, grade );
            Hashtable<Integer , JLabel> gradeSliderLabels = new Hashtable<Integer , JLabel>();
            gradeSliderLabels.put(1,new JLabel(Utils.createImageIcon("face-smile-big.png","easyIcon")));
View Full Code Here

    public GaussianParametersPanel()
    {
        JPanel wrapper = new JPanel(new SpringLayout());
        wrapper.add(new JLabel("Mean: "));
        wrapper.add(new JSpinner(meanNumberModel));
        wrapper.add(new JLabel("Standard Deviation: "));
        wrapper.add(new JSpinner(deviationNumberModel));
        SpringUtilities.makeCompactGrid(wrapper, 4, 1, 6, 6, 6, 6);
        add(wrapper, BorderLayout.NORTH);
    }
View Full Code Here

    public ExponentialParametersPanel()
    {
        JPanel wrapper = new JPanel(new SpringLayout());
        wrapper.add(new JLabel("Rate: "));
        wrapper.add(new JSpinner(rateNumberModel));
        SpringUtilities.makeCompactGrid(wrapper, 2, 1, 6, 6, 6, 6);
        add(wrapper, BorderLayout.NORTH);
    }
View Full Code Here

    public PoissonParametersPanel()
    {
        JPanel wrapper = new JPanel(new SpringLayout());
        wrapper.add(new JLabel("Mean: "));
        wrapper.add(new JSpinner(meanNumberModel));
        SpringUtilities.makeCompactGrid(wrapper, 2, 1, 6, 6, 6, 6);
        add(wrapper, BorderLayout.NORTH);
    }
View Full Code Here

            rngCombo.addItem(name);
        }
        rngCombo.setSelectedIndex(3); // Mersenne Twister.
        add(rngCombo);
        add(new JLabel("No. Values: "));
        add(new JSpinner(iterationsNumberModel));
        setBorder(BorderFactory.createTitledBorder("RNG"));
        SpringUtilities.makeCompactGrid(this, 3, 1, 6, 6, 6, 6);
    }
View Full Code Here

    public BinomialParametersPanel()
    {
        JPanel wrapper = new JPanel(new SpringLayout());
        wrapper.add(new JLabel("No. Trials: "));
        wrapper.add(new JSpinner(trialsNumberModel));
        wrapper.add(new JLabel("Probability: "));
        wrapper.add(new JSpinner(probabilityNumberModel));
        SpringUtilities.makeCompactGrid(wrapper, 4, 1, 6, 6, 6, 6);
        add(wrapper, BorderLayout.NORTH);
    }
View Full Code Here

TOP

Related Classes of javax.swing.JSpinner

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.