• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

NEED HELP WITH JAVA PROBLEM!

willtriv

Member

the error thrown is

Exception in thread "AWT-EventQueue-1" java.lang.NullPointerException
at Course.getPts(Course.java:38)
at GpaApplet.actionPerformed(GpaApplet.java:76)
at java.awt.Button.processActionEvent(Button.java:388)
at java.awt.Button.processEvent(Button.java:356)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)


for some reason when the getPts() method is called it thinks the class has no value stored. I've initiated the class as this...

courses[counter] = new Course( letterIn.getText() , Double.parseDouble( cHIn.getText() ) );

in the contructor the values seem to work correctly and seem to be storing the right values at the time.

when i call the getPts() it looks like this...
if(courses[counter].getPts()>0 && courses[counter].getCh()>0)

but it seems that the values that are stored in the constructor are gone!

any advice?
 
Back
Top