This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes may you guess where error I get: script: stop/start animation image Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "may you guess where error I get: script: stop/start animation image" Watch "may you guess where error I get: script: stop/start animation image" New topic
Author

may you guess where error I get: script: stop/start animation image

Leonidas Savvides
Ranch Hand

Joined: Jan 31, 2010
Posts: 403
may you guess where error I get stop/start animation



Hunter McMillen
Ranch Hand

Joined: Mar 13, 2009
Posts: 492

I don't think you are allowed to have access modifiers inside the main method. I am not completely sure about that. But I just did a small test:



And got these compile errors:
TestPublic.java:5: illegal start of expression
public int FIVE = 5;
^
TestPublic.java:6: illegal start of expression
private int SIX = 6;
^
TestPublic.java:7: illegal start of expression
protected int SEVEN = 7;


Based off that id say the access modifiers are a no-no in the main method.

Hunter

"If the facts don't fit the theory, get new facts" --Albert Einstein
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11153
    
  16

My guess is you don't want that 'public' before you declare those method variables. Or, you want to move the declaration outside of the main() method.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37933
    
  22
As well as public private and protected being prohibited inside methods, why are you not marking all your fields private?
Leonidas Savvides
Ranch Hand

Joined: Jan 31, 2010
Posts: 403
I post a new ver here: http://www.coderanch.com/t/503190/java/java/well-did-as-below-but

but I get no errors[run or compile] but no appear the stop/start buttons ONLY the ani img well?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: may you guess where error I get: script: stop/start animation image
 
Similar Threads
Too many ActionEvents after button press.
well did as below but BUTTONS NOT Appear only the image plays continuesly, well
Why does this Swing (JApplet ) mp3 audio applet not compile!
Problem with BorderLayout
Images don't appear in Swing code