Re: populate a box
- From: "Rhino" <no.offline.contact.please@xxxxxxxxxx>
- Date: Sun, 26 Nov 2006 02:01:04 -0500
"fb" <fb@xxxxxxxxx> wrote in message
news:qcaah.373238$5R2.350976@xxxxxxxxxxxx
Hello. I was thinking about writing a program that would send a search
parameter to a database and have the result set displayed in an html or
jsp box of some sort, so that if the user clicks that item, they could be
sent to another page that would allow them to do something to that data.
The problem is getting the data from the server to populate inside a box.
I'm not entirely sure what kind of list or combo box I should use, nor do
i know how to place the items in this box. Does anyone know How I can do
this, or have an example somewhere?
A result set from a database, assuming it is more than one column, would be
best suited to go in a JTable. If you look at the Java Tutorial -
http://java.sun.com/docs/books/tutorial/uiswing/components/table.html -
you'll see information about how to use/populate a JTable.
For a single column result set from a database, you could streamline things
and simply use a JList -
http://java.sun.com/docs/books/tutorial/uiswing/components/list.html - or a
JComboBox -
http://java.sun.com/docs/books/tutorial/uiswing/components/combobox.html.
Editing the data which you display in the JTable/JList/JComboBox is a whole
separate issue. If you use a JTable, you can edit the data right in the
JTable. If you use a JList or JComboBox, you may want your code to display
an edit dialog when you click on a value in the list or combobox.
--
Rhino
.
- References:
- populate a box
- From: fb
- populate a box
- Prev by Date: Re: populate a box
- Next by Date: Building Hotspot and JDK
- Previous by thread: Re: populate a box
- Next by thread: Building Hotspot and JDK
- Index(es):
Relevant Pages
|
|