Results 1 to 2 of 2
  1. #1
    ElvisMachuca is offline Member
    Join Date
    Jan 2013
    Posts
    32
    Rep Power
    0

    Default JScrollPane component not scrolling objects inside JPanel

    Hi,

    I am trying to place a number of JLabel and JTextField objects inside a JPanel which has a JScrollPane.

    One thing is, that at one time, I have have a certain number of JLabel and JTextField objects which number would cover an area greater than the JPanel's vertical size.

    How when I implement the JScrollPane and I run the program, the scroll bars appear, but they don't scroll the pane inside the JPanel, the items are fixed.

    Could the problem be because I am using a Null Layout.

    Will I have to use one of the standard layouts available, like GridLayout for the JScrollPane scrolling function to work?

    Need help.

    Thanks.

  2. #2
    ElvisMachuca is offline Member
    Join Date
    Jan 2013
    Posts
    32
    Rep Power
    0

    Default Re: JScrollPane component not scrolling objects inside JPanel

    Never mind, I figure it out.

    It was the setLayout(null);

    I needed to use a LayoutManager layout to be able to scroll.

    I am using GridLayout.

Similar Threads

  1. JScrollPane and programatic scrolling
    By brajan1984 in forum AWT / Swing
    Replies: 2
    Last Post: 01-04-2013, 06:13 PM
  2. Heavyweight Component resizing inside JScrollpane
    By random7 in forum AWT / Swing
    Replies: 2
    Last Post: 07-20-2010, 01:58 PM
  3. Automatic scrolling of JScrollPane
    By chayan in forum AWT / Swing
    Replies: 2
    Last Post: 07-03-2010, 05:51 AM
  4. Getting JScrollPane to stop auto-scrolling
    By Shadow in forum AWT / Swing
    Replies: 8
    Last Post: 10-21-2008, 08:52 PM
  5. JScrollPane not scrolling
    By Riftwalker in forum Advanced Java
    Replies: 2
    Last Post: 07-17-2007, 08:16 PM

Posting Permissions

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