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.


>> REGISTER NOW TO START POSTING


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

Results 1 to 5 of 5

Thread: How to disable the horizontal scroll of JScrollPane

  1. #1
    Junior Member
    Join Date
    Sep 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy How to disable the horizontal scroll of JScrollPane



    So i'm working in our project a simple lan chat program. And I don't want to add the horizontal scroll.
    How can I disable it?

    Thanks in advance.


  2. #2
    Super Moderator pbrockway2's Avatar
    Join Date
    Jan 2012
    Posts
    1,069
    Thanks
    7
    Thanked 215 Times in 191 Posts

    Default Re: How to disable the horizontal scroll of JScrollPane

    setHorizontalScrollBarPolicy()

    You can do the same from the JScrollPane's constructor.

  3. #3
    Junior Member
    Join Date
    Aug 2012
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: How to disable the horizontal scroll of JScrollPane

    This is Example Swing Basic - click here

  4. #4
    Super Moderator pbrockway2's Avatar
    Join Date
    Jan 2012
    Posts
    1,069
    Thanks
    7
    Thanked 215 Times in 191 Posts

    Default Re: How to disable the horizontal scroll of JScrollPane

    @vhit90: I don't see any example of disabling horizontal scrolling on that page. Maybe I'm missing something.

    The thread is a week old now and the OP never got back with a follow up.

  5. #5
    Junior Member
    Join Date
    Sep 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: How to disable the horizontal scroll of JScrollPane

    Sorry for not replying. I solved the problem using the textwrap method i think. To wrap the messages in the window.

Similar Threads

  1. JScrollPane not showing scroll bars
    By Stx in forum AWT / Java Swing
    Replies: 9
    Last Post: July 5th, 2012, 12:37 PM
  2. [SOLVED] JScrollPane cant paint correctly when scroll
    By fuweng in forum AWT / Java Swing
    Replies: 4
    Last Post: December 6th, 2011, 01:27 PM
  3. Use jbutton to scroll through a jscrollpane
    By joshacurtis in forum AWT / Java Swing
    Replies: 4
    Last Post: November 2nd, 2011, 02:38 AM
  4. Replies: 1
    Last Post: May 21st, 2009, 04:41 AM
  5. Java Program to add scroll bars to JTextArea using JScrollPane
    By Flash in forum Java Code Snippets and Tutorials
    Replies: 1
    Last Post: May 21st, 2009, 04:41 AM