• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Pawel Szczepaniak
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5125
11
Java Netbeans IDE Opera
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Campbell Ritchie
Sheriff
Posts: 48382
56
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
. . . And welcome to JavaRanch )
 
Pawel Szczepaniak
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks You!!
Your solution was very usefull form me.
 
Darryl Burke
Bartender
Posts: 5125
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To anyone who comes across this thread: please see the update/bug fix in problems with custom JSpinner UI.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic