• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

What's the best rule for fitting a dynamic JTable inside a dialog or a frame?(height issue)

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I want to calculate the height of a dialog that contain only a table depending on how many rows that table it has so I'm using the cross multiplication rule.For example i check initially that my table is well fitting into the dialog(Without space at the bottom) for some value and after that i use the cross multiplication rule because data are dynamic.But unfortunately this rule does not solve the problem.What's the best rule for fitting a dynamic table inside a dialog or a frame? Here is my code.

 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch.

The recommend way is to
1) Set the layout of the parent container to BorderLayout
2) Add the table to a JScrollPane instance
3) Add the scroll pane to the parent container
 
nizar ben mansour
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
but my client wants me that if i have a table i must fill it and gain the space with no use of Jscrollpane what must i do ?
 
nizar ben mansour
Greenhorn
Posts: 3
 
Barry's not gonna like this. Barry's not gonna like this one bit. What is Barry's deal with tiny ads?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic