Re: Drawing Icons
- From: Jason Cavett <jason.cavett@xxxxxxxxx>
- Date: Fri, 29 Feb 2008 08:26:05 -0800 (PST)
On Feb 29, 9:57 am, Jason Cavett <jason.cav...@xxxxxxxxx> wrote:
On Feb 29, 12:07 am, "Larry A Barowski"
<ThisisLarrybarAtEngDotAuburnDotLearninginstitution> wrote:
"Jason Cavett" <jason.cav...@xxxxxxxxx> wrote in message
news:c3a6daea-3938-4857-ba34-a97c78c3351a@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
In addition, I have a weird thing going on with the icons which I have
not able to figure out. They draw themselves (and it looks good,
too). Except...the icons are BEHIND the text of the tree nodes.
What are your icons returning for getIconWidth() ?
I'm guessing it is zero or much less than the required
width.
That's actually what's weird.
At the end of the paint function (that I implemented in my icon class)
the icons are returning - IconWidth = 16 OR 32 (depends on which type
of icon I construct), IconHeight = 16.
However, before the paint function occurs, IconWidth and IconHeight
are both 0.
...so...
I tried to START with the IconWidth = 16 and the IconHeight = 16.
Well, that does work. The text is now shifted over. Thank you.
However, I'm now back to the problem where my icons can be different
widths depending on the state of the node. I know you posted about it
up above, but I'm not sure I understand.
Thanks again for your help.
Alright. I got it.
Basically, I have to make sure all my "widths" (and height I suppose,
although I'm forcing that to be = 16px) have to be calculated BEFORE
the paintIcon(java.awt.Component, java.awt.Graphics, int, int) method.
Now, it works beautifully. Thanks again for your help.
.
- References:
- Drawing Icons
- From: Jason Cavett
- Re: Drawing Icons
- From: Larry A Barowski
- Re: Drawing Icons
- From: Jason Cavett
- Re: Drawing Icons
- From: Larry A Barowski
- Re: Drawing Icons
- From: Jason Cavett
- Drawing Icons
- Prev by Date: Re: P~ 0.9 released, new Java-friendly scripting with novel regex
- Next by Date: Re: do u know ramanujan numbers algorithm
- Previous by thread: Re: Drawing Icons
- Next by thread: Re: Drawing Icons
- Index(es):
Relevant Pages
|
|