Page 2 of 2 FirstFirst 12
Results 21 to 38 of 38
Like Tree1Likes

Thread: Calculating values from a jtable column

  1. #21
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,422
    Rep Power
    20

    Default Re: Calculating values from a jtable column

    Quote Originally Posted by victaino View Post
    hope this meets up with SSCCE spec
    Quite apart from the two points already mentioned by Fubarable, your stated problem has nothing to do with -
    - a soft bevel border
    - showGrid(false)
    - a keyPressed(...) method that goes into stack overflow due to infinite recursion
    - several lines of unused imports

    Is it so hard to write code that you have to use a visual designer with which you are clearly not competent to produce a SSCCE?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  2. #22
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Calculating values from a jtable column

    For example, here's the beginnings of an SSCCE. Feel free to modify it so that it shows your problem:

    Java Code:
    import java.awt.BorderLayout;
    import java.awt.EventQueue;
    import java.awt.event.ActionEvent;
    
    import javax.swing.*;
    import javax.swing.event.*;
    
    public class Sale2 implements TableModelListener {
    
       int total = 0;
       String totalResult = null;
       private javax.swing.JTable jTable1;
       private javax.swing.JTextField txtTotal;
       private javax.swing.JScrollPane jScrollPane1;
    
       public Sale2() {
          txtTotal = new JTextField(6);
          jScrollPane1 = new javax.swing.JScrollPane();
          jTable1 = new JTable();
    
          jTable1.setModel(new javax.swing.table.DefaultTableModel(
                new Object[][] { { null, null, null, null, null } }, new String[] {
                      "Item", "Quantity", "Unit Price", "Discount", "Subtotal" }));
          jTable1.setShowGrid(false);
          jTable1.putClientProperty("terminateEditOnFocusLost", true);
          jScrollPane1.setViewportView(jTable1);
          
          JPanel bottomPanel = new JPanel();
          bottomPanel.add(new JLabel("total:"));
          bottomPanel.add(txtTotal);
          bottomPanel.add(new JButton(new AbstractAction("Button") {
             
             @Override
             public void actionPerformed(ActionEvent arg0) {
                // TODO: put button code here, if needed
                System.out.println("button pressed");
             }
          }));
          
          JPanel panel = new JPanel(new BorderLayout());
          panel.add(jScrollPane1, BorderLayout.CENTER);
          panel.add(bottomPanel, BorderLayout.PAGE_END);
          
          
          JOptionPane.showMessageDialog(null, panel);
    
       }
    
       public void tableChanged(TableModelEvent e) {
          if (e.getType() == TableModelEvent.UPDATE) {
             int row = jTable1.getRowCount();
    
             for (int i = 0; i < row; i++) {
                total += Integer.parseInt(jTable1.getValueAt(i, 4).toString());
             }
    
             totalResult = Integer.toString(total);
             txtTotal.setText(totalResult);
          }
       }
    
       public static void main(String[] args) {
          EventQueue.invokeLater(new Runnable() {
             public void run() {
                try {
                   new Sale2();
                } catch (Exception e) {
                   e.printStackTrace();
                }
             }
          });
       }
    }
    Last edited by Fubarable; 05-22-2012 at 05:48 PM.

  3. #23
    victaino is offline Member
    Join Date
    Apr 2012
    Posts
    38
    Rep Power
    0

    Default Re: Calculating values from a jtable column

    Quote Originally Posted by Fubarable View Post
    My compiler is not tolerating your GroupLayout objects. Is this from a NetBeans' project?
    yes is from netbeans.

  4. #24
    victaino is offline Member
    Join Date
    Apr 2012
    Posts
    38
    Rep Power
    0

    Default Re: Calculating values from a jtable column

    i created the gui using netbeans. i have also tested the code using jFrame. the layout is generated by the compiler.
    Last edited by victaino; 05-22-2012 at 10:27 PM.

  5. #25
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Calculating values from a jtable column

    Quote Originally Posted by victaino View Post
    i created the guy using netbeans. i have also tested the code using jFrame. the layout is generated by the compiler.
    I've shown you how you can create very simple code others without NetBeans can test without using generated code. Feel free to use my code to demonstrate your problem if you can. If you can't, please feel free to ask for help.

  6. #26
    victaino is offline Member
    Join Date
    Apr 2012
    Posts
    38
    Rep Power
    0

    Default Re: Calculating values from a jtable column

    Thank you so much Fubarable for your help. i have added mine to demonstrate the problem. I have also added the error i get.

    Java Code:
    
    import java.awt.BorderLayout;
    import java.awt.EventQueue;
    import java.awt.event.ActionEvent;
    import java.awt.event.KeyEvent;
     
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.table.DefaultTableModel;
     
    public class Sale2 implements TableModelListener {
     
       int total = 0;
       String totalResult = null;
       private javax.swing.JTable jTable1;
       private javax.swing.JTextField txtTotal;
       private javax.swing.JScrollPane jScrollPane1;
     
       public Sale2() {
          txtTotal = new JTextField(6);
          jScrollPane1 = new javax.swing.JScrollPane();
          jTable1 = new JTable();
     
          jTable1.setModel(new javax.swing.table.DefaultTableModel(
                new Object[][] { { null, null, null, null, null } }, new String[] {
                      "Item", "Quantity", "Unit Price", "Discount", "Subtotal" }));
          jTable1.setShowGrid(false);
          jTable1.putClientProperty("terminateEditOnFocusLost", true);
          jScrollPane1.setViewportView(jTable1);
          jTable1.addKeyListener(new java.awt.event.KeyAdapter() {
                public void keyPressed(java.awt.event.KeyEvent evt) {
                    jTable1KeyPressed(evt);
                }
          });
          
          jTable1.getModel().addTableModelListener(this);
         
           
          JPanel bottomPanel = new JPanel();
          bottomPanel.add(new JLabel("total:"));
          bottomPanel.add(txtTotal);
          bottomPanel.add(new JButton(new AbstractAction("Button") {
              
             @Override
             public void actionPerformed(ActionEvent arg0) {
                // TODO: put button code here, if needed
                System.out.println("button pressed");
             }
          }));
           
          JPanel panel = new JPanel(new BorderLayout());
          panel.add(jScrollPane1, BorderLayout.CENTER);
          panel.add(bottomPanel, BorderLayout.PAGE_END);
           
           
          JOptionPane.showMessageDialog(null, panel);
     
       }
     
       public void tableChanged(TableModelEvent e) {
          if (e.getType() == TableModelEvent.UPDATE) {
             int row = jTable1.getRowCount();
     
             for (int i = 0; i < row; i++) {
                total += Integer.parseInt(jTable1.getValueAt(i, 4).toString()); // stack trace keep pointing to this line
             }
     
             totalResult = Integer.toString(total);
             txtTotal.setText(totalResult);
          }
       }
       
       private void jTable1KeyPressed(java.awt.event.KeyEvent evt) {                                   
            // TODO add your handling code here:
                 if (evt.getKeyCode()==KeyEvent.VK_ENTER)
            {
               DefaultTableModel model = (DefaultTableModel) jTable1.getModel();
               model.addRow(new Object [] {null,null,null,null,null,null,null});
            } else if(evt.getKeyCode() == KeyEvent.VK_ESCAPE){
                
                DefaultTableModel model = (DefaultTableModel) jTable1.getModel();
                int row = jTable1.getSelectedRow();
                model.removeRow(row);
            } 
        }          
     
       public static void main(String[] args) {
          EventQueue.invokeLater(new Runnable() {
             public void run() {
                try {
                   new Sale2();
                } catch (Exception e) {
                   e.printStackTrace();
                }
             }
          });
       }
    }
    error

    Java Code:
    run:
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    	at Sale2.tableChanged(Sale2.java:64)
    	at javax.swing.table.AbstractTableModel.fireTableChanged(AbstractTableModel.java:280)
    	at javax.swing.table.AbstractTableModel.fireTableCellUpdated(AbstractTableModel.java:259)
    	at javax.swing.table.DefaultTableModel.setValueAt(DefaultTableModel.java:650)
    	at javax.swing.JTable.setValueAt(JTable.java:2710)
    	at javax.swing.JTable.editingStopped(JTable.java:4712)
    	at javax.swing.AbstractCellEditor.fireEditingStopped(AbstractCellEditor.java:125)
    	at javax.swing.DefaultCellEditor$EditorDelegate.stopCellEditing(DefaultCellEditor.java:350)
    	at javax.swing.DefaultCellEditor.stopCellEditing(DefaultCellEditor.java:215)
    	at javax.swing.JTable$GenericEditor.stopCellEditing(JTable.java:5466)
    	at javax.swing.plaf.basic.BasicTableUI$Actions.actionPerformed(BasicTableUI.java:469)
    	at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1645)
    	at javax.swing.JComponent.processKeyBinding(JComponent.java:2851)
    	at javax.swing.JTable.processKeyBinding(JTable.java:5247)
    	at javax.swing.JComponent.processKeyBindings(JComponent.java:2897)
    	at javax.swing.JComponent.processKeyEvent(JComponent.java:2814)
    	at java.awt.Component.processEvent(Component.java:6152)
    	at java.awt.Container.processEvent(Container.java:2083)
    	at java.awt.Component.dispatchEventImpl(Component.java:4737)
    	at java.awt.Container.dispatchEventImpl(Container.java:2141)
    	at java.awt.Component.dispatchEvent(Component.java:4565)
    	at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1836)
    	at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:712)
    	at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:990)
    	at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:855)
    	at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:676)
    	at java.awt.Component.dispatchEventImpl(Component.java:4609)
    	at java.awt.Container.dispatchEventImpl(Container.java:2141)
    	at java.awt.Window.dispatchEventImpl(Window.java:2482)
    	at java.awt.Component.dispatchEvent(Component.java:4565)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:684)
    	at java.awt.EventQueue.access$000(EventQueue.java:85)
    	at java.awt.EventQueue$1.run(EventQueue.java:643)
    	at java.awt.EventQueue$1.run(EventQueue.java:641)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
    	at java.awt.EventQueue$2.run(EventQueue.java:657)
    	at java.awt.EventQueue$2.run(EventQueue.java:655)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:654)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:205)
    	at java.awt.Dialog$1.run(Dialog.java:1044)
    	at java.awt.Dialog$3.run(Dialog.java:1096)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.awt.Dialog.show(Dialog.java:1094)
    	at javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:853)
    	at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:650)
    	at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:621)
    	at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:592)
    	at Sale2.<init>(Sale2.java:55)
    	at Sale2$3.run(Sale2.java:90)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:682)
    	at java.awt.EventQueue.access$000(EventQueue.java:85)
    	at java.awt.EventQueue$1.run(EventQueue.java:643)
    	at java.awt.EventQueue$1.run(EventQueue.java:641)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:652)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Last edited by victaino; 05-22-2012 at 10:52 PM.

  7. #27
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Calculating values from a jtable column

    The NPE is not too surprising. It occurs when you try to call methods on the contents of your table model, but look at what your table model is filled with:

    Java Code:
          jTable1.setModel(new javax.swing.table.DefaultTableModel(
                new Object[][] { { null, null, null, null, null } }, new String[] {
                      "Item", "Quantity", "Unit Price", "Discount", "Subtotal" }));

  8. #28
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,422
    Rep Power
    20

    Default Re: Calculating values from a jtable column

    Quote Originally Posted by victaino View Post
    i created the gui using netbeans. i have also tested the code using jFrame. the layout is generated by the compiler.
    No, the layout isn't generated by the compiler. It's generated by the visual designer.

    Learn to know the difference.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  9. #29
    victaino is offline Member
    Join Date
    Apr 2012
    Posts
    38
    Rep Power
    0

    Default Re: Calculating values from a jtable column

    thanks db for the correction, it has been noted. pls how do i solve the problem at hand?

  10. #30
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    12,120
    Rep Power
    20

    Default Re: Calculating values from a jtable column

    Check whether the value returned by getValueAt() is null or not before you try and do anything with it (like call toString() on it).

    Also, when posting stack traces you need to highlight the line in your code on which they occur.
    This would have resulted in something approaching an answer several posts ago, when you first mentioned the exception.
    Indeed you would have had close to an answer within the first couple of posts had you mentioned the exception in the first place (with stack trace and pointing out the line). We're not mind readers.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  11. #31
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Calculating values from a jtable column

    The answer is not to fill your JTable's model with nulls and expect to be able to sum anything from the table.

  12. #32
    victaino is offline Member
    Join Date
    Apr 2012
    Posts
    38
    Rep Power
    0

    Default Re: Calculating values from a jtable column

    I eventually got the code working. but I'm now receiving a NumberFormatException. below is the working code:

    Java Code:
    @Override
        public void tableChanged (TableModelEvent e){
            if (e.getType()== e.UPDATE){
              String totalResult = "";
              int total=0;
              int row = jTable1.getRowCount();
                for (int i = 0; i <row; i++){                
                  try{
                  total += Integer.parseInt((String)jTable1.getValueAt(i, 4));
                  }
                  catch(NumberFormatException Nfe){
                      Nfe.printStackTrace();
                      //JOptionPane.showMessageDialog(null, Nfe.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
    
                  }
                }
                
                totalResult = Integer.toString(total);
                System.out.println(totalResult);
                txtTotal.setText(totalResult);  
            }
        }

  13. #33
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Calculating values from a jtable column

    What are you filling your model with? If they're actual Integers, there will be no need to parse. Can you show the actual stacktrace?

  14. #34
    victaino is offline Member
    Join Date
    Apr 2012
    Posts
    38
    Rep Power
    0

    Default Re: Calculating values from a jtable column

    my model contains both integers and strings but the actual column being summed contains integers.

    Java Code:
    run:
    0
    java.lang.NumberFormatException: null
    	at java.lang.Integer.parseInt(Integer.java:417)
    	at java.lang.Integer.parseInt(Integer.java:499)
    	at jomas.Sales.tableChanged(Sales.java:624)
    	at javax.swing.table.AbstractTableModel.fireTableChanged(AbstractTableModel.java:280)
    	at javax.swing.table.AbstractTableModel.fireTableCellUpdated(AbstractTableModel.java:259)
    	at javax.swing.table.DefaultTableModel.setValueAt(DefaultTableModel.java:650)
    	at javax.swing.JTable.setValueAt(JTable.java:2710)
    	at javax.swing.JTable.editingStopped(JTable.java:4712)
    	at javax.swing.AbstractCellEditor.fireEditingStopped(AbstractCellEditor.java:125)
    	at javax.swing.DefaultCellEditor$EditorDelegate.stopCellEditing(DefaultCellEditor.java:350)
    	at javax.swing.DefaultCellEditor.stopCellEditing(DefaultCellEditor.java:215)
    	at javax.swing.JTable$GenericEditor.stopCellEditing(JTable.java:5466)
    	at javax.swing.plaf.basic.BasicTableUI$Actions.actionPerformed(BasicTableUI.java:469)
    	at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1645)
    	at javax.swing.JComponent.processKeyBinding(JComponent.java:2851)
    	at javax.swing.JTable.processKeyBinding(JTable.java:5247)
    	at javax.swing.JComponent.processKeyBindings(JComponent.java:2897)
    	at javax.swing.JComponent.processKeyEvent(JComponent.java:2814)
    	at java.awt.Component.processEvent(Component.java:6152)
    	at java.awt.Container.processEvent(Container.java:2083)
    	at java.awt.Component.dispatchEventImpl(Component.java:4737)
    	at java.awt.Container.dispatchEventImpl(Container.java:2141)
    	at java.awt.Component.dispatchEvent(Component.java:4565)
    	at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1836)
    	at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:712)
    	at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:990)
    	at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:855)
    	at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:676)
    	at java.awt.Component.dispatchEventImpl(Component.java:4609)
    	at java.awt.Container.dispatchEventImpl(Container.java:2141)
    	at java.awt.Window.dispatchEventImpl(Window.java:2482)
    	at java.awt.Component.dispatchEvent(Component.java:4565)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:684)
    	at java.awt.EventQueue.access$000(EventQueue.java:85)
    	at java.awt.EventQueue$1.run(EventQueue.java:643)
    	at java.awt.EventQueue$1.run(EventQueue.java:641)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
    	at java.awt.EventQueue$2.run(EventQueue.java:657)
    	at java.awt.EventQueue$2.run(EventQueue.java:655)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:654)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    java.lang.NumberFormatException: null
    0
    	at java.lang.Integer.parseInt(Integer.java:417)
    	at java.lang.Integer.parseInt(Integer.java:499)
    	at jomas.Sales.tableChanged(Sales.java:624)
    	at javax.swing.table.AbstractTableModel.fireTableChanged(AbstractTableModel.java:280)
    	at javax.swing.table.AbstractTableModel.fireTableCellUpdated(AbstractTableModel.java:259)
    	at javax.swing.table.DefaultTableModel.setValueAt(DefaultTableModel.java:650)
    	at javax.swing.JTable.setValueAt(JTable.java:2710)
    	at javax.swing.JTable.editingStopped(JTable.java:4712)
    	at javax.swing.AbstractCellEditor.fireEditingStopped(AbstractCellEditor.java:125)
    	at javax.swing.DefaultCellEditor$EditorDelegate.stopCellEditing(DefaultCellEditor.java:350)
    	at javax.swing.DefaultCellEditor.stopCellEditing(DefaultCellEditor.java:215)
    	at javax.swing.JTable$GenericEditor.stopCellEditing(JTable.java:5466)
    	at javax.swing.plaf.basic.BasicTableUI$Actions.actionPerformed(BasicTableUI.java:469)
    	at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1645)
    	at javax.swing.JComponent.processKeyBinding(JComponent.java:2851)
    	at javax.swing.JTable.processKeyBinding(JTable.java:5247)
    	at javax.swing.JComponent.processKeyBindings(JComponent.java:2897)
    	at javax.swing.JComponent.processKeyEvent(JComponent.java:2814)
    	at java.awt.Component.processEvent(Component.java:6152)
    	at java.awt.Container.processEvent(Container.java:2083)
    	at java.awt.Component.dispatchEventImpl(Component.java:4737)
    	at java.awt.Container.dispatchEventImpl(Container.java:2141)
    	at java.awt.Component.dispatchEvent(Component.java:4565)
    	at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1836)
    	at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:712)
    	at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:990)
    	at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:855)
    	at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:676)
    	at java.awt.Component.dispatchEventImpl(Component.java:4609)
    	at java.awt.Container.dispatchEventImpl(Container.java:2141)
    	at java.awt.Window.dispatchEventImpl(Window.java:2482)
    	at java.awt.Component.dispatchEvent(Component.java:4565)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:684)
    	at java.awt.EventQueue.access$000(EventQueue.java:85)
    	at java.awt.EventQueue$1.run(EventQueue.java:643)
    	at java.awt.EventQueue$1.run(EventQueue.java:641)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
    	at java.awt.EventQueue$2.run(EventQueue.java:657)
    	at java.awt.EventQueue$2.run(EventQueue.java:655)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:654)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    java.lang.NumberFormatException: null
    	at java.lang.Integer.parseInt(Integer.java:417)
    0
    	at java.lang.Integer.parseInt(Integer.java:499)
    	at jomas.Sales.tableChanged(Sales.java:624)
    	at javax.swing.table.AbstractTableModel.fireTableChanged(AbstractTableModel.java:280)
    	at javax.swing.table.AbstractTableModel.fireTableCellUpdated(AbstractTableModel.java:259)
    	at javax.swing.table.DefaultTableModel.setValueAt(DefaultTableModel.java:650)
    	at javax.swing.JTable.setValueAt(JTable.java:2710)
    	at javax.swing.JTable.editingStopped(JTable.java:4712)
    	at javax.swing.AbstractCellEditor.fireEditingStopped(AbstractCellEditor.java:125)
    	at javax.swing.DefaultCellEditor$EditorDelegate.stopCellEditing(DefaultCellEditor.java:350)
    	at javax.swing.DefaultCellEditor.stopCellEditing(DefaultCellEditor.java:215)
    	at javax.swing.JTable$GenericEditor.stopCellEditing(JTable.java:5466)
    	at javax.swing.plaf.basic.BasicTableUI$Actions.actionPerformed(BasicTableUI.java:469)
    	at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1645)
    	at javax.swing.JComponent.processKeyBinding(JComponent.java:2851)
    	at javax.swing.JTable.processKeyBinding(JTable.java:5247)
    	at javax.swing.JComponent.processKeyBindings(JComponent.java:2897)
    	at javax.swing.JComponent.processKeyEvent(JComponent.java:2814)
    	at java.awt.Component.processEvent(Component.java:6152)
    	at java.awt.Container.processEvent(Container.java:2083)
    	at java.awt.Component.dispatchEventImpl(Component.java:4737)
    	at java.awt.Container.dispatchEventImpl(Container.java:2141)
    	at java.awt.Component.dispatchEvent(Component.java:4565)
    	at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1836)
    	at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:712)
    	at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:990)
    	at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:855)
    	at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:676)
    	at java.awt.Component.dispatchEventImpl(Component.java:4609)
    	at java.awt.Container.dispatchEventImpl(Container.java:2141)
    	at java.awt.Window.dispatchEventImpl(Window.java:2482)
    	at java.awt.Component.dispatchEvent(Component.java:4565)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:684)
    	at java.awt.EventQueue.access$000(EventQueue.java:85)
    	at java.awt.EventQueue$1.run(EventQueue.java:643)
    	at java.awt.EventQueue$1.run(EventQueue.java:641)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
    	at java.awt.EventQueue$2.run(EventQueue.java:657)
    	at java.awt.EventQueue$2.run(EventQueue.java:655)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:654)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    java.lang.NumberFormatException: null
    	at java.lang.Integer.parseInt(Integer.java:417)
    	at java.lang.Integer.parseInt(Integer.java:499)
    	at jomas.Sales.tableChanged(Sales.java:624)
    	at javax.swing.table.AbstractTableModel.fireTableChanged(AbstractTableModel.java:280)
    	at javax.swing.table.AbstractTableModel.fireTableCellUpdated(AbstractTableModel.java:259)
    	at javax.swing.table.DefaultTableModel.setValueAt(DefaultTableModel.java:650)
    	at javax.swing.JTable.setValueAt(JTable.java:2710)
    	at javax.swing.JTable.editingStopped(JTable.java:4712)
    	at javax.swing.AbstractCellEditor.fireEditingStopped(AbstractCellEditor.java:125)
    	at javax.swing.DefaultCellEditor$EditorDelegate.stopCellEditing(DefaultCellEditor.java:350)
    	at javax.swing.DefaultCellEditor.stopCellEditing(DefaultCellEditor.java:215)
    	at javax.swing.JTable$GenericEditor.stopCellEditing(JTable.java:5466)
    	at javax.swing.plaf.basic.BasicTableUI$Actions.actionPerformed(BasicTableUI.java:469)
    	at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1645)
    	at javax.swing.JComponent.processKeyBinding(JComponent.java:2851)
    	at javax.swing.JTable.processKeyBinding(JTable.java:5247)
    	at javax.swing.JComponent.processKeyBindings(JComponent.java:2897)
    	at javax.swing.JComponent.processKeyEvent(JComponent.java:2814)
    350
    	at java.awt.Component.processEvent(Component.java:6152)
    	at java.awt.Container.processEvent(Container.java:2083)
    	at java.awt.Component.dispatchEventImpl(Component.java:4737)
    	at java.awt.Container.dispatchEventImpl(Container.java:2141)
    	at java.awt.Component.dispatchEvent(Component.java:4565)
    	at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1836)
    	at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:712)
    	at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:990)
    	at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:855)
    	at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:676)
    	at java.awt.Component.dispatchEventImpl(Component.java:4609)
    	at java.awt.Container.dispatchEventImpl(Container.java:2141)
    	at java.awt.Window.dispatchEventImpl(Window.java:2482)
    	at java.awt.Component.dispatchEvent(Component.java:4565)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:684)
    	at java.awt.EventQueue.access$000(EventQueue.java:85)
    	at java.awt.EventQueue$1.run(EventQueue.java:643)
    	at java.awt.EventQueue$1.run(EventQueue.java:641)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
    	at java.awt.EventQueue$2.run(EventQueue.java:657)
    	at java.awt.EventQueue$2.run(EventQueue.java:655)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:654)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    java.lang.NumberFormatException: null
    	at java.lang.Integer.parseInt(Integer.java:417)
    350
    	at java.lang.Integer.parseInt(Integer.java:499)
    	at jomas.Sales.tableChanged(Sales.java:624)
    	at javax.swing.table.AbstractTableModel.fireTableChanged(AbstractTableModel.java:280)
    	at javax.swing.table.AbstractTableModel.fireTableCellUpdated(AbstractTableModel.java:259)
    	at javax.swing.table.DefaultTableModel.setValueAt(DefaultTableModel.java:650)
    	at javax.swing.JTable.setValueAt(JTable.java:2710)
    	at javax.swing.JTable.editingStopped(JTable.java:4712)
    	at javax.swing.AbstractCellEditor.fireEditingStopped(AbstractCellEditor.java:125)
    	at javax.swing.DefaultCellEditor$EditorDelegate.stopCellEditing(DefaultCellEditor.java:350)
    	at javax.swing.DefaultCellEditor.stopCellEditing(DefaultCellEditor.java:215)
    	at javax.swing.JTable$GenericEditor.stopCellEditing(JTable.java:5466)
    	at javax.swing.plaf.basic.BasicTableUI$Actions.actionPerformed(BasicTableUI.java:469)
    	at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1645)
    	at javax.swing.JComponent.processKeyBinding(JComponent.java:2851)
    	at javax.swing.JTable.processKeyBinding(JTable.java:5247)
    	at javax.swing.JComponent.processKeyBindings(JComponent.java:2897)
    	at javax.swing.JComponent.processKeyEvent(JComponent.java:2814)
    	at java.awt.Component.processEvent(Component.java:6152)
    	at java.awt.Container.processEvent(Container.java:2083)
    	at java.awt.Component.dispatchEventImpl(Component.java:4737)
    	at java.awt.Container.dispatchEventImpl(Container.java:2141)
    	at java.awt.Component.dispatchEvent(Component.java:4565)
    	at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1836)
    	at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:712)
    	at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:990)
    	at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:855)
    	at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:676)
    	at java.awt.Component.dispatchEventImpl(Component.java:4609)
    	at java.awt.Container.dispatchEventImpl(Container.java:2141)
    	at java.awt.Window.dispatchEventImpl(Window.java:2482)
    	at java.awt.Component.dispatchEvent(Component.java:4565)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:684)
    	at java.awt.EventQueue.access$000(EventQueue.java:85)
    	at java.awt.EventQueue$1.run(EventQueue.java:643)
    	at java.awt.EventQueue$1.run(EventQueue.java:641)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
    	at java.awt.EventQueue$2.run(EventQueue.java:657)
    	at java.awt.EventQueue$2.run(EventQueue.java:655)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:654)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    java.lang.NumberFormatException: null
    	at java.lang.Integer.parseInt(Integer.java:417)
    	at java.lang.Integer.parseInt(Integer.java:499)
    	at jomas.Sales.tableChanged(Sales.java:624)
    	at javax.swing.table.AbstractTableModel.fireTableChanged(AbstractTableModel.java:280)
    	at javax.swing.table.AbstractTableModel.fireTableCellUpdated(AbstractTableModel.java:259)
    	at javax.swing.table.DefaultTableModel.setValueAt(DefaultTableModel.java:650)
    	at javax.swing.JTable.setValueAt(JTable.java:2710)
    	at javax.swing.JTable.editingStopped(JTable.java:4712)
    	at javax.swing.AbstractCellEditor.fireEditingStopped(AbstractCellEditor.java:125)
    	at javax.swing.DefaultCellEditor$EditorDelegate.stopCellEditing(DefaultCellEditor.java:350)
    	at javax.swing.DefaultCellEditor.stopCellEditing(DefaultCellEditor.java:215)
    	at javax.swing.JTable$GenericEditor.stopCellEditing(JTable.java:5466)
    	at javax.swing.plaf.basic.BasicTableUI$Actions.actionPerformed(BasicTableUI.java:469)
    	at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1645)
    	at javax.swing.JComponent.processKeyBinding(JComponent.java:2851)
    350
    	at javax.swing.JTable.processKeyBinding(JTable.java:5247)
    	at javax.swing.JComponent.processKeyBindings(JComponent.java:2897)
    	at javax.swing.JComponent.processKeyEvent(JComponent.java:2814)
    	at java.awt.Component.processEvent(Component.java:6152)
    	at java.awt.Container.processEvent(Container.java:2083)
    	at java.awt.Component.dispatchEventImpl(Component.java:4737)
    	at java.awt.Container.dispatchEventImpl(Container.java:2141)
    	at java.awt.Component.dispatchEvent(Component.java:4565)
    	at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1836)
    	at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:712)
    	at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:990)
    	at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:855)
    	at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:676)
    	at java.awt.Component.dispatchEventImpl(Component.java:4609)
    	at java.awt.Container.dispatchEventImpl(Container.java:2141)
    	at java.awt.Window.dispatchEventImpl(Window.java:2482)
    	at java.awt.Component.dispatchEvent(Component.java:4565)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:684)
    	at java.awt.EventQueue.access$000(EventQueue.java:85)
    	at java.awt.EventQueue$1.run(EventQueue.java:643)
    	at java.awt.EventQueue$1.run(EventQueue.java:641)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
    	at java.awt.EventQueue$2.run(EventQueue.java:657)
    	at java.awt.EventQueue$2.run(EventQueue.java:655)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:654)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    java.lang.NumberFormatException: null
    	at java.lang.Integer.parseInt(Integer.java:417)
    	at java.lang.Integer.parseInt(Integer.java:499)
    	at jomas.Sales.tableChanged(Sales.java:624)
    	at javax.swing.table.AbstractTableModel.fireTableChanged(AbstractTableModel.java:280)
    	at javax.swing.table.AbstractTableModel.fireTableCellUpdated(AbstractTableModel.java:259)
    	at javax.swing.table.DefaultTableModel.setValueAt(DefaultTableModel.java:650)
    	at javax.swing.JTable.setValueAt(JTable.java:2710)
    	at javax.swing.JTable.editingStopped(JTable.java:4712)
    	at javax.swing.AbstractCellEditor.fireEditingStopped(AbstractCellEditor.java:125)
    	at javax.swing.DefaultCellEditor$EditorDelegate.stopCellEditing(DefaultCellEditor.java:350)
    	at javax.swing.DefaultCellEditor.stopCellEditing(DefaultCellEditor.java:215)
    	at javax.swing.JTable$GenericEditor.stopCellEditing(JTable.java:5466)
    	at javax.swing.plaf.basic.BasicTableUI$Actions.actionPerformed(BasicTableUI.java:469)
    	at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1645)
    	at javax.swing.JComponent.processKeyBinding(JComponent.java:2851)
    350
    	at javax.swing.JTable.processKeyBinding(JTable.java:5247)
    	at javax.swing.JComponent.processKeyBindings(JComponent.java:2897)
    	at javax.swing.JComponent.processKeyEvent(JComponent.java:2814)
    	at java.awt.Component.processEvent(Component.java:6152)
    	at java.awt.Container.processEvent(Container.java:2083)
    	at java.awt.Component.dispatchEventImpl(Component.java:4737)
    	at java.awt.Container.dispatchEventImpl(Container.java:2141)
    	at java.awt.Component.dispatchEvent(Component.java:4565)
    	at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1836)
    	at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:712)
    	at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:990)
    	at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:855)
    	at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:676)
    	at java.awt.Component.dispatchEventImpl(Component.java:4609)
    	at java.awt.Container.dispatchEventImpl(Container.java:2141)
    	at java.awt.Window.dispatchEventImpl(Window.java:2482)
    	at java.awt.Component.dispatchEvent(Component.java:4565)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:684)
    	at java.awt.EventQueue.access$000(EventQueue.java:85)
    	at java.awt.EventQueue$1.run(EventQueue.java:643)
    	at java.awt.EventQueue$1.run(EventQueue.java:641)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
    	at java.awt.EventQueue$2.run(EventQueue.java:657)
    	at java.awt.EventQueue$2.run(EventQueue.java:655)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:654)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    java.lang.NumberFormatException: null
    	at java.lang.Integer.parseInt(Integer.java:417)
    	at java.lang.Integer.parseInt(Integer.java:499)
    	at jomas.Sales.tableChanged(Sales.java:624)
    	at javax.swing.table.AbstractTableModel.fireTableChanged(AbstractTableModel.java:280)
    	at javax.swing.table.AbstractTableModel.fireTableCellUpdated(AbstractTableModel.java:259)
    	at javax.swing.table.DefaultTableModel.setValueAt(DefaultTableModel.java:650)
    	at javax.swing.JTable.setValueAt(JTable.java:2710)
    	at javax.swing.JTable.editingStopped(JTable.java:4712)
    	at javax.swing.AbstractCellEditor.fireEditingStopped(AbstractCellEditor.java:125)
    	at javax.swing.DefaultCellEditor$EditorDelegate.stopCellEditing(DefaultCellEditor.java:350)
    	at javax.swing.DefaultCellEditor.stopCellEditing(DefaultCellEditor.java:215)
    	at javax.swing.JTable$GenericEditor.stopCellEditing(JTable.java:5466)
    	at javax.swing.plaf.basic.BasicTableUI$Actions.actionPerformed(BasicTableUI.java:469)
    	at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1645)
    	at javax.swing.JComponent.processKeyBinding(JComponent.java:2851)
    	at javax.swing.JTable.processKeyBinding(JTable.java:5247)
    	at javax.swing.JComponent.processKeyBindings(JComponent.java:2897)
    	at javax.swing.JComponent.processKeyEvent(JComponent.java:2814)
    1050
    	at java.awt.Component.processEvent(Component.java:6152)
    	at java.awt.Container.processEvent(Container.java:2083)
    	at java.awt.Component.dispatchEventImpl(Component.java:4737)
    	at java.awt.Container.dispatchEventImpl(Container.java:2141)
    	at java.awt.Component.dispatchEvent(Component.java:4565)
    	at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1836)
    	at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:712)
    	at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:990)
    	at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:855)
    	at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:676)
    	at java.awt.Component.dispatchEventImpl(Component.java:4609)
    	at java.awt.Container.dispatchEventImpl(Container.java:2141)
    	at java.awt.Window.dispatchEventImpl(Window.java:2482)
    	at java.awt.Component.dispatchEvent(Component.java:4565)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:684)
    	at java.awt.EventQueue.access$000(EventQueue.java:85)
    	at java.awt.EventQueue$1.run(EventQueue.java:643)
    	at java.awt.EventQueue$1.run(EventQueue.java:641)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
    	at java.awt.EventQueue$2.run(EventQueue.java:657)
    	at java.awt.EventQueue$2.run(EventQueue.java:655)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:654)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    java.sql.SQLException: Field 'Sales_Id' doesn't have a default value
    	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
    	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4096)
    	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4028)
    	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2490)
    	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2651)
    	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2683)
    	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2144)
    	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2444)
    	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2362)
    	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2347)
    	at jomas.Sales.insertData(Sales.java:566)
    	at jomas.Sales.jButton16ActionPerformed(Sales.java:433)
    	at jomas.Sales.access$400(Sales.java:29)
    	at jomas.Sales$5.actionPerformed(Sales.java:254)
    	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)
    	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)
    	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
    	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
    	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
    	at java.awt.Component.processMouseEvent(Component.java:6375)
    	at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
    	at java.awt.Component.processEvent(Component.java:6140)
    	at java.awt.Container.processEvent(Container.java:2083)
    	at java.awt.Component.dispatchEventImpl(Component.java:4737)
    	at java.awt.Container.dispatchEventImpl(Container.java:2141)
    	at java.awt.Component.dispatchEvent(Component.java:4565)
    	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4619)
    	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4280)
    	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4210)
    	at java.awt.Container.dispatchEventImpl(Container.java:2127)
    	at java.awt.Window.dispatchEventImpl(Window.java:2482)
    	at java.awt.Component.dispatchEvent(Component.java:4565)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:684)
    	at java.awt.EventQueue.access$000(EventQueue.java:85)
    	at java.awt.EventQueue$1.run(EventQueue.java:643)
    	at java.awt.EventQueue$1.run(EventQueue.java:641)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
    	at java.awt.EventQueue$2.run(EventQueue.java:657)
    	at java.awt.EventQueue$2.run(EventQueue.java:655)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:654)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

  15. #35
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Calculating values from a jtable column

    It's the same d*mn issue -- you're trying to analyze a null cell. Suggestion:
    • do not put anything null into your model, nothing. If you have to initiate an empty model, use the constructor that takes the the column Strings and a row count, and pass in 0 as your row count. Then add rows via the default model's addRow(...) method.
    • If your model's column contains Integers, don't parse them, just get the actual Integer values.

  16. #36
    victaino is offline Member
    Join Date
    Apr 2012
    Posts
    38
    Rep Power
    0

    Default Re: Calculating values from a jtable column

    Quote Originally Posted by Fubarable View Post
    It's the same d*mn issue -- you're trying to analyze a null cell. Suggestion:
    • do not put anything null into your model, nothing. If you have to initiate an empty model, use the constructor that takes the the column Strings and a row count, and pass in 0 as your row count. Then add rows via the default model's addRow(...) method.
    • If your model's column contains Integers, don't parse them, just get the actual Integer values.
    Can i see code sample pls. i used a visual designer to create my user interface and im a bit confuse on what exactly you talking about

  17. #37
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    12,120
    Rep Power
    20

    Default Re: Calculating values from a jtable column

    Then don't use the visual designer, especially if you don't understand Swing yet.
    DarrylBurke likes this.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  18. #38
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,422
    Rep Power
    20

    Default Re: Calculating values from a jtable column

    Quote Originally Posted by DarrylBurke View Post
    Is it so hard to write code that you have to use a visual designer with which you are clearly not competent to produce a SSCCE?
    Quote Originally Posted by Tolls View Post
    Then don't use the visual designer, especially if you don't understand Swing yet.
    You can lead a horse to the water ...

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 1
    Last Post: 03-24-2011, 01:51 PM
  2. JTable Column Flow
    By anilkumar_vist in forum Advanced Java
    Replies: 3
    Last Post: 10-26-2010, 07:57 AM
  3. calculating with values out of another class
    By senca in forum New To Java
    Replies: 3
    Last Post: 04-08-2010, 04:01 PM
  4. split a jtable column
    By anilkumar_vist in forum Advanced Java
    Replies: 0
    Last Post: 12-14-2009, 11:29 AM
  5. JCheckBox in JTable column
    By hind in forum New To Java
    Replies: 8
    Last Post: 01-04-2009, 08:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •