Jump to content

How to create ScrollPane?

- - - - -

  • Please log in to reply
6 replies to this topic

#1
toto_7

toto_7

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 295 posts
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

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

-Michael Sinz

#2
fread

fread

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 787 posts
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.
Perfection of means and confusion of ends seem to characterize our age. Albert Einstein :confused:

#3
toto_7

toto_7

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 295 posts
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)

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

-Michael Sinz

#4
fread

fread

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 787 posts
I'm sorry but I am trying not to misunderstand you. Could you restate that a bit more clear. ;)
Perfection of means and confusion of ends seem to characterize our age. Albert Einstein :confused:

#5
toto_7

toto_7

    Programming Professional

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

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

-Michael Sinz

#6
fread

fread

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 787 posts
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.
Perfection of means and confusion of ends seem to characterize our age. Albert Einstein :confused:

#7
toto_7

toto_7

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 295 posts
I have JTextArea too. I will check the link again..thanks fread

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

-Michael Sinz




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users