Ah, I wasn't thinking that. I'll try that. Thanks.
And thank you javapenguin.
Type: Posts; User: scooty199
Ah, I wasn't thinking that. I'll try that. Thanks.
And thank you javapenguin.
I've also tested the first if statement, if it's true it'll come up with a box saying created. So it does create it.
Because it order for my program requirements to be met, it had to be instantiated at some point, but the program requirements wouldn't have been met if I just had it set as
StudentGrades sg = null;
Well, I do have it defined.
Here's the full code
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.Random;
No, I mean area[0]. I specifically have an array of 8 JTextAreas, used in a JLayeredPane.
Here's the fields in StudentGUI
private int[] scores;
private int[] sorted;
static JButton[]...
Ok, so I'm working with returning an array in my program, StudentGrades
In this block, once my button construct is hit... it creates the array
if(e.getActionCommand().equals("Construct"))...
I've gotten the JFrames fixed. I entirely eliminated the use of the JFrame array.
I know I initialized sg. I always hit the construct button before I hit any of the action buttons.
When I hit my Action 1 button, it gives me a NPE for scores.
I know scores is set to null, but ...
Any help at all?
Alright I got it displaying, now I'm getting a NullPointException at
scores = sg.getTestGrades();
I noticed that, and it was fixed. oddly it didn't throw a nullpointer exception.
And I'll try that e.getActionCommand()
I added that for all my JFrames, included the inherited one.
It seems it just sits there when I run, nothing comes up.
Ok, so I've had my three classes, and nothing seems to be running for me. It compiles well, just my swing components don't appear.
Here's the code:
GUI Class
import java.awt.*;
import...
I did find my error. I realized in my keyPressed method I should have out the parseInt under the if condition.
Thanks for the help!
Ok, so in my GUI application, it takes a string and converts it to a number, but there's a problem.
It generates a run time error
Here's the cod]
import java.awt.*;
import java.awt.event.*;...