Results 1 to 5 of 5

Thread: How to use ScrollPane class?

  1. #1
    Join Date
    Jan 2010
    Posts
    99

    How to use ScrollPane class?

    Hi Friend,

    I just started to learn the class concepts of the advanced java programming. While this I am not getting the use of ScrollPane class of java. I don't know anything about methods and constructors of the ScrollPane class. If you has good knowledge about this ScrollPane class of java, then please let know that. You any help over this java class would be greatly appreciated.

  2. #2
    Join Date
    Feb 2008
    Posts
    1,852

    Re: How to use ScrollPane class?

    The ScrollPane class is a container class which implements automatic horizontal and/or vertical scrolling for a single child component. The state of the horizontal and vertical scrollbars is represented by two ScrollPaneAdjustable objects (one for each dimension) which implement the Adjustable interface. The API provides methods to access those objects such that the attributes on the Adjustable object (such as unitIncrement, value, etc.) can be manipulated.

  3. #3
    Join Date
    Jan 2008
    Posts
    1,521

    Re: How to use ScrollPane class?

    Hello friend,

    I suggest you to study following methods of the ScrollPane class:
    • setWheelScrollingEnabled(boolean bln)
    • setScrollPosition(Point pnt)
    • setScrollPosition(int ac, int ad)
    • printComponents(Graphics gp)
    • eventTypeEnabled(int tp)

  4. #4
    Join Date
    Apr 2008
    Posts
    1,948

    Re: How to use ScrollPane class?

    Example of ScrollPane class:
    Code:
    import javax.swing.Icon;
    import javax.swing.ImageIcon;
    import java.awt.ScrollPane;
    
    public class ScrollSampleDM
     {
      public static void main(String affrgs[])
    {
        String t002 = (affrgs.length == 0 ? "JScrollPane Sample" : arffgs[0]);
        JFrame frameW = new JFrame(title);
        frameW.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    
        Icon iconW = new ImageIcon("dog.jpg");
        JLabel dogLabel1 = new JLabel(iconW);
        JScrollPane scrollPane1 = new JScrollPane();
        scrollPane.setViewportView(dogLabel1);
        frameW.getContentPane().add(scrollPane1, BorderLayout.CENTER);
        frameW.setSize(400, 200);
        frameW.setVisible(true);
      }
    }

  5. #5
    Join Date
    May 2008
    Posts
    2,012

    Re: How to use ScrollPane class?

    Hi friend,

    Below I have given four nested classes of the ScrollPane class:
    1. ScrollPane.AccessibleAWTScrollPane
    2. Component.AccessibleAWTComponent
    3. Component.FlipBufferStrategy
    4. Container.AccessibleAWTContainer

Similar Threads

  1. Replies: 8
    Last Post: 08-10-2011, 11:06 PM
  2. Replies: 5
    Last Post: 12-02-2010, 06:23 PM
  3. Concept of Scrollpane Container in Java
    By Adrina_g in forum Software Development
    Replies: 3
    Last Post: 10-12-2009, 09:23 AM
  4. Ultra solid drives:Imation M-Class and S-Class
    By Regina in forum Portable Devices
    Replies: 1
    Last Post: 03-04-2009, 10:34 AM
  5. Good news for CBSE CLASS X & CLASS IX - visit learnnext
    By surya_expert in forum Education Career and Job Discussions
    Replies: 0
    Last Post: 13-12-2008, 12:09 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,727,215,134.57411 seconds with 17 queries