Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

swing components problem

 
oghenekaro EFEKODO
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
thanks.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic