Results 1 to 4 of 4
  1. #1
    preeta is offline Member
    Join Date
    Apr 2011
    Posts
    4
    Rep Power
    0

    Default scrollpane does not resize based on the container

    I have a Panel which contains two panel. The bottom panel has a scrollpane with a table. When I resize the top panel, the bottom panel resizes but the scrollpane remains the same. How can the scrollpane be increased based on the panel increase. I tried changing the size of the scrollpane and revalidate but it did not change. Thanks for your help
    P

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

    Default

    How can the scrollpane be increased based on the panel increase.
    Bu using a suitable layout manager for the panel.

    db

  3. #3
    preeta is offline Member
    Join Date
    Apr 2011
    Posts
    4
    Rep Power
    0

    Default

    Hi Darryl,

    Thanks for your response. Can you please suggest which layout solves this issue. The panel containing the scrollpane has Borderlayout.

    Thanks

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Have a look at all the layouts -- the tutorial is quite good and has visual representation of the layouts. For instance, if you add a JScrollPane to a BorderLayout-using container in the BorderLayout.CENTER position, it should fill that position.

    If you need further help, then your best bet is create a small compilable and runnable program that demonstrates your problem, an SSCCE, and post it here. Note, that we don't want to see your whole program, and we don't want to see a snippet that doesn't compile, but rather an sscce. please check the link.

Similar Threads

  1. Help with adding a Container within a Container
    By JoKeR313 in forum New To Java
    Replies: 4
    Last Post: 01-02-2011, 04:59 AM
  2. how to add a scrollpane to Jframe
    By yaminisankar in forum AWT / Swing
    Replies: 1
    Last Post: 07-09-2009, 09:56 AM
  3. Replies: 3
    Last Post: 04-21-2009, 11:01 PM
  4. ScrollPane Issues..
    By hanifa in forum AWT / Swing
    Replies: 4
    Last Post: 09-11-2008, 08:18 AM
  5. scrollpane
    By Newb in forum AWT / Swing
    Replies: 0
    Last Post: 06-09-2008, 12:14 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
  •