Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Scrolling/Scroll Bar

 
Dannii Black
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Dannii Black
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic