File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes netbeans 7.1 errors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "netbeans 7.1 errors" Watch "netbeans 7.1 errors" New topic
Author

netbeans 7.1 errors

Adrian Jakubas
Greenhorn

Joined: Aug 17, 2011
Posts: 3
I'm new to programming so any help would be appreciated

it says "illegal start of expression, identifier expected"
now I don't know if it is anactual Nerbeans problem or not buy here's my code:


Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3649
    
  17

Hi Adrian, welcome to CodeRanch.

Your code starts with public static void main(String[] args) {

I don't think you intended that.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39834
    
  28
Welcome to the Ranch

"Illegal start ..." errors usually mean you have too many { or too few }.

If you are using an IDE like NetBeans, doesn't it insert whole pairs of {}? In which case you can put your mouse inside the pair {*} and put the contents of the method there.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39834
    
  28
Adding code tags shows your code to be very badly indented, and, as Stephan has told you, the method heading before the import declarations. If you move that to inside the class, you can probably persuade NetBeans to format and indent your code correctly, and you can try again.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39834
    
  28
Did you copy the code by hand? There are other errors, eg JTectField instead of JTextField.
Adrian Jakubas
Greenhorn

Joined: Aug 17, 2011
Posts: 3
Adrian Jakubas wrote:I'm new to programming so any help would be appreciated

it says "illegal start of expression, identifier expected"
now I don't know if it is anactual Nerbeans problem or not buy here's my code:


Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39834
    
  28
. . . and??
We have already made useful suggestions.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: netbeans 7.1 errors