JavaRanch » Java Forums »
Java »
Beginning Java
| Author |
Symbol Not Found - What am I Missing?
|
Jason Bodary
Greenhorn
Joined: Oct 20, 2009
Posts: 2
|
|
I am trying to specify the.. frame.setDefaultCloseOperation and it keeps telling me that the symbol frame can't be found. I have tired importing every package I could think of to no avail.
|
 |
John de Michele
Rancher
Joined: Mar 09, 2009
Posts: 600
|
|
Jason:
That error isn't telling you that you're not importing something, it's telling you that you haven't defined a symbol called 'frame'.
John.
|
 |
Srikkanth Mohanasundaram
Ranch Hand
Joined: Feb 07, 2007
Posts: 185
|
|
|
Please declare the variable in the main method.
|
 |
Jason Bodary
Greenhorn
Joined: Oct 20, 2009
Posts: 2
|
|
... what is there to declare or define? All I am trying to do is dictate how the frames close.
thus.. This is exactly how the java tutorial says to do it.. yet for me it throws an error on frame.
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
Jason Bodary wrote:... what is there to declare or define? [...]
Where do you declare "frame"?
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32672
|
|
|
Commonest reason for a "cannot find symbol" error message is a Tiny Spelling misstake, which is different from a tiny spelling mistake. Java recognises spelling and Spelling as different words.
|
 |
John de Michele
Rancher
Joined: Mar 09, 2009
Posts: 600
|
|
Jason:
Since you haven't declared a variable called 'frame' in your main() method, Java does not know what to do when you call frame.setDefaultCloseOperation(). You also are calling new FreelanceBillingUI() without assigning a name to it. Maybe this is where you were supposed to define 'frame'.
John.
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32672
|
|
|
The GUI builder in NetBeans is really nice. Until you try to understand the code and realise you have learned nothing about layouts. Don't use automatic GUI builders at the "beginning" stage.
|
 |
 |
|
|
subject: Symbol Not Found - What am I Missing?
|
|
|
|