jQuery in Action, 2nd edition*
The moose likes Swing / AWT / SWT and the fly likes How to change jspinner up/down arrows from right to left Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to change jspinner up/down arrows from right to left" Watch "How to change jspinner up/down arrows from right to left" New topic
Author

How to change jspinner up/down arrows from right to left

Pawel Szczepaniak
Greenhorn

Joined: Mar 03, 2010
Posts: 4
Hi all,
If there is any possibility to change right alignment of up/down arrows in jspinner component look to left, or do I have to write my own component?
I was trying to sort this problem on my own but it took me a lot of time and after 4h of searching/trying to solve the problem I end with nothing but writing my own jspinner .
Due to the lack of time I have on my project which includes such a jspinner look I would be very gratefully if someone that know the fast bypass to this would share the solution with me.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4642
    
    5

You would need to write not your own JSpinner but rather a SpinnerUI subclass, possibly extending the SpinnerUI class used by the LaF. Not-very-thoroughyl tested example (use at your own risk and DO test it thoroughly)
edit: shortened the code


luck, db
There are no new questions, but there may be new answers.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39436
    
  28
. . . And welcome to JavaRanch )
Pawel Szczepaniak
Greenhorn

Joined: Mar 03, 2010
Posts: 4
Thanks You!!
Your solution was very usefull form me.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4642
    
    5

To anyone who comes across this thread: please see the update/bug fix in problems with custom JSpinner UI.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to change jspinner up/down arrows from right to left