Two Laptop Bag
The moose likes Swing / AWT / SWT and the fly likes swing components problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "swing components problem" Watch "swing components problem" New topic

swing components problem

oghenekaro EFEKODO
Ranch Hand

Joined: Oct 10, 2005
Posts: 56
pls i need help:am try to develop an application that handle balanced diet using various food list and price list.want them to be in a table such that once a food option is selected it display the price and the application should ask for amount you want to spend before the food option comes up. pls,advice on how to using the swing components to achieve this andpls with a sample code to help.
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
this might be one way

a class called FoodItem
this class contains the item description, price and food options
add these "FoodItems" to a JList (or a JTable), displaying just the description and price
when a foodItem is selected, show a modal dialog asking for amount to spend
show the options (based on selection and price) - perhaps in a set of JLabels?

might get a better example if you post a sample food item, with price and
options, then describe what happens with the options when e.g. $5.00 is
selected for amount to spend and how the options would differ if spending was $50.00
I agree. Here's the link:
subject: swing components problem
jQuery in Action, 3rd edition