Reputation: 143
im creating a JAVA Swing Gui atm and i got an issue.
I want to create a list with items and the user should be able to sort the list using some kind of "elementUP" and "elementDown" buttons. Right now im useing buttons with simple chars like ^ and v but they look different.
So my question is are there some Swing or AWT build in function to create such "up" and "down" buttons? If not what are the typical solutions for this kind of problem? Creating an image and setting that image to the button like proposed in Using pictures as buttons? ?
my gui http://s22.postimage.org/ytk62h1d9/up_Down_Java.png
Thanks for your time
Upvotes: 1
Views: 2445
Reputation: 7126
BasicArrowButton
is another way, like they show here and here.
Upvotes: 3
Reputation: 2233
There are two easy ways of doing this:
An easy implementation is to use simple unicode character to represent the meaning using, .setText(unicodecharacter)
, read more here: Arrows_in_Unicode
As you suggested, if you just want an arrow looking component, mimic it using an image.
Upvotes: 1
Reputation: 39641
You could
Choose your favorite.
Upvotes: 3