Results 1 to 4 of 4

Thread: Concept of Scrollpane Container in Java

  1. #1
    Join Date
    Nov 2009
    Posts
    712

    Concept of Scrollpane Container in Java

    Hi Guys,

    Is anybody able to help me to understand the concepts of the scrollpane in JAVA? What is the need to include the scrollpane in program? . I getting too much trouble while learning scrollpane. As it is very important topic of the advance Java, so I should be fully aware about this.
    If you are able to give me some simple example of the scrollpane then it will very appreciable. I am waiting for your reply..
    Last edited by Adrina_g; 10-12-2009 at 08:53 AM.

  2. #2
    Join Date
    May 2008
    Posts
    2,297

    Re: Concept of Scrollpane Container in Java

    Below is the example of the Scrollpane Container of the java:
    import javax.swing.*;

    public class JScrollpaneDemo{

    public static void main(String[] arsg) {
    String str = "Math_coordinate\n" + "Computer_Programer\n"
    + "Physics"
    + "Chemistry" + "Geography" + "Marathi" + "English" ;

    JFrame frame1 = new JFrame("Concept of JScrollPane Container");

    frame.setDefaultCloseOperation(JFrame.EXIT);

    JPanel panel1 = new JPanel();

    JTextArea ar = new JTextArea(str,7,8);

    JScrollPane sp = new JScrollPane(ar);

    panel1.add(sp);

    frame1.add(panel1);
    frame.setVisible(true);
    frame.setSize(500,500);

    }
    }

  3. #3
    Join Date
    Oct 2005
    Posts
    2,393

    Re: Concept of Scrollpane Container in Java

    Scrollpane container class is taken from awt(Abstract Window Toolkit) i.e java.awt.ScrollPane. Scrollpane container support following kind of the scroll bars:
    *.Scrollbars of type "never".
    *.Scrollbars of type "when needed":This scrollpane shows if the child size is more than scrollpane size.
    *.Scrollbars of type "always".

  4. #4
    Join Date
    May 2008
    Posts
    2,389

    Re: Concept of Scrollpane Container in Java

    Hi friends,
    "Scrollpane Container class" is essential to view the component in the scrollable format. We can implement the Scrollpane Container in the java code by using "JScrollPane". Using ScrollPane you can apply both vertical as well as horizontal scrolling to the component. Byusing diiferent methods we can adjust the vertical and horizontal scroll amount.
    For more information regarding the "java Scrollpane Container " please visit the below link:
    http://java.sun.com/docs/books/tutor...crollpane.html
    Last edited by opaper; 10-12-2009 at 09:26 AM.

Similar Threads

  1. why null is assign to main and container in java code?
    By Luz in forum Software Development
    Replies: 5
    Last Post: 05-03-2010, 09:05 PM
  2. How to write a Container Listener in Java?
    By Pratim in forum Software Development
    Replies: 4
    Last Post: 12-02-2010, 06:43 AM
  3. Concept of java beans
    By Jabeen in forum Software Development
    Replies: 4
    Last Post: 01-12-2009, 10:59 AM
  4. threads concept in java
    By vijji191 in forum Software Development
    Replies: 2
    Last Post: 30-11-2009, 03:44 PM
  5. Basic concept of delegates in java
    By Honorata in forum Software Development
    Replies: 3
    Last Post: 17-11-2009, 09:12 AM

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,713,448,588.83441 seconds with 17 queries