Re: Drawing Icons
- From: Jason Cavett <jason.cavett@xxxxxxxxx>
- Date: Thu, 28 Feb 2008 12:08:44 -0800 (PST)
On Feb 28, 1:07 pm, "Larry A Barowski"
<ThisisLarrybarAtEngDotAuburnDotLearninginstitution> wrote:
"Jason Cavett" <jason.cav...@xxxxxxxxx> wrote in message
news:893c036b-21d5-4e72-abb8-95a454234623@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I am working on a tree cell renderer (currently, extends
DefaultTreeCellRenderer) and I want to be able to "draw" the icons as
I need them.
Create your own icon class that implements javax.swing.Icon.
It can draw itself as a composition of sub-images, or entirely
from scratch using drawing primitives.
Great idea, thank you.
I have this pretty much working except for one minor problem...
In order to correctly draw the icon, it appears that I need to know
the size of the icon before I draw it. However, I unfortunately do
not know the width of the icon until later. Is there any way that I
can "draw" the icon and then resize it so the entire thing is
viewable. (Currently, I set the size to 16x16 px, but in some cases
it will need to be 32x16 px.)
Thanks again for your help, Larry.
.
- Follow-Ups:
- Re: Drawing Icons
- From: Larry A Barowski
- Re: Drawing Icons
- References:
- Drawing Icons
- From: Jason Cavett
- Re: Drawing Icons
- From: Larry A Barowski
- Drawing Icons
- Prev by Date: adding a crlf
- Next by Date: Need help with speech therapy package
- Previous by thread: Re: Drawing Icons
- Next by thread: Re: Drawing Icons
- Index(es):
Relevant Pages
|
|