This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

JSpinner arrow listener  RSS feed

 
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I need to change the value only when I press one of the arrows in a JSpinner component.
How can I add a listener to the arrow buttons. I tried ChangeListener but it was not what I needed
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
not sure I understand the question, but this will give you access to the arrow buttons

 
Mathias Nilsson
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks you very much. This was exactly what I was looking for

// Mathias
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EDIT : I see this is ActionListener, ok, I have understand. You can delete my post.
 
Marshal
Posts: 60083
188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

What attracted you to an old thread?
 
Floréal Cabanettes
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:Welcome to the Ranch

What attracted you to an old thread?



Thank you !

I am interested by change the value only when I press one of the arrows in a JSpinner component, like Mathias Nilsson.

The code written by Michael Dunn works fine but buttons of the JSpinner have not the good Look & Feel. Indeed, I use the Nimbus Look & Feel but when I use this code, the buttons of the corresponding JSpinner have not this Look & Feel anymore.

If somebody know how du this without losing the Nimbus Look & Feel...

Thank you in advance for your help.

Floréal.
 
Campbell Ritchie
Marshal
Posts: 60083
188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now, that's an interesting question!

I am sure you can change the look'n'feel. Yes, there is a section about it in the Java Tutorials.
 
Floréal Cabanettes
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have tried this code :


to see if the up button looks now good, but the look and feel of this button has not changed.

Also, my main method of my maint class is this one :


So the nimbus Look & Feel is initialised and all the components except the JSpinner on which I set the UI to myUI have the good look.

I have read the tutorial, but I don't understand how make it to work...

Thanks for your help,

Floréal.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!