Results 1 to 2 of 2
  1. #1
    Jarob22 is offline Member
    Join Date
    Mar 2011
    Rep Power

    Default Making JScrollPane not stretch

    Hey there,

    I have a JScrollPane inside which is a JTextArea. This area is for messages to pop up on and such. This works fine, but for some reason it seems to stretch across the entirety of the JPanel is has been added to, even when I a) set the width of the scrollpane to less using SetPreferredSize and/or use the same method to set the width of the JPanel it is sitting in to less (I do use pack() so that these methods are actually used). All I wish to do is set the width of the text area so that it sits nicely in the middle of the gui rather than stretching to the edges, which looks bad and isn't needed.


  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power

Similar Threads

  1. Need Help With JScrollPane Please
    By MemorableSmile in forum New To Java
    Replies: 4
    Last Post: 01-31-2011, 02:39 AM
  2. JScrollPane
    By hiddenpremise in forum AWT / Swing
    Replies: 2
    Last Post: 12-25-2010, 05:15 AM
  3. JScrollPane
    By UJJAL DHAR in forum New To Java
    Replies: 12
    Last Post: 08-17-2010, 06:47 PM
  4. jscrollpane
    By kaemonsaionji in forum New To Java
    Replies: 3
    Last Post: 02-25-2009, 08:39 AM
  5. help with JScrollPane
    By tommy in forum AWT / Swing
    Replies: 1
    Last Post: 08-06-2007, 07:58 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