Results 1 to 3 of 3
  1. #1
    Martino is offline Member
    Join Date
    Apr 2011
    Posts
    12
    Rep Power
    0

    Default Question about resizing / packing JTable in JDialog.

    Dear,

    I programmed a JDialog with the BorderLayout.

    In the CENTER, I placed a JTable, and in the SOUTH, I placed a panel with buttons. When the JDialog is being made, the JTable is being filled by files of a specific directory.

    So, when the JDialog is showing up, you can see a list of files, but the problem is that the JDialog is not repacking / resizing itself to the size of the number of rows in the JTable and the width of the JTable. The JDialog is too big.

    Now, I would like to know I can see repack / resize this JDialog to the JTable with contents.

    What is the Java source code for doing that?

    Thank you for your answer in advance.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default

    To get better help sooner, post a SSCCE that clearly demonstrates your problem.

    Don't forget to surround your code with the code tags so it retains its formatting.

    db

  3. #3
    asifzbaig is offline Member
    Join Date
    May 2011
    Posts
    56
    Rep Power
    0

    Default

    It will be better to enclose your JTable in a scroll pane in the CENTER of BorderLayout it will make you free from resizing the dialog whenever your table size increases aur decreases....

Similar Threads

  1. JFrame resizing question
    By mellowcandle in forum AWT / Swing
    Replies: 2
    Last Post: 04-13-2011, 01:48 PM
  2. Packing an Application
    By Lingerz in forum New To Java
    Replies: 5
    Last Post: 08-26-2010, 02:08 AM
  3. packing java project
    By silversurfer2in in forum New To Java
    Replies: 12
    Last Post: 06-09-2010, 08:58 AM
  4. Problem in resizing JTable in netbeans
    By shahid0627 in forum NetBeans
    Replies: 1
    Last Post: 09-07-2009, 06:33 PM
  5. Packing vars
    By Supamagier in forum Advanced Java
    Replies: 6
    Last Post: 09-20-2008, 12:26 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
  •