This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Creating Arrow Icon Help Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "Creating Arrow Icon Help" Watch "Creating Arrow Icon Help" New topic
Author

Creating Arrow Icon Help

Alexander Walker
Ranch Hand

Joined: Jun 04, 2010
Posts: 34
Hi,

Is there anyway to make an arrow Icon that looks good? I tried making one, but it doesn't look any good. Like the lines are not smooth (if you can say so), or like you can see the pixels.
Is there anyway to fix this? And Yes, I do need it to be an Icon.

The commented code are code to add a line at the edge of the arrow, making it a two colored arrow, one color at the edge, and one filled inside the arrow. But after doing that, the arrow became even more messed up.

Please help.

Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
have a look at the code for BasicArrowButton
Alexander Walker
Ranch Hand

Joined: Jun 04, 2010
Posts: 34
Michael Dunn wrote:have a look at the code for BasicArrowButton


Thanks it helped a lot. I was able to do what I think is a pretty decent arrow.

Heres the code for it, for those who want it.

Alexander Walker
Ranch Hand

Joined: Jun 04, 2010
Posts: 34
I updated the code to make the arrows look better, and I made two versions, one where the width and height is the same. And one where the width is twice the size of the height. thought I should share them, They look nicer then the last version anyway.

Edit: I forgot to remove "g.translate(x, y);" in paintIcon




 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Creating Arrow Icon Help
 
Similar Threads
a Jbutton with a rounded border
Good User Interface
JTextField/JPanel with round edged corners
loops in java to produce shapes
Mouse listener question