This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Scrolling/Scroll Bar" Watch "Scrolling/Scroll Bar" New topic
Author

Scrolling/Scroll Bar

Dannii Black
Greenhorn

Joined: Apr 23, 2003
Posts: 5
Hi,
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? :-)
Thanks
Dannii Black
Greenhorn

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
Bartender

Joined: Aug 20, 2001
Posts: 1817

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:
new JSCrollPane(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
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
Sheriff

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
Greenhorn

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:
this.add(jScrollBar1);
Thanks anyway
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Scrolling/Scroll Bar