Results 1 to 3 of 3
  1. #1
    Paul279 is offline Member
    Join Date
    Oct 2012
    Posts
    34
    Rep Power
    0

    Default jTable-height should fit to the content of the jtable

    Hello community,
    I have a jTable with one or 40 rows in it.
    The problem is, also when I have only one row in my jTable, the size of the jTable is a little more bigger than 40 rows.
    How can I say the jTable, that she should scale to the size of the content?

    I don`t want that the jTable is bigger than the content. For example the picture below:
    jTable-height should fit to the content of the jtable-now.jpg

    Thanks for your help

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,963
    Rep Power
    8

    Default Re: jTable-height should fit to the content of the jtable

    Can you provide an MCVE that shows us what kinds of layouts you're using?

    But just off the top of my head, you might want to try out the setFillsViewportHeight() function.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Paul279 is offline Member
    Join Date
    Oct 2012
    Posts
    34
    Rep Power
    0

    Default Re: jTable-height should fit to the content of the jtable

    Thanks for the tip, setFillsViewportHeight solved my problem

Similar Threads

  1. Shrink JTable row's height
    By marwroc in forum AWT / Swing
    Replies: 1
    Last Post: 04-14-2013, 08:22 PM
  2. JTable content refreshing
    By ContoNick in forum New To Java
    Replies: 3
    Last Post: 06-08-2012, 07:55 PM
  3. Replies: 4
    Last Post: 04-02-2012, 07:57 PM
  4. Content from Database at runtime in Jtable
    By Aryanraj in forum AWT / Swing
    Replies: 1
    Last Post: 02-07-2012, 03:40 PM
  5. Replies: 2
    Last Post: 05-15-2008, 10:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •