aspose file tools*
The moose likes Beginning Java and the fly likes Variable button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Variable button" Watch "Variable button" New topic
Author

Variable button

Kacper Szmigiel
Greenhorn

Joined: Sep 18, 2012
Posts: 24


I get "variable przycisk of type Object" in line 26, during compiling. Why?
Kacper Szmigiel
Greenhorn

Joined: Sep 18, 2012
Posts: 24
Sorry, bad button
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

Kacper Szmigiel wrote:
I get "variable przycisk of type Object" in line 26, during compiling. Why?


You get more than that. I'm going to take a guess that it's "undefined symbol." If so, then the error message is telling you exactly what's wrong, namely that you are trying to use a variable named przycisk but there is no such variable defined in that scope.

If that's not the rest of the error message, then please copy/paste the exact, complete message.

Also, note that line 26 of the code you posted is

which is unlikely to be giving that error.
Kacper Szmigiel
Greenhorn

Joined: Sep 18, 2012
Posts: 24
Oh yeah, my fault. It's about line 24, and the full text of error is:

error: cannot find symbol
przycisk.setText("Zostałem kliknięty");
symbol: variable przycisk
location: class ProstyGUI1


Also, I've compared example from Head First. Java. and my own code. And there's the diffrence:

In my code:



And in the example:



So does the way I will make JButton przycisk (as a component of class or as variable in method). It's all about the diffrence between local and global?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Variable button