Creating new GUI components in real time

I am working on an app that returns anywhere from 10-100 (maybe more) search results (just text) to the user. Currently I have the results popping up in a JTextArea one at a time, as it is easy to update the TextArea in real time and make it scrollable. But now I want there to be a clickable button with each result. I imagine the results would show up in a virtual index card with a button on each one, and that all of the index cards would be on one scrollable "sheet".

I tried making index cards out of JPanels and adding them to a JPanel within a JScrollPane one by one, but they didn't show up. Do you think this was just a threading problem or is it impossible to add an indefinite number of components to a JPanel in real time?

Any suggestions? I thought I might make my index cards out of internal frames, but is there any way to make them scrollable? I don't want 100 frames all stacked up in the main window; that would be too messy.

Thanks!

[980 byte] By [atroutta] at [2007-11-27 10:07:42]
# 1
JTable sounds like the best solution, but JList might be suitable as well. http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/JTable.html http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/JList.html
hunter9000a at 2007-7-13 0:44:00 > top of Java-index,Java Essentials,Java Programming...
# 2
JTable is likely your best bet but you can also try a JTabbedPane.
maple_shafta at 2007-7-13 0:44:00 > top of Java-index,Java Essentials,Java Programming...
# 3
JTable looks like exactly what I need! Thank you!
atroutta at 2007-7-13 0:44:00 > top of Java-index,Java Essentials,Java Programming...
# 4
What does real time have to do with it?
georgemca at 2007-7-13 0:44:00 > top of Java-index,Java Essentials,Java Programming...
# 5
> What does real time have to do with it?I took it to mean he wanted to add them dynamically at runtime after the gui's been shown. He used the term wrong, but the point still comes across.
hunter9000a at 2007-7-13 0:44:00 > top of Java-index,Java Essentials,Java Programming...
# 6

by real time I only mean that I don't know how many results I will have until the search is complete, so I can't create the components beforehand, I have to do it when I get a result, while the program is running. I couldn't get anything but text to show up like that, but I think a JTable will suit my needs perfectly.

atroutta at 2007-7-13 0:44:00 > top of Java-index,Java Essentials,Java Programming...