Re: Setting table row height according the renderer component
- From: "Oliver Wong" <owong@xxxxxxxxxxxxxx>
- Date: Thu, 21 Dec 2006 10:36:15 -0500
"noa" <noah.drach@xxxxxxxxx> wrote in message
news:1166689234.871145.216520@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Dec 20, 10:18 pm, "Oliver Wong" <o...@xxxxxxxxxxxxxx> wrote:
"noa" <noah.dr...@xxxxxxxxx> wrote in1.I have to use 1.4*
messagenews:1166621857.102513.143040@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Here, notice that the end of a string is marked "end of text"[code
snipped]
Works for me. I'm using Java 1.6.0.
2. are you sure it works? you saw the "end of text" string at the end
of every text cell?
No, I only saw "end of text" for the cell with the snowboards, not the
cell with the "blah blah blah", so it doesn't actually work.
The problem is that you're using getPreferredSize() to try to determine
the height of the cells. In the case of
"Snowboard\nSnowboard\nSnowboard\nend of text" (or whatever), your text is 4
lines long, and so the preferred size has a height such that it's possible
to display 4 lines. But your "Bla bla bla bla bla bla" is just 1 super long
line, and so the preferred size is something like "width = 500px, height =
20px", i.e. a super wide, but short, rectangle.
Since in your code, you only keep the maximum height, the height for the
Snowboard text is kept, and thus the height is only big enough for 4 lines,
not for the 10 lines of your bla bla bla text.
It looks like you might have to perform line wrapping calculations
manually to get the effect you want.
- Oliver
.
- Follow-Ups:
- References:
- Setting table row height according the renderer component
- From: noah . drach
- Re: Setting table row height according the renderer component
- From: Andrew Thompson
- Re: Setting table row height according the renderer component
- From: Oliver Wong
- Re: Setting table row height according the renderer component
- From: noa
- Setting table row height according the renderer component
- Prev by Date: Re: Writing a Movie Database?
- Next by Date: Re: Setting table row height according the renderer component
- Previous by thread: Re: Setting table row height according the renderer component
- Next by thread: Re: Setting table row height according the renderer component
- Index(es):
Relevant Pages
|