Ahh. I see. Thanks for the information. It looks like I've got everything.
Type: Posts; User: Inked.
Ahh. I see. Thanks for the information. It looks like I've got everything.
Duh. Right, I had to modify the class name's mid-progress. I guess I wasn't very thorough with it and didn't change that aswell. Found a few more instances of that problem and fixed them.
But now...
Ohhh. Right. That makes sense. That reduced my compiling errors by quite a bit.
WorkerDemoWilson.java:79: error: cannot find symbol
ProductionWorkerWilson pw = new...
Alright, I'm sure the problem I'm having is an oversight on my part but I'm not seeing my mistake.
WorkerDemoWilson.java:13: error: cannot find symbol
ProductionWorkerWilson pw1 = new...
Great, I got it. Thank you.
The errors are:
Employee.java:105: error: ')' expected
if(num.charAt(0.isDigit()) && num.charAt(1.isDigit()) && num.charAt(2).isDigit()) && num.charAt(3) = "-")
^...
Right.
Here's what I have so far
if(num.charAt(0.isDigit()) && num.charAt(1.isDigit()) && num.charAt(2).isDigit()) && num.charAt(3) = "-")
{
status = false;
}
...
It is enough to say that there is an error in the string. It shall throw an exception if there is that explains to the user the correct format that needs to be entered if they enter it wrongly...
So should I have 3 separate if statements? One for each of the things I'm checking? How could I go about doing this? (I haven't had much experience with this kind of issue until recently).
I can code a loop/if to do the validation, mostly. I just worry with that because, if I were to do Character.isDigit at the index, wouldn't it throw my exception once it got to the - or the B,...
The string will be created based on user input, I'll ask them for them to enter it with a reminder of the format. However; as much as I can tell the user it has to be in that format, I need to create...
Alright, so let's say I have this string. I want to make it so that the string for this variable has to follow a certain format.
For example, "AAA-B", where the A's are a digit 0-9, the - is...
That works, but it's weird because I thought I had to have the
JPanel centerPanel = new JPanel();
For all of them? Because the top and bottom panels are like that and they work aswell. Like,...
Negative. It's defined, then it creates the panel and sets it center. It adds a label message and then later it's used in a control structure to set the background color depending on what button the...
I'm definitely looking at the correct line.
My print statement is up at line 62, right after the panel is created.
Edit: Inside my control strucutre right before line 155, it prints null. But...
Well centerPanel is the only variable on the line. The code I posted was the line in full.
The only variable on that line is centerPanel, and when printed I get:
...
Line 155 is:
centerPanel.setBackground(Color.ORANGE);
centerPanel is definitely created before it's used. The only time it's even mentioned before creation is up in the definitions. With a...
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at ColorFactory$ButtonListener.actionPerformed(ColorFactory.java:155)
at...
Right. I had realized it was trying to use the labelMessage before I had it created.
That wasn't the case for the centerPanel one. But once I changed the labelMessage, it still ran without...
Haha. Thought I did. Woops.
They both print null. Both centerPanel and labelMessage.
Edit: I realized that for whatever reason, it was showing the wrong line as line 62.
My real line 62 is:
centerPanel.add(labelMessage);
Going to check for the null now..
Update: I get...
Alright, so I'm getting this exception when running my program (it compiles fine).
Exception in thread "main" java.lang.NullPointerException
at java.awt.Container.addImpl(Container.java:1086)...