the whole program is commented out...
put */ at the line after the author
zeroliken
Veteran Poster
1,106 posts since Nov 2011
Reputation Points: 201
Solved Threads: 162
Java is case sensitive
so that should be "Public class payroll" not Payroll
either change the file name's first letter to uppercase or the public class name's first letter to lowercase
zeroliken
Veteran Poster
1,106 posts since Nov 2011
Reputation Points: 201
Solved Threads: 162
I think your running javaapplication5 class instead of payroll class
...judging from the image
Edit: If your figuring this out...Left click on payroll.java on the Projects tab at the left side of netbeans then click run file
... or simply Shift + F6 :)
zeroliken
Veteran Poster
1,106 posts since Nov 2011
Reputation Points: 201
Solved Threads: 162
Try what I suggested a while ago
Left click on payroll.java on the Projects tab at the left side of netbeans then click run file
zeroliken
Veteran Poster
1,106 posts since Nov 2011
Reputation Points: 201
Solved Threads: 162
F6 runs your main project
Try using Shift + F6 to run the java file on the current screen
zeroliken
Veteran Poster
1,106 posts since Nov 2011
Reputation Points: 201
Solved Threads: 162
or just right click in it and select 'run as'
stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
right click on your source file and click on run file option.
rushikesh jadha
Junior Poster in Training
89 posts since Dec 2011
Reputation Points: 4
Solved Threads: 11
right click on your source file and click on run file option.
brilliant thought. which is why I suggested him to do so several days ago.
@Torf: what exactly do you mean? does it do what you want/expect it to do? if not: what does it do and what do you expect it to do.
stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
The code should be fine.
Those red lines found at the rightmost side of netbeans says otherwise
try to fix those issues before running theright file
PS. next time just attach the image on your post so we can view it at the thumbnail
zeroliken
Veteran Poster
1,106 posts since Nov 2011
Reputation Points: 201
Solved Threads: 162
you don't declare input as a String, there's your first error seems to me.
stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
If you want to use classes like JOptionPane from the javax.swing package then either
1. Use its fully qualified name javax.swing.JOptionPane or
2. import the class (or package) at the beginning of your program so you can use the class name without qualification
JamesCherrill
Posting Genius
6,373 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
If you want to use classes like JOptionPane from the javax.swing package then either
1. Use its fully qualified name javax.swing.JOptionPane or
2. import the class (or package) at the beginning of your program so you can use the class name without qualification
should've seen that one ...
stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
It's called teamwork. :)
ps Torf: While we're at it, if (x == 1)
It's always dangerous to rely on an exact equals with a floating-point value. You can never be certain that x isn't 0.99999999999 after a calculation whose exact result should be 1.0. It's particularly dangerous in this case because you are relying on it to terminate a recursive algorithm. Far far safer to code that as if (x <= 1)
JamesCherrill
Posting Genius
6,373 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073