Re: Storing multiple JSpinner Values in an Array

Posted 18 October 2012 - 10:32 AM

"java.lang.NullPointerException
at GUI_PHASE3_1$ButtonHandler.actionPerformed(GUI_PHASE3_1.java:234)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)"

Re: Storing multiple JSpinner Values in an Array

Posted 18 October 2012 - 11:22 AM

are the prices and products not being stored into the variables i declared right at the top? I put them there so as to allow visibility to other pieces of code, but you are right my coding is messy! I am only just a beginner in highschool and am still learning

The reason they are int is because the prices assigned to the products from my textfile are all in integer form and have no decimals

What i am intending to do is when button "refresh" is pushed, it should output an amount that multiplys the value within the adjacent spinner of the product and give a price to which i am going to add up, finally producing a Total Cost label...