• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Symbol Not Found - What am I Missing?

 
Jason Bodary
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 600
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 243
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please declare the variable in the main method.
 
Jason Bodary
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
... 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
Pie
Posts: 20559
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jason Bodary wrote:... what is there to declare or define? [...]

Where do you declare "frame"?
 
Campbell Ritchie
Sheriff
Pie
Posts: 49472
64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 600
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 49472
64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic