Out of 9 Lives - The Dreaded Inventory Prog

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Sep 2007
Posts: 2
Reputation: Catgirl is an unknown quantity at this point 
Solved Threads: 0
Catgirl Catgirl is offline Offline
Newbie Poster

Out of 9 Lives - The Dreaded Inventory Prog

 
0
  #1
Sep 29th, 2007
I have all of my program working except the following buttons (add, modify, delete, save, search) which I have the buttons, but turned off in my program so it will still compile/run until I get the button functionality fixed. To be honest, I have no clue on what code needs to make them work as required. I am strictly a beginner and it has taken many many sleepless nights just to get to this point. Any help would be very much appreciated. The following is what I need to accomplish, followed by my section of code (as not to overwhelm you with my whole program):

Modify the Inventory Program to include an Add button, a Delete button, and a Modify
button on the GUI. These buttons should allow the user to perform the corresponding
actions on the item name, the number of units in stock, and the price of each unit. An
item added to the inventory should have an item number one more than the previous last
item.
• Add a Save button to the GUI that saves the inventory to a C:\data\inventory.dat file.
• Use exception handling to create the directory and file if necessary.
• Add a search button to the GUI that allows the user to search for an item in the inventory
by the product name. If the product is not found, the GUI should display an appropriate
message. If the product is found, the GUI should display that product’s information in the
GUI.

// I NEED HELP WITH THIS SECTION. HAVE NO CLUE ON WHAT CODE WILL MAKE BUTTONS WORK AS REQUESTED

// private JButton addButton = new JButton(addAction);

//private Action lastAction = new AbstractAction("Add") {
// public void actionPerformed(ActionEvent evt) {

//index = ProductInventory.getSize() - 1;

// repaint();
// }
// };
// private JButton modifyButton = new JButton(modifyAction);

// private Action lastAction = new AbstractAction("Modify") {
// public void actionPerformed(ActionEvent evt) {

// index = ProductInventory.getSize() - 1;

// repaint();
// }
// };
//private JButton deleteButton = new JButton(deleteAction);

//private Action lastAction = new AbstractAction("Delete") {
// public void actionPerformed(ActionEvent evt) {

// index = ProductInventory.getSize() - 1;

// repaint();
// }
//};
// private JButton saveButton = new JButton(saveAction);

// private Action lastAction = new AbstractAction("Save") {
// public void actionPerformed(ActionEvent evt) {

// index = ProductInventory.getSize() - 1;

// repaint();
// }
//};
//private JButton searchButton = new JButton(searchAction);

//private Action lastAction = new AbstractAction("Search") {
// public void actionPerformed(ActionEvent evt) {

// index = ProductInventory.getSize() - 1;

// repaint();
// }
//};
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,266
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: Out of 9 Lives - The Dreaded Inventory Prog

 
0
  #2
Sep 30th, 2007
So, you have the buttons, now you need to write the code behind the buttons that actually does the useful stuff don't ya?
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,218
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 489
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: Out of 9 Lives - The Dreaded Inventory Prog

 
0
  #3
Sep 30th, 2007
You should check answer to your first post where I provided a link to other post with same problem as yours. Based on that you would get some ideas what to do with it
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 226
Reputation: no1zson is on a distinguished road 
Solved Threads: 1
no1zson's Avatar
no1zson no1zson is offline Offline
Posting Whiz in Training

Re: Out of 9 Lives - The Dreaded Inventory Prog

 
0
  #4
Oct 1st, 2007
Hey Catgirl. Search on my name.
Some of the guys helped me work through this exact assignment some months back.
I never drew first, but I drew first blood.
I'm no ones son, unforgiven.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC