Questions tagged [jspinner]

JSpinner is a class in Java's Swing package. It is a single-line input field that lets the user select a number or an object value from an ordered sequence.

From javadoc:

Spinners typically provide a pair of tiny arrow buttons for stepping through the elements of the sequence. The keyboard up/down arrow keys also cycle through the elements. The user may also be allowed to type a (legal) value directly into the spinner. Although combo boxes provide similar functionality, spinners are sometimes preferred because they don't require a drop down list that can obscure important data.

A JSpinner's sequence value is defined by its SpinnerModel. The model can be specified as a constructor argument and changed with the model property. SpinnerModel classes for some common types are provided: SpinnerListModel, SpinnerNumberModel, and SpinnerDateModel.

357 questions
-1
votes
1 answer

One JSpinner change all

I have a problem with using JSpinner. When I change spinerkp all variables (kp,sp,lk,ct) are changing value, and when I change any other JSpinner nothing happen. I don't know what is wrong with this. Anybody know what is wrong with this? import…
Elrok
  • 333
  • 2
  • 3
  • 10
-1
votes
1 answer

JSpinner returning wrong type

This is really confusing. I have a bunch of JSpinner components in my application, and they all work fine. I have their models set to be a range of integer values. They are declared like so: spinner1 = new…
Colin
  • 205
  • 1
  • 3
  • 9
-1
votes
1 answer

JSpinners slowly denying value modify

In my swing program I have 31 JSpinners, without modifies (JSpinner spinner = new JSpinner();). When I run my program and I go to manually write a value into the value field of the JSpinners, the more JSpinners I write values into, the more I can't…
ServantGrunt
  • 35
  • 11
-1
votes
1 answer

Translate JButton setActionCommand function to JSpinner

I have used JButton setActionCommand(String str) function to detect event for a specific button. I want to do the same thing for a variable of type JSpinner, So i will be able to listen for a spinner that i know. this code work for JButton JButton…
abdou amer
  • 819
  • 2
  • 16
  • 43
-1
votes
1 answer

How to make a custom SpinnerNumberModel power of 2

I'm trying to make a custom SpinnerNumberModel Class and implement 4 methods, which is getValue(), setValue(), getNextValue(), and getPreviousValue(). it seems i always get error from all those methods when i want to set the stepsize to power of 2.…
AHA27
  • 31
  • 1
  • 3
  • 12
-1
votes
1 answer

How to set jSpinner value using existing data

I have an ArrayList and I want to use two jspinners, one for getting the index of the ArrayList and the other for displaying the corresponding integer.
Sotoy
  • 13
  • 4
-1
votes
1 answer

Is there a way of setting the default value to "00:00"?

When I run my program, the default value is the actual time. Is there a way of setting the default value to "00:00"? Date date = new Date(); morningtimeSpinner = new JSpinner(new SpinnerDateModel()); morningtimeSpinner.setBorder(new…
-2
votes
1 answer

How to make max value for a spinner in netbeans through code?

I'm doing a project in java that uses a grille and put elements in it, i made a choice where the position in the grille (x,y) would be selected through a spinner but i ran to a problem where i need to set a max value for the spinners depends of what…
-2
votes
1 answer

How to send Java spinner value to SQL? i want to Save it in date time format in SQL?

First part is the button click part. second part is sql part private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { try { String id1 = jTextField1.getText(); String subj =…
-2
votes
2 answers

How do I create and implement a JSpinner in java?

So I need to know how to create and implement a JSpinner. I scoured the web for three hours to little avail. All I learned was that there aren't any decent tutorials for an inexperienced programmer on how to create OR implement a spinner. So far…
minxed
  • 13
  • 2
-2
votes
1 answer

Take JSpinner back to the last valid value on loss of focus

How can I make the JSpinner go back to the last valid value when it loses focus and also when I press the spinner arrow button?
choymns
  • 17
  • 1
  • 2
-3
votes
1 answer

SpinnerModel functioning example Java Swing

I am trying allready to make custome model for JSpinner but it doesnt work. the code looks like: public class ModelJSpinner implements SpinnerModel { private long value; private long min; private long max; private long increment; private…
DerKerl
  • 11
  • 4
1 2 3
23
24