Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Stock;
- public class Add extends javax.swing.JFrame {
- /**
- * Creates new form Add
- */
- public Add() {
- initComponents();
- this.setLocationRelativeTo(null);
- }
- private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {
- String id = jTextField1.getText();
- String p = jTextField2.getText();
- String kp = jTextField3.getText();
- String kc = jTextField4.getText();
- String ka = jTextField5.getText();
- if (id.equals("") || p.equals("") || kp.equals("") || kc.equals("") || ka.equals(""))
- {
- JOptionPane.showConfirmDialog(null,"Plese fill all informations", "Fail", JOptionPane.DEFAULT_OPTION);
- }
- else if (findProduct(id, true))
- {
- JOptionPane.showConfirmDialog(null,"Sorry, product is already in stock", "Fail", JOptionPane.DEFAULT_OPTION);
- } else {
- int price = Integer.parseInt(kp);
- int cost = Integer.parseInt(kc);
- int re = price - cost;
- int amount = Integer.parseInt(ka);
- addProduct(id, p, price, cost,re , amount);
- JOptionPane.showConfirmDialog(null,"Add complete", "Successful", JOptionPane.DEFAULT_OPTION);
- // updateTable(true) <-- Not Found
- this.setVisible(false);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement