Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: JPanel with ScrollBars

  1. #1
    Forum VIP
    Join Date
    Jul 2010
    Thanked 329 Times in 305 Posts

    Default JPanel with ScrollBars

    I created a JPanel with ScrollBars by creating a JScrollPane.

    My intent is to have the JPanel Scrollable when the number of JLabels are too great to be displayed in the frame size. The problem is that even after the number of JLabels extends beyond the setPreferredSize of the JScrollPane, it doesn't scroll.

    I will provide my code at a later time (when I can get internet access on my laptop again). For now, if i could get some shots in the dark as far as what could cause this, that would be great.

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Eastern Florida
    Thanked 2,274 Times in 2,245 Posts

    Default Re: JPanel with ScrollBars

    setPreferredSize of the JScrollPane,
    How is the preferred size of the expanding JPanel handled? I assume that is where you are adding the JLabels.

Similar Threads

  1. How to use the same variable in various JPanel?
    By danielpereira in forum What's Wrong With My Code?
    Replies: 1
    Last Post: September 19th, 2010, 12:08 PM
  2. JButton on JPanel
    By JavaLearner in forum AWT / Java Swing
    Replies: 4
    Last Post: March 26th, 2010, 07:46 AM
  3. how to destroy JPanel?
    By amahara in forum AWT / Java Swing
    Replies: 2
    Last Post: February 28th, 2010, 02:41 AM
  4. How to copy image from one jpanel to another jpanel
    By ramanavarayuri1986 in forum AWT / Java Swing
    Replies: 0
    Last Post: February 15th, 2010, 01:36 AM
  5. Creating and displaying a JPanel inside another JPanel
    By JayDuck in forum AWT / Java Swing
    Replies: 1
    Last Post: April 7th, 2009, 08:02 AM