File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Leonidas Savvides
Ranch Hand
Posts: 403
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
may you guess where error I get stop/start animation



 
Hunter McMillen
Ranch Hand
Posts: 492
Firefox Browser Linux VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
fred rosenberger
lowercase baba
Bartender
Pie
Posts: 12015
24
Chrome Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47216
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As well as public private and protected being prohibited inside methods, why are you not marking all your fields private?
 
Leonidas Savvides
Ranch Hand
Posts: 403
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic