• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 165
  • Last Modified:

Interaction between applets?

Hi

I'm running an applet to extract data from a database and put it into a bunch of text fields.However, I don't always know how many text fields will be used, (e.g. 2 for one run, 200 for another), therefore I would like to know how do you create textfields at the run-time of the java applet? Is it even possible? Or could I create another applet beside it, but then how do I inherite the actual results from the methods got in the other one?

thankx.
0
java_gurl
Asked:
java_gurl
1 Solution
 
CEHJCommented:
Why not use a TextArea or JTextArea for the results?
0
 
java_gurlAuthor Commented:
Cehj, i've thought about that, but for reasons which i won't go into dealing with the database, i've got to use text fields. thanks anyway.
0
 
CEHJCommented:
Even better, why not use a JTable?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
AjarCommented:

although you can create many text fields at runtime by

applet.add(new textField("data base data"))

You will run into problems of managing the display of many such text fields.


....
 If your criterion is only to display the database data then  you can use the html displaying functionality of JComponent like jlabel and jeditorpane.    
 For this read the data from sql resultset and make a HTML table string from it . Set this html string to jcomponent  and you can display the data of database elegantly



 
0
 
CleanupPingCommented:
java_gurl:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
TimYatesCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept Ajar's comment as answer.

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

TimYates
EE Cleanup Volunteer
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now