Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

How to create ScrollPane?


  • Please log in to reply
6 replies to this topic

#1 toto_7

toto_7

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 244 posts

Posted 27 November 2011 - 01:58 PM

Hello,

I need help with JScrollPane because never used it before. Need to add a JScrollPane in my panel in order to can see new items that getting out of GUI edges. I have a JPanel that contains an ArrayList, that list contains moves that player making step by step. So, as my GUI it is I can see just the first 5-6 moves, the rest are not visible. Found some tutorials in the Internet, tried them but didn't do anything. Can anyone please help me with the right way? I need a vertical scroll bar inside a JPanel that contains an ArrayList.

Thank you
toto_7
  • 0

"Programming is like **. One mistake and you have to support it for the rest of your life."

-Michael Sinz

#2 fread

fread

    Programming God

  • Senior Member
  • PipPipPipPipPipPip
  • 897 posts
  • Location:Trinidad and Tobago
  • Learning:C, Java, C++, C#, PHP, Python, PL/SQL

Posted 27 November 2011 - 02:57 PM

Which part(s) exactly is not working? Getting the ScrollPane up? It is up but it is not scrolling/autoscrolling. Putting an ArrayList inside of the ScrollPane :confused:
Did you look here.
  • 0

#3 toto_7

toto_7

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 244 posts

Posted 27 November 2011 - 03:12 PM

All I achieved were to put a scroll bar but was inactivated and didn't activate when moves getting out of GUI. No, no putting ArrayList in the ScrollPane. Put ScrollPane in JPanel that contains an ArrayList(JTextArea)
  • 0

"Programming is like **. One mistake and you have to support it for the rest of your life."

-Michael Sinz

#4 fread

fread

    Programming God

  • Senior Member
  • PipPipPipPipPipPip
  • 897 posts
  • Location:Trinidad and Tobago
  • Learning:C, Java, C++, C#, PHP, Python, PL/SQL

Posted 27 November 2011 - 03:50 PM

I'm sorry but I am trying not to misunderstand you. Could you restate that a bit more clear. ;)
  • 0

#5 toto_7

toto_7

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 244 posts

Posted 27 November 2011 - 03:57 PM

Sure, firstly please tell me, on which components you can add a scroll bar? All of them?
  • 0

"Programming is like **. One mistake and you have to support it for the rest of your life."

-Michael Sinz

#6 fread

fread

    Programming God

  • Senior Member
  • PipPipPipPipPipPip
  • 897 posts
  • Location:Trinidad and Tobago
  • Learning:C, Java, C++, C#, PHP, Python, PL/SQL

Posted 27 November 2011 - 04:01 PM

I'm not sure of the exact list. But i have used them on Text areas before. The link in my earlier post has an example with a picture. You can view the java docs for the specifics.
  • 0

#7 toto_7

toto_7

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 244 posts

Posted 27 November 2011 - 04:11 PM

I have JTextArea too. I will check the link again..thanks fread
  • 0

"Programming is like **. One mistake and you have to support it for the rest of your life."

-Michael Sinz




Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download