File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

"Syntax error on token 'list, VariableDeclaratorId expected after this token - Syntax error on

 
Andrew Sepulveda
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I am unsure of what to do. whenever i add it would get an error "Syntax error on token "list", VariableDeclaratorId expected after this token - Syntax error on". Also I would get another error, "Syntax error on token(s), misplaced construct(s)" Anybody willing to help?

It is suppose to be a simple GUI program as part of a game
 
John Jai
Rancher
Posts: 1776
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have placed the statements in the class body. The below statements should be moved to a method body.
 
Ove Lindström
Ranch Hand
Posts: 326
Android Firefox Browser Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John Jai wrote:You have placed the statements in the class body. The below statements should be moved to a method body.


Well... you should have a method that are called to build the ui when the constructor is called, that is correct.

But in this case, that is not the error, it is in the order that you have declared things.

Look at this:


You are using the variable pnl before it is declared. that is not possible. You need to create the Panel before you add anything to it. You can't draw on a paper that you don't have.
 
John Jai
Rancher
Posts: 1776
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ove Lindström wrote:You are using the variable pnl before it is declared. that is not possible. You need to create the Panel before you add anything to it. You can't draw on a paper that you don't have.

Nice catch...
 
Andrew Sepulveda
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry for the late reply, but thanks for the answers
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic