Re: populate a box




"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


.



Relevant Pages

  • Re: Always use a form; I think I get it...
    ... If it's a very simple personal database for your own use, ... perfectly OK to edit data directly in tables. ... validate data and display feedback and guidance, to list just a few of the ... Datasheet forms are OK if used sensibly. ...
    (microsoft.public.access.forms)
  • Re: Frontpage - how to make some fileds in a form display only?
    ... I have a form page to display a row of data ... > a database and gives the user the ability to edit some fields. ... I used the Database Interface Wizard to create the page. ... > javascript anywhere to edit it. ...
    (microsoft.public.frontpage.programming)
  • Re: HELP! ASP and SQL problem.
    ... >to a database and also display that information in an edit mode. ... >DIM objConn ...
    (microsoft.public.inetserver.asp.general)
  • Display code without executing it ?
    ... I have some links to banner affilliates stored in a database and I ... want to bring them out into a form for edit. ... How do I get it to display the code? ...
    (alt.php)
  • RE: Userform to add and update a table
    ... One of the most common scenarios in application development is to display ... the walkthrough illustrates many of the basic ... Access to a server with the Pubs SQL Server sample database. ... Creating the Windows Form. ...
    (microsoft.public.sqlserver.programming)