473,395 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Inventory program in Java

I am trying to add the Delete button, save and search buttons. I have tried to call my teacher and he is absolutly no help and i have read and reread the text but still have no idea what is going on.........I have the added the add button but now i am stuck. Is there a simple way in completeing this??

Please help

• Due Date: Day 7 [Individual] forum
• 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. • Post as an attachment
Jan 26 '07
67 22870
r035198x
13,262 8TB
Opps, thats what I meant, modify and delete are good to go. I'm telling ya, its been quite the month hehe.
Don't forget to let me know if there is anything you don't understand in that code. I would also want you to try to make the search function work.
Feb 13 '07 #51
I have a question on how the 'lock' method works in the action panel. This part is a little confusing. I will also try to give the search function a try, that seems to be a little complicated
Feb 13 '07 #52
r035198x
13,262 8TB
I have a question on how the 'lock' method works in the action panel. This part is a little confusing. I will also try to give the search function a try, that seems to be a little complicated
The idea is stop the user from trying to add while in the middle of another add or a modify which would really mess up the screen
Feb 13 '07 #53
Ah that makes sense now. I guess I've never seen the 'lock' actually used before.
Feb 13 '07 #54
Hey r035198x, just wanted to give you an update. My girlfriend and I had a baby girl on the 14th (Valentines day!). We just got home today, and everything is going great. I haven't had any time to work on my program, and things are going to be a little hectic for a while. I was wondering if you could help me out with the last couple of steps on my program, which is due Sunday. You have been such a great help throughout my course and I really thank you for taking the time to do so. Thanks again, hope to hear from you soon.
Feb 15 '07 #55
Is this something how it should look?
Expand|Select|Wrap|Line Numbers
  1. private DVD searchName(String searchName) {
  2. for (DVD dvd : dvdList) {
  3.     if (dvd.getName().equals(searchName)) {
  4.         return dvd;
  5.     }
  6. }
  7. return null;
  8. }
  9.  
  10.  
Feb 16 '07 #56
r035198x
13,262 8TB
Hey r035198x, just wanted to give you an update. My girlfriend and I had a baby girl on the 14th (Valentines day!). We just got home today, and everything is going great. I haven't had any time to work on my program, and things are going to be a little hectic for a while. I was wondering if you could help me out with the last couple of steps on my program, which is due Sunday. You have been such a great help throughout my course and I really thank you for taking the time to do so. Thanks again, hope to hear from you soon.
I hope you didn't call her Valentine!
For the search, the object of the search is to display the DVD that we have searched for. We already have a mthod that displays an item in the array if we know it's position in the array. So all we need to do is to find the position of that DVD in the array. Our search method should therefore return just an int.
Expand|Select|Wrap|Line Numbers
  1.  
  2. private int findPositionOfProduct(String productName) {//We need the index so the short for won't work
  3.      int pos = -1;
  4.      for(int i = 0; i < supplies.length; i++) {
  5.    DVD dvd = (DVD)supplies[i];
  6.    if(dvd.getItemName().equalsIgnoreCase(productName)) { //Make the search case insensitive
  7.     return i;
  8.    }
  9.   }
  10.   return pos;// -1 is returned if we did not find the product.
  11.  }
  12.  

Now to make it work we need to add the part that handles the command from the clicking of the search button. We want to tell the user that the product is not there if we did not find it.

Expand|Select|Wrap|Line Numbers
  1.  
  2. else if(command.equals("Search")) {
  3.      if(!locked) {
  4.       String product = JOptionPane.showInputDialog(this, "Enter the product's name");
  5.       int pos = findPositionOfProduct(product);
  6.       if(pos == -1) {
  7.      JOptionPane.showMessageDialog(this, "There is no product named "+ product + " in the inventory");
  8.     }
  9.     else {
  10.      displayItemAt(pos);
  11.     }
  12.      }
  13.   }
  14.  
And that's it! The search is complete.
Feb 16 '07 #57
I hope you didn't call her Valentine!
For the search, the object of the search is to display the DVD that we have searched for. We already have a mthod that displays an item in the array if we know it's position in the array. So all we need to do is to find the position of that DVD in the array. Our search method should therefore return just an int.
Expand|Select|Wrap|Line Numbers
  1.  
  2. private int findPositionOfProduct(String productName) {//We need the index so the short for won't work
  3.      int pos = -1;
  4.      for(int i = 0; i < supplies.length; i++) {
  5.    DVD dvd = (DVD)supplies[i];
  6.    if(dvd.getItemName().equalsIgnoreCase(productName)) { //Make the search case insensitive
  7.     return i;
  8.    }
  9.   }
  10.   return pos;// -1 is returned if we did not find the product.
  11.  }
  12.  

Now to make it work we need to add the part that handles the command from the clicking of the search button. We want to tell the user that the product is not there if we did not find it.

Expand|Select|Wrap|Line Numbers
  1.  
  2. else if(command.equals("Search")) {
  3.      if(!locked) {
  4.       String product = JOptionPane.showInputDialog(this, "Enter the product's name");
  5.       int pos = findPositionOfProduct(product);
  6.       if(pos == -1) {
  7.      JOptionPane.showMessageDialog(this, "There is no product named "+ product + " in the inventory");
  8.     }
  9.     else {
  10.      displayItemAt(pos);
  11.     }
  12.      }
  13.   }
  14.  
And that's it! The search is complete.
I teach this class and I have to tell you all that I am very frustrated looking at these forums. I have students turning in these programs as you have them posted, this earns them 0's. I understand that the moderator here is trying to help, but writing code for students is not going to help them in the long run. I will be poting this site to the faculty lounges so that all faculty are aware of this site and can take appropriate action when they grade programs. It is fine to help students, but not fine to write code for them.
Feb 16 '07 #58
r035198x
13,262 8TB
I teach this class and I have to tell you all that I am very frustrated looking at these forums. I have students turning in these programs as you have them posted, this earns them 0's. I understand that the moderator here is trying to help, but writing code for students is not going to help them in the long run. I will be poting this site to the faculty lounges so that all faculty are aware of this site and can take appropriate action when they grade programs. It is fine to help students, but not fine to write code for them.
I make it a point to reply code with code. The OP posted some code for the method which was not correct so I posted the corrected code for that and an explanation. Sometimes it is easier to explain using code. But I will take your point and remember not to post code in assignment questions
Feb 17 '07 #59
I make it a point to reply code with code. The OP posted some code for the method which was not correct so I posted the corrected code for that and an explanation. Sometimes it is easier to explain using code. But I will take your point and remember not to post code in assignment questions

Thank you, that will be appreciated. It really hurts the students when they do not write the code themselves.
Feb 17 '07 #60
r035198x
13,262 8TB
Thank you, that will be appreciated. It really hurts the students when they do not write the code themselves.
A good point you make. I'll admit in this case I gave far much more than the student was giving. Very good of you to point that out. I hope you will be around more often and help to create better programmers than copy-paste type of programmers we are likely to get if students have solutions dumped at them each time.
Feb 17 '07 #61
I teach this class and I have to tell you all that I am very frustrated looking at these forums. I have students turning in these programs as you have them posted, this earns them 0's. I understand that the moderator here is trying to help, but writing code for students is not going to help them in the long run. I will be poting this site to the faculty lounges so that all faculty are aware of this site and can take appropriate action when they grade programs. It is fine to help students, but not fine to write code for them.
If you are like the teachers I have had so far, you are not teaching this class. Teaching is telling someone what they did wrong in their own programs and helping them to understand how to fix it. Not giving them the answers but guiding them to find the correct answers. This is the second time I have taken this class because I had no hope of passing it the first time. Both times everyone in each class has wondered how in the world they are going to pass it. We are reading all the textbook, usually three to four times, and most of us have purchased other books to help us try to understand what is going on. There is nothing in the text to help us to understand how to code the buttons that we need for the last two weeks. There is nothing that I have found online to help me understand it. This is the ONLY place I have found any answers at all.
I agree that students should not COPY the code, but it has been very helpful to have that code to help me understand how it is supposed to work.
May 20 '07 #62
I am trying to add the Delete button, save and search buttons. I have tried to call my teacher and he is absolutly no help and i have read and reread the text but still have no idea what is going on.........I have the added the add button but now i am stuck. Is there a simple way in completeing this??

Please help

• Due Date: Day 7 [Individual] forum
• 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. • Post as an attachment

I am having the same problem I developed the icon for add but I am lost this is my program I called this one my buttonframe



// Display The DVDs.
import java.text.*;
import java.util.*;

import java.awt.*;
import java.awt.FlowLayout;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JFrame;
import javax.swing.JButton;
import javax.swing.JTextField;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
import javax.swing.*;


public class ButtonFrame extends JFrame
{

private JButton nextJButton; // button with just text
private JButton prevJButton; // button with icons
private JButton lastJButton; // button with just text
private JButton firstJButton; // button with icons
private JButton addJButton; // button with icons
private JLabel logoLabel;
private JTextField space1;
private JTextField space2;
private JTextField lblArtist; // text field with set size
private JTextField txtArtist; // text field constructed with text
private JTextField lblItemNum; // text field with set size
private JTextField txtItemNum; // text field constructed with text
private JTextField lblTitle; // text field with set size
private JTextField txtTitle; // text field constructed with text
private JTextField lblQuantity; // text field with set size
private JTextField txtQuantity; // text field constructed with text
private JTextField lblUnitPrice; // text field with set size
private JTextField txtUnitPrice; // text field constructed with text
private JTextField lblRestockFee; // text field with set size
private JTextField txtRestockFee; // text field constructed with text
private JTextField lblItemValue; // text field with set size
private JTextField txtItemValue; // text field constructed with text
private JTextField lblInventoryValue; // text field with set size
private JTextField txtInventoryValue; // text field constructed with text


// Just keeping an a class variable to keep count of where I am in the array
// keeping a class variable of the myPlayer array that I passed
UsedDVD[] arrayDVDs;
private int currentArrayCounter;
private int arrayCount;
private String invTotal;
// public Image i;


// i = getImage(getDocumentBase(), "logo.gif");

// ButtonFrame adds JButtons to JFrame
public ButtonFrame(UsedDVD[] myDVDs, int totalArrayCount, String stringInventoryTotal)
{

super( "UsedDVD Inventory" );
arrayDVDs = myDVDs;
invTotal=stringInventoryTotal;
// drawImage(i,0,0);

// I am setting the local passed variable totalArrayCount
// to the class variable arrayCounter so I can see it in the setTextfields method
arrayCount = totalArrayCount;
currentArrayCounter = 0;
// Sertting the current array position to 0


setLayout( new FlowLayout() ); // set frame layout
// Load the next and previous icons
Icon logo = new ImageIcon( getClass().getResource( "logo.gif" ) );
Icon iconAdd = new ImageIcon(getClass().getResource( "add.gif" ) );
Icon iconNext = new ImageIcon( getClass().getResource( "forward.gif" ) );
Icon iconPrev = new ImageIcon( getClass().getResource( "back.gif" ) );
Icon iconLast = new ImageIcon( getClass().getResource( "last.gif" ) );
Icon iconFirst = new ImageIcon( getClass().getResource( "first.gif" ) );
logoLabel = new JLabel("",logo,SwingConstants.LEFT);
add(logoLabel);
// construct Label Fields with default text and 25 columns
space1 = new JTextField( "", 20 );
space1.setEditable( false ); // disable editing
add( space1 );
space2 = new JTextField( "", 20 );
space2.setEditable( false ); // disable editing
add( space2 );
lblItemNum = new JTextField( "Item Number", 25 );
lblItemNum.setEditable( false ); // disable editing
add( lblItemNum );
txtItemNum = new JTextField("", 25 );
add( txtItemNum ); // add txtActor to JFrame
lblArtist = new JTextField( "Actor", 25 );
lblArtist.setEditable( false ); // disable editing
add( lblArtist );
txtArtist = new JTextField("", 25 );
add( txtArtist ); // add txtActor to JFrame
lblTitle = new JTextField( "Title", 25 );
lblTitle.setEditable( false ); // disable editing
add( lblTitle );
txtTitle = new JTextField("", 25 );
add( txtTitle ); // add txtActor to JFrame
lblQuantity = new JTextField( "Quantity", 25 );
lblQuantity.setEditable( false ); // disable editing
add( lblQuantity );
txtQuantity = new JTextField("", 25 );
add( txtQuantity ); // add txtActor to JFrame
lblUnitPrice = new JTextField( "Unit Price", 25 );
lblUnitPrice.setEditable( false ); // disable editing
add( lblUnitPrice );
txtUnitPrice = new JTextField("", 25 );
add( txtUnitPrice ); // add txtUnitPrice to JFrame
lblRestockFee = new JTextField( "Restocking Fee", 25 );
lblRestockFee.setEditable( false ); // disable editing
add( lblRestockFee );
txtRestockFee = new JTextField("", 25 );
add( txtRestockFee ); // add txtActor to JFrame
lblItemValue = new JTextField( "Total Item Value", 25 );
lblItemValue.setEditable( false ); // disable editing
add( lblItemValue );
txtItemValue = new JTextField("", 25 );
add( txtItemValue ); // add txtActor to JFrame
lblInventoryValue = new JTextField( "Total Inventory Value", 25 );
lblInventoryValue.setEditable( false ); // disable editing
add( lblInventoryValue );
txtInventoryValue = new JTextField(invTotal, 25 );
add( txtInventoryValue ); // add txtActor to JFrame
// construct textfield with default text

// Create the buttons
addJButton = new JButton( "Add", iconAdd ); //button with Add
nextJButton = new JButton( "Next", iconNext ); // button with Next
prevJButton =new JButton( "Prev" , iconPrev ); // button with Prev
lastJButton = new JButton( "Last", iconLast ); // button with Last
firstJButton =new JButton( "First" , iconFirst ); // button with First
add( addJButton) ;
add( firstJButton ); // add plainJButton to JFrame
add(prevJButton);
add( nextJButton ); // add plainJButton to JFrame
add(lastJButton);
// create new ButtonHandler for button event handling
ButtonHandler handler = new ButtonHandler();
addJButton.addActionListener (handler );
firstJButton.addActionListener( handler );
prevJButton.addActionListener( handler );
nextJButton.addActionListener( handler );
lastJButton.addActionListener( handler );



// Now I am going to call SetTextFields to set the text fields
setTextFields();

} // end ButtonFrame constructor





// inner class for button event handling
private class ButtonHandler implements ActionListener
{
// handle button event
public void actionPerformed( ActionEvent event )
{

// System.out.println(event.getActionCommand());

// See which button was pressed
if (event.getActionCommand()== "Next"){


currentArrayCounter++;
}

else if (event.getActionCommand()== "Prev"){
currentArrayCounter--;
}
else if (event.getActionCommand()== "Last"){
currentArrayCounter= arrayCount-1;
}

else if (event.getActionCommand()== "First"){
currentArrayCounter = 0;
}
else if (event.getActionCommand()== "Add"){
currentArrayCounter = +1;
}
else if (event.getActionCommand()== "Delete"){
currentArrayCounter = 0;

}

setTextFields();

} // end method actionPerformed
} // end private inner class ButtonHandler



private void setTextFields ()
{
// Make sure you havent gone past the end of the array
if (currentArrayCounter == arrayCount)
{
currentArrayCounter = 0;
}

// Make sure you havent gone past the first if so, set it to the last
if (currentArrayCounter < 0)
{
currentArrayCounter = arrayCount-1;
}

// System.out.println(currentArrayCounter); // Debug statement

NumberFormat n = NumberFormat.getCurrencyInstance(Locale.US); //Provides Locale appropriate currency format

txtArtist.setText(arrayDVDs[currentArrayCounter].getactor());
txtItemNum.setText(arrayDVDs[currentArrayCounter].getitemnumber());
txtTitle.setText(arrayDVDs[currentArrayCounter].gettitle());
txtQuantity.setText(Double.toString(arrayDVDs[currentArrayCounter].getquantity()));
txtUnitPrice.setText(Double.toString(arrayDVDs[currentArrayCounter].getunitprice()));
String stringRestockFee = n.format(arrayDVDs[currentArrayCounter].CalculateRestockFee());
txtRestockFee.setText(stringRestockFee);
txtItemValue.setText(n.format(arrayDVDs[currentArrayCounter].calculateDVDValue()));


}


} // end class ButtonFrame
May 28 '07 #63
r035198x
13,262 8TB
I am having the same problem I developed the icon for add but I am lost this is my program I called this one my buttonframe



// Display The DVDs.
import java.text.*;
import java.util.*;

import java.awt.*;
import java.awt.FlowLayout;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JFrame;
import javax.swing.JButton;
import javax.swing.JTextField;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
import javax.swing.*;


public class ButtonFrame extends JFrame
{

private JButton nextJButton; // button with just text
private JButton prevJButton; // button with icons
private JButton lastJButton; // button with just text
private JButton firstJButton; // button with icons
private JButton addJButton; // button with icons
private JLabel logoLabel;
private JTextField space1;
private JTextField space2;
private JTextField lblArtist; // text field with set size
private JTextField txtArtist; // text field constructed with text
private JTextField lblItemNum; // text field with set size
private JTextField txtItemNum; // text field constructed with text
private JTextField lblTitle; // text field with set size
private JTextField txtTitle; // text field constructed with text
private JTextField lblQuantity; // text field with set size
private JTextField txtQuantity; // text field constructed with text
private JTextField lblUnitPrice; // text field with set size
private JTextField txtUnitPrice; // text field constructed with text
private JTextField lblRestockFee; // text field with set size
private JTextField txtRestockFee; // text field constructed with text
private JTextField lblItemValue; // text field with set size
private JTextField txtItemValue; // text field constructed with text
private JTextField lblInventoryValue; // text field with set size
private JTextField txtInventoryValue; // text field constructed with text


// Just keeping an a class variable to keep count of where I am in the array
// keeping a class variable of the myPlayer array that I passed
UsedDVD[] arrayDVDs;
private int currentArrayCounter;
private int arrayCount;
private String invTotal;
// public Image i;


// i = getImage(getDocumentBase(), "logo.gif");

// ButtonFrame adds JButtons to JFrame
public ButtonFrame(UsedDVD[] myDVDs, int totalArrayCount, String stringInventoryTotal)
{

super( "UsedDVD Inventory" );
arrayDVDs = myDVDs;
invTotal=stringInventoryTotal;
// drawImage(i,0,0);

// I am setting the local passed variable totalArrayCount
// to the class variable arrayCounter so I can see it in the setTextfields method
arrayCount = totalArrayCount;
currentArrayCounter = 0;
// Sertting the current array position to 0


setLayout( new FlowLayout() ); // set frame layout
// Load the next and previous icons
Icon logo = new ImageIcon( getClass().getResource( "logo.gif" ) );
Icon iconAdd = new ImageIcon(getClass().getResource( "add.gif" ) );
Icon iconNext = new ImageIcon( getClass().getResource( "forward.gif" ) );
Icon iconPrev = new ImageIcon( getClass().getResource( "back.gif" ) );
Icon iconLast = new ImageIcon( getClass().getResource( "last.gif" ) );
Icon iconFirst = new ImageIcon( getClass().getResource( "first.gif" ) );
logoLabel = new JLabel("",logo,SwingConstants.LEFT);
add(logoLabel);
// construct Label Fields with default text and 25 columns
space1 = new JTextField( "", 20 );
space1.setEditable( false ); // disable editing
add( space1 );
space2 = new JTextField( "", 20 );
space2.setEditable( false ); // disable editing
add( space2 );
lblItemNum = new JTextField( "Item Number", 25 );
lblItemNum.setEditable( false ); // disable editing
add( lblItemNum );
txtItemNum = new JTextField("", 25 );
add( txtItemNum ); // add txtActor to JFrame
lblArtist = new JTextField( "Actor", 25 );
lblArtist.setEditable( false ); // disable editing
add( lblArtist );
txtArtist = new JTextField("", 25 );
add( txtArtist ); // add txtActor to JFrame
lblTitle = new JTextField( "Title", 25 );
lblTitle.setEditable( false ); // disable editing
add( lblTitle );
txtTitle = new JTextField("", 25 );
add( txtTitle ); // add txtActor to JFrame
lblQuantity = new JTextField( "Quantity", 25 );
lblQuantity.setEditable( false ); // disable editing
add( lblQuantity );
txtQuantity = new JTextField("", 25 );
add( txtQuantity ); // add txtActor to JFrame
lblUnitPrice = new JTextField( "Unit Price", 25 );
lblUnitPrice.setEditable( false ); // disable editing
add( lblUnitPrice );
txtUnitPrice = new JTextField("", 25 );
add( txtUnitPrice ); // add txtUnitPrice to JFrame
lblRestockFee = new JTextField( "Restocking Fee", 25 );
lblRestockFee.setEditable( false ); // disable editing
add( lblRestockFee );
txtRestockFee = new JTextField("", 25 );
add( txtRestockFee ); // add txtActor to JFrame
lblItemValue = new JTextField( "Total Item Value", 25 );
lblItemValue.setEditable( false ); // disable editing
add( lblItemValue );
txtItemValue = new JTextField("", 25 );
add( txtItemValue ); // add txtActor to JFrame
lblInventoryValue = new JTextField( "Total Inventory Value", 25 );
lblInventoryValue.setEditable( false ); // disable editing
add( lblInventoryValue );
txtInventoryValue = new JTextField(invTotal, 25 );
add( txtInventoryValue ); // add txtActor to JFrame
// construct textfield with default text

// Create the buttons
addJButton = new JButton( "Add", iconAdd ); //button with Add
nextJButton = new JButton( "Next", iconNext ); // button with Next
prevJButton =new JButton( "Prev" , iconPrev ); // button with Prev
lastJButton = new JButton( "Last", iconLast ); // button with Last
firstJButton =new JButton( "First" , iconFirst ); // button with First
add( addJButton) ;
add( firstJButton ); // add plainJButton to JFrame
add(prevJButton);
add( nextJButton ); // add plainJButton to JFrame
add(lastJButton);
// create new ButtonHandler for button event handling
ButtonHandler handler = new ButtonHandler();
addJButton.addActionListener (handler );
firstJButton.addActionListener( handler );
prevJButton.addActionListener( handler );
nextJButton.addActionListener( handler );
lastJButton.addActionListener( handler );



// Now I am going to call SetTextFields to set the text fields
setTextFields();

} // end ButtonFrame constructor





// inner class for button event handling
private class ButtonHandler implements ActionListener
{
// handle button event
public void actionPerformed( ActionEvent event )
{

// System.out.println(event.getActionCommand());

// See which button was pressed
if (event.getActionCommand()== "Next"){


currentArrayCounter++;
}

else if (event.getActionCommand()== "Prev"){
currentArrayCounter--;
}
else if (event.getActionCommand()== "Last"){
currentArrayCounter= arrayCount-1;
}

else if (event.getActionCommand()== "First"){
currentArrayCounter = 0;
}
else if (event.getActionCommand()== "Add"){
currentArrayCounter = +1;
}
else if (event.getActionCommand()== "Delete"){
currentArrayCounter = 0;

}

setTextFields();

} // end method actionPerformed
} // end private inner class ButtonHandler



private void setTextFields ()
{
// Make sure you havent gone past the end of the array
if (currentArrayCounter == arrayCount)
{
currentArrayCounter = 0;
}

// Make sure you havent gone past the first if so, set it to the last
if (currentArrayCounter < 0)
{
currentArrayCounter = arrayCount-1;
}

// System.out.println(currentArrayCounter); // Debug statement

NumberFormat n = NumberFormat.getCurrencyInstance(Locale.US); //Provides Locale appropriate currency format

txtArtist.setText(arrayDVDs[currentArrayCounter].getactor());
txtItemNum.setText(arrayDVDs[currentArrayCounter].getitemnumber());
txtTitle.setText(arrayDVDs[currentArrayCounter].gettitle());
txtQuantity.setText(Double.toString(arrayDVDs[currentArrayCounter].getquantity()));
txtUnitPrice.setText(Double.toString(arrayDVDs[currentArrayCounter].getunitprice()));
String stringRestockFee = n.format(arrayDVDs[currentArrayCounter].CalculateRestockFee());
txtRestockFee.setText(stringRestockFee);
txtItemValue.setText(n.format(arrayDVDs[currentArrayCounter].calculateDVDValue()));


}


} // end class ButtonFrame
This post is no different from your first post. You obviously are not learning from your mistakes.
May 28 '07 #64
JosAH
11,448 Expert 8TB
This post is no different from your first post. You obviously are not learning from your mistakes.
mistb2002 is also running his own thread in this forum here to no avail. I replied
in that thread two times now but I suspect we're dealing with a cut 'n paste code
hunter here.

btw, this thread is a total smelly wallpaper code mess ;-)

kind regards,

Jos
May 28 '07 #65
no I am not cutting a pasting anything I am actually in attendance at the university of phoenix and I partially have just the icon for add and I am lost in figuring out how to add the delete icon and then producing the screen for a user input. you weren't helping me so I went to another forum. I have no intentions on copying anyones work I want to do this on my own but I have been on this pc since 12am last night. I am getting truly frustrated at this program.
May 28 '07 #66
JosAH
11,448 Expert 8TB
no I am not cutting a pasting anything I am actually in attendance at the university of phoenix and I partially have just the icon for add and I am lost in figuring out how to add the delete icon and then producing the screen for a user input. you weren't helping me so I went to another forum. I have no intentions on copying anyones work I want to do this on my own but I have been on this pc since 12am last night. I am getting truly frustrated at this program.
I was helping you but you don't realize it (yet?) I wasn't spoonfeeding you any
code but I was explaining how to post a sensible question in any forum;
I also explained how model-view-controller separation should be used in an
application. All that in your other thread.

kind regards,

Jos
May 28 '07 #67
I have the add button working......I just need help with the other.

Thanks
How did you get your add button to work I have my delete button working but I am stuck from there. this what my program looks like:

I finally got my add button to work thank god for back up disk because I did not save the correct file on my pc. I was using the correct code all along but just in the wrong order.
Jun 1 '07 #68

Sign in to post your reply or Sign up for a free account.

Similar topics

109
by: zaidalin79 | last post by:
I have a java class that goes for another week or so, and I am going to fail if I can't figure out this simple program. I can't get anything to compile to at least get a few points... Here are the...
0
by: south622 | last post by:
I'm taking a beginning Java course and I'm stuck in week eight of a nine week course. If anyone could help me I would greatly appreciate it. This assignment was due yesterday and each day I go past...
4
nexcompac
by: nexcompac | last post by:
Ok, I posted a similar post but now need to jump back into it. Here is what I have been able to clean up. I am using textpad and jbuilder. Still getting used to the whole java world and I am...
9
by: xxplod | last post by:
I am suppose to modify the Inventory Program so the application can handle multiple items. Use an array to store the items. The output should display the information one product at a time, including...
3
by: cblank | last post by:
I need some help if someone could help me. I know everyone is asking for help in java. But for some reason I'm the same as everyone else when it comes to programming in java. I have an inventory...
5
by: cblank | last post by:
I'm having some trouble with my inventory program. Its due tom and my teacher is not wanting to help. He keeps giving me a soluction that is not related to my code. I have everything working except...
2
by: pinkf24 | last post by:
I cannot figure out how to add the following: 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...
3
by: 100grand | last post by:
Modify the Inventory Program to use a GUI. The GUI should display the information one product at a time, including the item number, the name of the product, the number of units in stock, the price...
16
by: lilsugaman | last post by:
I have to assignment which includes the following: Modify the Inventory Program so the application can handle multiple items. Use an array to store the items. The output should display the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.