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
0
votes
2 answers

JSpinner dynamicaly updated, how to remove elements?

I have a JSpinner with a SpinnerListModel . What I want to do is, once the list is loaded in the model and the JSpiner shows in a frame, it should be possible to remove elements from the spinner. This will be done just by cliking on a button on the…
0
votes
1 answer

Is there a JSpinner like component for a touchscreen?

I'd like to use a control similar to JSpinner but i need to use it on touchscreen. JSpinner arrow are too small. I'm looking in google but i can't find anything! Do you know some component i can use?
Matteo Gatto
  • 616
  • 11
  • 28
0
votes
1 answer

How to resize the width of the JSpinner arrows?

Is there a simple way to edit the width of the JSpinner arrows?
Meant2Play
  • 57
  • 1
  • 2
  • 6
0
votes
1 answer

JSpinner not reacting on MouseWheelEvent on Windows

This is getting me quite confused: I have a small application that uses a JSpinner for numeric values. I added a MouseAdapter to it, setting the value depending on the resulting event's getScrollAmount() and getWheelRotation(). Everything is working…
DrGlitch
  • 136
  • 11
0
votes
1 answer

jspinner titled border being cut off

So my issue is, which I've had before with Jspinners. Is that I surround my jspinner with a titled border. However in the gui it cuts of the title text because the js is smaller. So how can I force the gui to rezise based on the length of the title,…
whitewolfpgh
  • 441
  • 2
  • 6
  • 13
0
votes
3 answers

Java - Returning minute second millisecond from a JSpinner

OK so there are two parts to this question the first is how can I return JUST the minute second millisecond (mm:ss.SSS) from a JSpinner. I have a JSpinner set up now that's using java's DateEditor format in a JSpinner like this: JSpinner spinner =…
clankfan1
  • 225
  • 2
  • 3
  • 10
0
votes
2 answers

JSpinner (Time) in JTable

I am trying to implement an JSpinner for time in to a JTable , it worked preaty goot at the first look but after losing the focus of the cell the edited cell is being set to "Thu Jan 01 +time+ UTC 1970" the time is being set correctly. How can I…
Kiesa
  • 407
  • 1
  • 19
  • 42
0
votes
1 answer

JSpinner editor locale

I'm creating a JSpinner and setting a NumberEditor with a custom format. But no matter what I do the format uses "." instead of ",", not according to my locale (pt_BR). priceSpinner = new JSpinner(); priceSpinner.setEditor(new…
tuler
  • 3,339
  • 7
  • 34
  • 44
-1
votes
1 answer

How to round a JSpinner value to 2 decimals?

I am currently trying to create a JSpinner that only accepts monetary values, i.e. a maximum of 2 decimals, and I tried to accomplish this using this code: priceSpinner = new JSpinner(); SpinnerNumberModel priceSpinnerModel = new…
NickC64
  • 1
  • 2
-1
votes
1 answer

How to get/store value from JSpinner?

Given the following code, how do I store the selected value from the spinner in thickness1? JSpinner thickn=new JSpinner(); thickn = new JSpinner(new SpinnerNumberModel(1, 1, 60, 1)); thickn.setFont(new Font("Arial Sans-seriff", Font.BOLD,…
-1
votes
1 answer

Make input of JSpinner matching the NumberEditor

If I set a number editor in a JSpinner (for example '# Hz') the input must always correspond to this format. I.e. the input of '0' is rejected and only '0 Hz' is accepted. Is there an easy way to let the input of blank numbers be accepted and…
Mario
  • 214
  • 2
  • 10
-1
votes
2 answers

Cant change date values on Spinner

I want to write some code that receives input from two JSpinners. I want it so that I can change the values of the JSpinners and get the string value from whats shown in the Spinners. I did this by adding a ChangeListener. However in the actual…
David
  • 1
  • 1
-1
votes
1 answer

Set JSpinner model programmatically

I need to set JSpinner model according to some parameters, like if something is X then change the spinner model. This is how I'm doing it: SpinnerNumberModel model = new SpinnerNumberModel(new Float(0.1), new Float(0.0), new Float(0.9), new…
Josef
  • 2,648
  • 5
  • 37
  • 73
-1
votes
2 answers

JSpinner jumping weeks rather than days

I Have created a JSpinner object that moves up and down daily, and skips weekends when clicked on. I then added a feature that if you open the program during a Saturday or Sunday it should roll back to Friday. The issue is rather than changing to…
C. Skjerdal
  • 2,750
  • 3
  • 25
  • 50
-1
votes
1 answer

How to compare time taken as input using JSpinner?

I am using 2 JSpinner controls in my application to allow user to input 24 hour time HH:mm format. I am trying to validate whether end time comes after start time. But it doesn't seem to work as expected. Please help me what is the right way to do…
developer3
  • 75
  • 2
  • 9
1 2 3
23
24