Win a copy of Cloud Native PatternsE this week in the Cloud forum
or Natural Language Processing in the AI/ML forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Scroll ........i need help

 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody,
Again i have some problem ... tell me how do i use Scrollbar or ScrollPane.......i mean i need to display in a panel and since the data is too long so i need to use ScrollPane or Scrollbar...
Please help me.......
Can anybody please explain me with an example....
Kajol
 
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's very straightforward. Just add the panel to the ScrollPane the same as you would with any other container. Here's a link to the API:
http://java.sun.com/j2se/1.3/docs/api/java/awt/ScrollPane.html


ScrollPane pane = new JScrollPane();
Panel panel = new Panel();
pane.add(panel);
 
Kajol Shroff
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Everybody,
I havent got any more replies.......
Angela I tried ur suggestions but failed ...
Can u or anybody else expalin and elaborte the ScrollPane with an example.......
Waiting for reply...
 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
// to enable scrolling
JScrollPane decryptPane = new JScrollPane();
// add the text area(or anything) to the scroll pane
decryptPane.getViewport().add(textArea);

hope this helps
 
Ranch Hand
Posts: 347
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kajol,
Here is one way to do what you are asking:

This code displays labels in a scrolling panel.
Hope this helps.
Stephanie
 
Kajol Shroff
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Stanley,
I dont want to use Swing ...just a plane applet....
and Stephanie Grasson i have been trying to implemet it in applet ... let me try....well till the mean time can u give me an example using applet...........
Kajol

 
Angela Lamb
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why don't you post the code you are using? I tested the following and it works just fine:
 
Kajol Shroff
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Angela
Even I tried and it worked........
Sorry for the inconvinience.........I am a fresher...so a bit slow..but let me tell u u all guys re really prompt in your responses.
Cheers
Kajol
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!