473,804 Members | 3,088 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Inventory program in Java

7 New Member
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\invento ry.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 23053
r035198x
13,262 MVP
Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3. import java.util.*;
  4. import javax.swing.*;
  5. import java.awt.event.*;
  6. import java.awt.*;
  7.  
  8.  
  9.  
  10.  
  11.  
  12. public class Inventory2 extends JFrame implements ActionListener {
  13.  
  14. //Utility class for displaying the picture
  15. //If we are going to use a class/method/variable inside that class only, we declare it private in that class
  16. private class MyPanel extends JPanel {
  17. ImageIcon image = new ImageIcon("Sample.jpg");
  18. int width = image.getIconWidth();
  19. int height = image.getIconHeight();
  20. long angle = 30;
  21.  
  22. public MyPanel(){
  23. super();
  24. }
  25. public void paintComponent(Graphics g){
  26.     super.paintComponent(g);
  27.     Graphics2D g2d = (Graphics2D)g;
  28.     g2d.rotate (Math.toRadians(angle), 60+width/2, 60+height/2);
  29.     g2d.drawImage(image.getImage(), 60, 60, this);
  30.     g2d.dispose();
  31. }
  32. }//end class MyPanel
  33.  
  34.  
  35. int currentIndex; //Currently displayed Item
  36. Product[] supplies = new Product[4];
  37. JLabel name ;
  38. JLabel number;
  39. JLabel title;
  40. JLabel quantity;
  41. JLabel price;
  42. JLabel fee;
  43. JLabel totalValue;
  44.  
  45. JTextField nameField = new JTextField(20);
  46. JTextField numberField = new JTextField(20);
  47. JTextField titleField = new JTextField(20);
  48. JTextField quantityField = new JTextField(20);
  49. JTextField priceField = new JTextField(20);
  50.  
  51.  
  52. JPanel display;
  53. JPanel displayHolder;
  54. JPanel panel;
  55. boolean locked = false; //Notice how I've used this flag to keep the interface clean
  56. public Inventory2() {
  57. makeTheDataItems();
  58.  
  59. setSize(700, 500);
  60. setTitle("Inventory Program");
  61. //make the panels
  62. display = new JPanel();
  63. JPanel other = new JPanel();
  64. other.setLayout(new GridLayout(2, 1));
  65. JPanel picture = new MyPanel();
  66. JPanel buttons = new JPanel();
  67. JPanel centerPanel = new JPanel();
  68. displayHolder = new JPanel();
  69. display.setLayout(new GridLayout(7, 1));
  70. //other.setLayout(new GridLayout(1, 1));
  71.  
  72. //make the labels
  73. name = new    JLabel("Name :");
  74. number = new JLabel("Number :");
  75. title = new JLabel("Title    :");
  76. quantity = new JLabel("Quantity :");
  77. price = new JLabel("Price    :");
  78. fee = new JLabel("Fee :");
  79. totalValue = new JLabel("Total Value :");
  80.  
  81. //Use the utility method to make the buttons
  82. JButton first = makeButton("First");
  83. JButton next = makeButton("Next");
  84. JButton previous = makeButton("Previous");
  85. JButton last = makeButton("Last");
  86. JButton search = makeButton("Search");
  87.  
  88.  
  89. //Other buttons
  90. JButton add = makeButton("Add");
  91. JButton modify = makeButton("Modify");
  92. JButton delete = makeButton("Delete");
  93. JButton save = makeButton("Save");
  94. JButton exit = makeButton("Exit");
  95.  
  96. //Add the labels to the display panel
  97. display.add(name);
  98. display.add(number);
  99. display.add(title);
  100. display.add(quantity);
  101. display.add(price);
  102. display.add(fee);
  103.  
  104. //add the buttons to the buttonPanel
  105. buttons.add(first);
  106. buttons.add(previous);
  107. buttons.add(next);
  108. buttons.add(last);
  109. buttons.add(search);
  110.  
  111.  
  112. //Add the picture panel and display to the centerPanel
  113. displayHolder.add(display);
  114. centerPanel.setLayout(new GridLayout(2, 1));
  115. centerPanel.add(picture);
  116. centerPanel.add(displayHolder);
  117. other.add(buttons);
  118. JPanel forAdd = new JPanel(); // add the other buttons to this panel
  119. forAdd.add(add);
  120. forAdd.add(modify);
  121. forAdd.add(delete);
  122. forAdd.add(save);
  123. forAdd.add(exit);
  124. other.add(forAdd);
  125.  
  126.  
  127. //Add the panels to the frame
  128.  
  129. getContentPane().add(centerPanel, "Center");
  130. getContentPane().add(other, "South");
  131. this.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
  132. setVisible(true);
  133. }
  134.  
  135. private void makeTheDataItems () {
  136. Product p1 = new DVD("The one", 001, 200, 100, "The one");
  137. Product p2 = new DVD("Once upon a time in China V", 002, 500, 10000, "Once upon a time in China V");
  138. Product p3 = new DVD("Rat Race", 003, 100, 3000, "Rat Race");
  139. Product p4 = new DVD("The Man in the Iron Mask", 004, 3000, 9000, "The Man in the Iron Mask");
  140. supplies[0] = p1;
  141. supplies[1] = p2;
  142. supplies[2] = p3;
  143. supplies[3] = p4;
  144. }
  145.  
  146. //Utility method for creating and dressing buttons
  147. private JButton makeButton(String label) {
  148. JButton button = new JButton(label);
  149. button.setPreferredSize(new Dimension(100, 25));
  150. button.setActionCommand(label);
  151. button.addActionListener(this);
  152. return button;
  153. }
  154.  
  155. private void addItem() {
  156. panel = new JPanel();
  157. JPanel add = new JPanel();
  158.  
  159. add.setLayout(new GridLayout(7, 2));
  160. JButton addIt = makeButton("Add Item");
  161.  
  162. JLabel name = new JLabel("Name :");
  163. JLabel title = new JLabel("Title    :");
  164. JLabel quantity = new JLabel("Quantity :");
  165. JLabel price = new JLabel("Price    :");
  166.  
  167. add.add(name); add.add(nameField);
  168.  
  169. add.add(title); add.add(titleField);
  170. add.add(quantity); add.add(quantityField);
  171. add.add(price); add.add(priceField);
  172. panel.add(add);
  173. JPanel forAddIt = new JPanel();
  174. forAddIt.add(addIt);
  175. panel.add(forAddIt);
  176.  
  177. displayHolder.remove(display);
  178. displayHolder.add(panel);
  179.  
  180. //display = panel;
  181. this.setVisible(true);
  182. }
  183.  
  184.  
  185. public static void main( String args[]) {
  186. new Inventory2().displayFirst(); //The main method should not have too much code
  187. } // end main method
  188.  
  189. public void actionPerformed(ActionEvent event) {
  190. String command = event.getActionCommand(); //This retrieves the command that we set for the button
  191. //Always compare strings using the .equals method and not using ==
  192. if(command.equals("First")) {
  193. if(!locked) {
  194.     displayFirst();
  195. }
  196. }
  197. else if(command.equals("Next")) {
  198. if(!locked) {
  199.     displayNext();
  200. }
  201. }
  202. else if(command.equals("Previous")) {
  203. if(!locked) {
  204.     displayPrevious();
  205. }
  206. }
  207. else if(command.equals("Last")) {
  208. if(!locked) {
  209.     displayLast();
  210. }
  211. }
  212. else if(command.equals("Exit")) {
  213. this.dispose();
  214. System.exit(0);
  215. }
  216. else if(command.equals("Add")) {
  217. if(!locked) {
  218.     addItem();
  219.     locked = true;
  220. }
  221. }
  222. else if(command.equals("Add Item")) {
  223. if(!locked) {
  224.     addItemToArray();
  225.     locked = true;
  226. }
  227. }
  228. else if(command.equals("Modify")) {
  229. if(!locked) {
  230.     modify();
  231.     locked = true;
  232. }
  233. }
  234. else if(command.equals("Update")) {
  235.      if(!locked) {
  236.     modifyItemInArray();
  237.     locked = true;
  238. }
  239. }
  240. else if(command.equals("Delete")) {
  241. if(!locked) {
  242.     DVD dvd = (DVD)supplies[currentIndex];
  243.      int confirm = JOptionPane.showConfirmDialog(this, "Are you sure you want to delete item "+dvd.getItemNumber());
  244.          if(confirm == JOptionPane.YES_OPTION) {
  245.      removeItemAt(currentIndex);
  246.      displayFirst();
  247.      }
  248. }
  249.  
  250. }
  251.  
  252. }
  253. private void modify() {
  254. DVD dvd = (DVD)supplies[currentIndex];
  255. panel = new JPanel();
  256. JPanel add = new JPanel();
  257. add.setLayout(new GridLayout(7, 2));
  258. JButton update = makeButton("Update");
  259. JLabel number = new JLabel("Number :");
  260. JLabel name = new JLabel("Name :");
  261. JLabel title = new JLabel("Title    :");
  262. JLabel quantity = new JLabel("Quantity :");
  263. JLabel price = new JLabel("Price    :");
  264. add.add(number);
  265. numberField.setText(""+dvd.getItemNumber()); numberField.setEditable(false); add.add(numberField);
  266. add.add(name);
  267. nameField.setText(dvd.getItemName()); add.add(nameField);
  268. titleField.setText(dvd.getTitle()); titleField.setEditable(false);
  269. add.add(title); add.add(titleField);
  270. add.add(quantity);
  271. quantityField.setText(""+dvd.getStockQuantity());
  272. add.add(quantityField);
  273. add.add(price);
  274. add.add(priceField); priceField.setText(""+dvd.getItemPrice());
  275. panel.add(add);
  276. JPanel forAddIt = new JPanel();
  277. forAddIt.add(update);
  278. panel.add(forAddIt);
  279. displayHolder.remove(display);
  280. displayHolder.add(panel);
  281. //display = panel;
  282.      this.setVisible(true);
  283.  
  284. }
  285.  
  286. private void addItemToArray() {
  287. Product p = new DVD(nameField.getText(), supplies.length + 1, Long.parseLong(quantityField.getText()),
  288. Double.parseDouble(priceField.getText()), titleField.getText());
  289. //Extend size of array by one first
  290. Product[] ps = new Product[supplies.length + 1];
  291. for(int i = 0; i < ps.length-1; i++) {
  292. ps[i] = supplies[i];
  293. }
  294. ps[supplies.length] = p;
  295. supplies = ps;
  296. displayHolder.remove(panel);
  297. displayHolder.add(display);
  298. displayLast();
  299. this.setVisible(false);
  300. this.setVisible(true);
  301.  
  302. }
  303.  
  304. //Utility method to ease the typing and reuse code
  305. //This method reduces the number of lines of our code
  306. private void displayItemAt(int index) {
  307.  
  308. DVD product = (DVD)supplies[index];
  309. name.setText("Item Name: "+ product.getItemName());
  310. number.setText("Item Number: "+ product.getItemNumber());
  311. title.setText("Title: "+ product.getTitle());
  312. quantity.setText("Quantity In Stock: "+ product.getStockQuantity());
  313. price.setText("Item Price: "+ product.getItemPrice());
  314. totalValue.setText("Total: " + product.calculateInventoryValue());
  315. fee.setText("Fee :"+product.calculateRestockFee());
  316. locked = false;
  317. this.repaint();
  318.  
  319.  
  320. this.setVisible(true);
  321. }
  322.  
  323. private void modifyItemInArray() {
  324. Product p = new DVD(nameField.getText(), supplies.length + 1, Long.parseLong(quantityField.getText()),
  325. Double.parseDouble(priceField.getText()), titleField.getText());
  326. supplies[currentIndex] = p;
  327. displayHolder.remove(panel);
  328. displayHolder.add(display);
  329.     displayItemAt(currentIndex);
  330. this.setVisible(false);
  331. this.setVisible(true);
  332.  
  333. }
  334.  
  335. private void removeItemAt(int index) {
  336. Product[] temp = new Product[supplies.length-1];
  337. int counter = 0;
  338. for(int i = 0; i < supplies.length;i++) {
  339. if(i == index) { //skip the item to delete
  340. }
  341. else {
  342.     temp[counter++] = supplies[i];
  343. }
  344. }
  345. supplies = temp;
  346. }
  347.  
  348. public void displayFirst() {
  349. displayItemAt(0);
  350. currentIndex = 0;
  351. }
  352.  
  353. public void displayNext() {
  354. if(currentIndex == supplies.length-1) {
  355. displayFirst();
  356. currentIndex = 0;
  357. }
  358. else {
  359. displayItemAt(currentIndex + 1);
  360. currentIndex++;
  361.  
  362. }
  363. }
  364.  
  365. public void displayPrevious() {
  366. if(currentIndex == 0) {
  367. displayLast();
  368. currentIndex = supplies.length-1;
  369. }
  370. else {
  371. displayItemAt(currentIndex - 1);
  372. currentIndex--;
  373. }
  374. }
  375.  
  376. public void displayLast() {
  377. displayItemAt(supplies.length-1);
  378. currentIndex = supplies.length-1;
  379. }
  380.  
  381. }//end class Inventory2
  382.  
  383.  
  384.  
Only two buttons not yet working now. This should not take a day to complete now. I've deliberately stopped there because I'm sure you have lots of questions to ask at this current stage. You must understand everyline of code there first before we finish it off
Feb 12 '07 #31
r035198x
13,262 MVP
Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3. class Product implements Comparable {
  4.  String name;
  5.  double number;
  6.  long stockQuantity;
  7.  double price;
  8.  
  9.  public Product() {
  10.   name = "";
  11.   number = 0.0;
  12.   stockQuantity = 0L;
  13.   price = 0.0;
  14.  
  15.  }
  16.  public Product(String name, int number, long stockQuantity, double price) {
  17.   this.name = name;
  18.   this.number = number;
  19.   this.stockQuantity = stockQuantity;
  20.   this.price = price;
  21.  }
  22.  public void setItemName(String name) {
  23.   this.name = name;
  24.  }
  25.  public String getItemName() {
  26.   return name;
  27.  }
  28.  public void setItemNumber(double number) {
  29.   this.number = number;
  30.  }
  31.  public double getItemNumber() {
  32.   return number;
  33.  }
  34.  public void setStockQuantity(long quantity) {
  35.   stockQuantity = quantity;
  36.  }
  37.  public long getStockQuantity() {
  38.   return stockQuantity;
  39.  }
  40.  public void setItemPrice(double price) {
  41.   this.price = price;
  42.  }
  43.  public double getItemPrice() {
  44.   return price;
  45.  }
  46.  public double calculateInventoryValue() {
  47.   return getItemPrice() * getStockQuantity();
  48.  }
  49.  public int compareTo (Object o) {
  50.   Product p = (Product)o;
  51.   return name.compareTo(p.getItemName());
  52.  }
  53.  public String toString() {
  54.   return "Name :"+getItemName() + "\nNumber"+number+"\nPrice"+price+"\nQuantity"+stockQuantity + "\nValue :"+calculateInventoryValue();
  55.  }
  56.  
  57.  
  58.  
  59.  
  60. class DVD extends Product implements Comparable {
  61.  private String title;
  62.  public DVD() {
  63.   super(); //Call the constructor in Product
  64.   title = ""; //Add the additonal attribute
  65.  }
  66.  public DVD(String name, int number, long stockQuantity, double price, String title) {
  67.   super(name, number, stockQuantity, price); //Call the constructor in Product
  68.   this.title = title; //Add the additonal attribute
  69.  }
  70.  public void setTitle(String title) {
  71.   this.title = title;
  72.  }
  73.  public String getTitle() {
  74.   return title;
  75.  }
  76.  public double calculateInventoryValue() {
  77.   return getItemPrice() * getStockQuantity() + getItemPrice()*getStockQuantity()*0.05;
  78.  }
  79.  
  80.  public double calculateRestockFee() {
  81.   return getItemPrice() * 0.05;
  82.  }
  83.  public int compareTo (Object o) {
  84.   Product p = (Product)o;
  85.   return getItemName().compareTo(p.getItemName());
  86.  }
  87.  public String toString() {
  88.   return "Name :"+getItemName() + "\nNumber"+getItemNumber()+"\nPrice"+getItemPrice()+"\nQuantity"+getStockQuantity() +"\nTitle :"+getTitle()+"\nValue"+calculateInventoryValue();
  89.  }
  90. }
  91.  
  92.  
The Product and DVD classes remain unchanged
Feb 12 '07 #32
stevedub
40 New Member
I think I am slowly starting to understand the code, and what it is actually doing. I think my biggest problem is trying to figure out the order in which to present the code. This may take some time to digest, but it looks great, thank you so much.
Feb 12 '07 #33
ITQUEST
11 New Member
I think I am slowly starting to understand the code, and what it is actually doing. I think my biggest problem is trying to figure out the order in which to present the code. This may take some time to digest, but it looks great, thank you so much.

Stevedub,
Looks like I am in the same class you are but only in Week 5. I am completely lost and the teacher is NO help!
Can you offer any advice for the Wk 5 Checkpoint? It is the Inventory Program Part 1.

ITQUEST
Feb 13 '07 #34
ITQUEST
11 New Member
Stevedub,
Looks like I am in the same class you are but only in Week 5. I am completely lost and the teacher is NO help!
Can you offer any advice for the Wk 5 Checkpoint? It is the Inventory Program Part 1.

ITQUEST
Me again...
I am also wondering how to set up a class. I get how to establish the Java file but the class thing has me confused. What is the difference? I guess I have just been getting by until now, but I can't seem to get it right!
ITQUEST
Feb 13 '07 #35
stevedub
40 New Member
Hehe, I feel your pain bro, wait till you get further into the class. Here is the code I have from week 5:
Expand|Select|Wrap|Line Numbers
  1. // Product class
  2.  
  3.  
  4. public class Product {
  5.  
  6.     private String title;
  7.     private double item;
  8.     private double stock;
  9.     private double price;
  10.  
  11.     // Constructor to initialize the product information.
  12.     public Product(String title, double item, double stock,
  13.             double price) {
  14.         setTitle(title);
  15.         setItem(item);
  16.         setStock(stock);
  17.         setPrice(price);
  18.  
  19.     }
  20.  
  21.     // Method to get the title
  22.     public String getTitle() {
  23.         return title;
  24.     }
  25.  
  26.     // Method to get the item number
  27.     public double getItem() {
  28.         return item;
  29.     }
  30.  
  31.     //Method to get the stock
  32.     public double getStock() {
  33.         return stock;
  34.     }
  35.  
  36.     //Method to get the price
  37.     public double getPrice() {
  38.         return price;
  39.  
  40.  
  41.  
  42.     }
  43.  
  44.     // Method to set the title name.
  45.     public void setTitle(String title) {
  46.         this.title = title;
  47.     }
  48.  
  49.     // Method to set the item number.
  50.     public void setItem(double item) {
  51.         this.item = item;
  52.     }
  53.  
  54.     // Method to set the stock available.
  55.     public void setStock(double stock) {
  56.         this.stock = stock;
  57.     }
  58.  
  59.     //Method to set the price.
  60.     public void setPrice(double price) {
  61.         this.price = price;
  62.  
  63.     }
  64.     // Method to compute the value of inventory.
  65.     public double getInvValue() {
  66.         return this.stock *this.price;
  67.     }
  68.  
  69. }
  70.  
  71.  
  72. // This is a new class Inventory
  73. // Inventory program
  74. // Main application
  75.  
  76.  
  77.  
  78. public class Inventory
  79. {
  80.     public static void main (String args [])
  81.     {
  82.  
  83.     System.out.println ("Inventory of DVD Movies:\n");
  84.  
  85.         String title = "Beerfest";
  86.         double item = 1;
  87.         double stock = 15;
  88.         double price = 22.50;
  89.         double value;
  90.  
  91.     Product product = new Product (title, item, stock, price);
  92.  
  93.     System.out.printf( "%s%18s\n", "DVD Title:", product.getTitle() );
  94.  
  95.     System.out.printf( "%s%16s\n", "Item #:", product.getItem() );
  96.  
  97.     System.out.printf( "%s%8s\n", "Number in Stock:" , product.getStock() );
  98.  
  99.     System.out.printf( "%s%18s\n", "Price:", product.getPrice() );
  100.  
  101.  
  102.  
  103.     System.out.printf( "%s%9s\n", "Inventory Value:", product.getInvValue() );
  104.  
  105.     }
  106. }
  107.  
Feb 13 '07 #36
stevedub
40 New Member
Let me know if you have any questions about the code.
Feb 13 '07 #37
ITQUEST
11 New Member
Let me know if you have any questions about the code.

Do you post the first half as your .java and the second as your .class to get it to run? I understand how you have it written. I can read the material and understand it when I see it, but putting the two together is the challenge for me.

I have to say that all of the classes so far have been fine, but this one is bad. Do you mind me asking questions along the way or will you leave this forum after you complete the course?

ITQUEST
Feb 13 '07 #38
ITQUEST
11 New Member
Do you post the first half as your .java and the second as your .class to get it to run? I understand how you have it written. I can read the material and understand it when I see it, but putting the two together is the challenge for me.

I have to say that all of the classes so far have been fine, but this one is bad. Do you mind me asking questions along the way or will you leave this forum after you complete the course?

ITQUEST
I run it and get the following error:

NoClassDefFound Error: Product

Any suggestions?
Feb 13 '07 #39
r035198x
13,262 MVP
I run it and get the following error:

NoClassDefFound Error: Product

Any suggestions?
.java classes are compiled to into .class files. If you have a .java file called Product.java, when you compile it a .class is created for every class in the file Product.java if there are no errors. In this case you are getting this error because there is no class file called Product.class so you must compile the Product class first.
Feb 13 '07 #40

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

Similar topics

109
25902
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 assignments... 4. CheckPoint: Inventory Program Part 1 • Resource: Java: How to Program • Due Date: Day 5 forum • Choose a product that lends itself to an inventory (for example, products at your workplace, office supplies, music CDs, DVD...
0
7118
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 the due date 10% of the grade is taken off. I think I'm coming down with the flu and my brain is just not processing this assignment. Here is the assignment: Modify the Inventory program by adding a button to the GUI that allows the user to move...
4
2315
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 trying to compile a program using TextPad. Here is what I have so far. /* * Main.java * * Created on July 19, 2007, 5:54 PM *
9
7614
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 the item number, the name of the product, the number of units in stock, the price of each unit, and the value of the inventory of that product. In addition, the output should display the value of the entire inventory. • Create a method to calculate...
3
7013
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 program that I have built so far with no problem. But I cannot figure out how to turn it into a GUI application. This is what I'm trying to get it to do. Modify the Inventory Program to use a GUI. The GUI should display the information one product...
5
3379
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 the Delete and Modify Button. The Search button works but it only searchs the new .dat file or what is set in the array. Not sure what is going on there. But if I can get my delete and modify button to work that will be good. Code.... ...
2
2545
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 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...
3
4490
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 of each unit, and the value of the inventory of that product. In addition, the GUI should display the value of the entire inventory, the additional attribute, and the restocking fee. Here is my Inventory program from 1 to 3: package...
16
6009
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 information one product at a time, including the item number, the name of the product, the number of units in stock, the price of each unit, and the value of the inventory of that product. In addition, the output should display the value of the entire...
0
9705
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10564
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10308
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10073
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7609
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6846
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5513
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4288
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3806
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.