File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Scrolling/Scroll Bar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Scrolling/Scroll Bar" Watch "Scrolling/Scroll Bar" New topic

Scrolling/Scroll Bar

Dannii Black

Joined: Apr 23, 2003
Posts: 5
I've created an applet which gets results from a database. My problem is that I want to show this results in a seperate frame which should have a scrollbar so that all the results can be seen in the one frame.
Can you help me out please? :-)
Dannii Black

Joined: Apr 23, 2003
Posts: 5
Whoops, forgot to mention a couple of things.
I'm using JBuilder 3.5 and also, I don't want to drag and drop the scrollbar, I want to write it up in the code as this is how the rest of my design was created.
Tom Purl
Ranch Hand

Joined: May 24, 2002
Posts: 104
Hi Dannii!
This might not be the best forum for your question. You may want to try the IDE's and other tools forum instead.

Tom Purl<br />SCJP 1.4
Joel McNary

Joined: Aug 20, 2001
Posts: 1824

I'm a bit confused:
Are you asking to create and display the data in a HTML frame that is seperate from your applet, or you want to add scrolling functionality to a Panel within your applet? I'm not quite sure how to transfer the data from the applet to the rest of the HTML page to do the former (I'd use JSP/Servlets to do that....), but the latter is simple.
Generic instructions:
Add a JScrollPane to your applet using:
Add a JPanel.JTable to the JScroll Pane
Set the size of the JPanel/JTable to whatever size you need.

Hope that this helps

Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
Perhaps you're trying to figure out inter-Applet communication. The third item listed on Tony Alicea's web page is an example of inter-Applet communication.

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Dannii Black

Joined: Apr 23, 2003
Posts: 5
Hi guys,
I actually figured it out in the end. Just created a scrollbar object:
JScrollBar jScrollBar1 = new JScrollBar();
And then added it in:
Thanks anyway
I agree. Here's the link:
subject: Scrolling/Scroll Bar
It's not a secret anymore!