File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

scrolling standalone app

 
miguel lisboa
Ranch Hand
Posts: 1281
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when working in a web app its easy: you keep adding forms, textareas and so on so the webpage has to scroll.
My Q: is this possible with a standalone app?
i asked because someone showed me one, made in java, where there are several checkboxes, textfields and so on and all this scrolls!!(inside the app)
i tried adding a jscrollpane to my app and then add several components to it but it didnt work.
How can one do it?
thanks in advance
 
Joe Ess
Bartender
Posts: 9214
9
Linux Mac OS X Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A scroll pane scrolls a single component. You should add your components to a single container (Box, JPanel) and create a JScrollPane instance with it. Take a look at the Java Tutorial on Scroll Panes for more info.
 
miguel lisboa
Ranch Hand
Posts: 1281
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
thanks for your answer!

i made this:


but it doesnt show up when i run it
What am i doing wrong?
thanks in advance
 
Joe Ess
Bartender
Posts: 9214
9
Linux Mac OS X Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you adding that JScrollPane to some top-level container, like a JFrame?
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the Swing / JFC / AWT forum...
 
miguel lisboa
Ranch Hand
Posts: 1281
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, now i see it; my prob now it to force the scroll down - i mean - i want to introduce a lot of components, deep down, but they just dont show; the app's size cut them at the app's bottom
Where can i get an example of this working?
thanks in advance
 
miguel lisboa
Ranch Hand
Posts: 1281
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
CASE SOLVED!
one has to make jpane's vertical preferredSize bigger then app's one

[ June 15, 2004: Message edited by: miguel lisboa ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic