• Post Reply Bookmark Topic Watch Topic
  • New Topic

table size under JDK1.2.2 vs. JDK1.3  RSS feed

 
josef vavra
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a simple table with 4 rows (JTable in ScriollPane).
I set scrollpane's preferredsize to fit accurately (designed in JDeveloper JDK 1.2.x) and also table.setRowHeight() .
when I run this small program under JDK 1.3 the table doesn't fit into the scrollpane, the difference is about 3 pixels.
Running under JDK 1.2.2 is OK.
No matter which one javac command was used for compiling.
Is there a way to get the same graphic output under both JDKs ???
Thanx
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

While I am not 100 % sure of this, but acc to the API (maybe you have already read it) it looks like in 1.3 the setRowHeight(int h) method talks about height minus row margin where as
the 1.2 API doesn't mention anything like this.
Do you think this might make the difference?
ps: I have never used JTable so far.
regds,
- satya
 
josef vavra
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Madhav Lakkapragada:

While I am not 100 % sure of this, but acc to the API (maybe you have already read it) it looks like in 1.3 the setRowHeight(int h) method talks about height [b]minus row margin
where as
the 1.2 API doesn't mention anything like this.
Do you think this might make the difference?
ps: I have never used JTable so far.
it is not matter of setRowHeight, even without this command, the look is strange in the way I wrote about.
Josef
 
josef vavra
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm a bit sorry,
it is a matter of setRowMargin().
These methods - setRowHeight() and setRowMargin() have considerably different semantics in JDK1.2.2 and JDK 1.3.
If you set the setRowMargin to 0, you can get nearly the same design output (at least the same size of table), but the JDK1.2.2 doesn't show horizontalGridLines even if you set table.setShowHorizontalLines(true);
One of the problem was, that I originally didn't use the setRowxxx() method and tried to find the solution elsewhere. But there are some defaults that have significant impact on the design.
Josef Vavra
But there is not a word warning about this in JDK1.3 help
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!