TOC PREV NEXT INDEX



Adding a search feature to the application


Finally, we will create a second query, this one allowing us to search for a particular item in the inventory database.

To start, you will add a few more items to the user interface.

  1. Select the border layout as you did previously, by right clicking on a component, choosing 'border1'.
  2. Click on "Show empty panels" to show the remaining empty spaces in it.
  3. From the 'Layouts' page of the palette, select 'Flow'.
  4. Click once on the "South" empty space of the border layout.
  5. From the 'Swing' page of the palette, select 'Button' (JButton).
  6. Click once in the empty space of the Flow you just created.
  7. From the 'Swing' page of the palette, select 'TextField' (JTextField).
  8. Click once in the Flow Layout to add a JTextField.
  9. Choose "Hide all empty panels" from the parts menu.

Next you will set up the properties of the items you created.

  1. Click once on the button you just created.
  2. Change the Object name to "searchFor".
  3. Change the JButton text to "Search for:".
  4. Click once on the JTextField you just created.
  5. Change the Object name to "nameToSearchFor".
  6. Set the Number of columns to 20.
  7. Set the JTextField text to be blank.

You have now made the final additions to the user interface of your application.


Data Representations, Inc.
http://www.datarepresentations.com
support@datarepresentations.com
sales@datarepresentations.com
TOC PREV NEXT INDEX