Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > HELP !!! I am really frustrated

Reply
Thread Tools

HELP !!! I am really frustrated

 
 
Bill C
Guest
Posts: n/a
 
      09-08-2003
Hi, I cannot figure out
what is wrong with this simple code.

I get "illegal start of type" as an error and "identifier expected" as
a second error with the file called SimpleGui5.java
as:
import javax.swing.*;
import java.awt.*;
import java.awt.event.


public class SimpleGui5 {




public static void main (String[] args) {

JFrame frame = new JFrame();

JButton button = new JButton("click HERE");

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOS E);

frame.getContentPane().add(button);

frame.setSize(300,300);

frame.setVisible(true);

}
)




But I don't get an error with the file called TwoButtons.java as:

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;


public class TwoButtons {



public static void main (String[] args) {
JFrame frame = new JFrame();

JButton button = new JButton("click HERE");

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOS E);

frame.getContentPane().add(button);

frame.setSize(300,300);

frame.setVisible(true);
}


}



WHY??? Am I blind?? Thank you!!!!
 
Reply With Quote
 
 
 
 
Thomas Kellerer
Guest
Posts: n/a
 
      09-08-2003
That should be

import java.awt.event.*;

Thomas


Bill C schrieb:

> Hi, I cannot figure out
> what is wrong with this simple code.
>
> I get "illegal start of type" as an error and "identifier expected" as
> a second error with the file called SimpleGui5.java
> as:
> import javax.swing.*;
> import java.awt.*;
> import java.awt.event.
>
>
> public class SimpleGui5 {
>
>
>
>
> public static void main (String[] args) {
>
> JFrame frame = new JFrame();
>
> JButton button = new JButton("click HERE");
>
> frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOS E);
>
> frame.getContentPane().add(button);
>
> frame.setSize(300,300);
>
> frame.setVisible(true);
>
> }
> )
>
>
>
>
> But I don't get an error with the file called TwoButtons.java as:
>
> import javax.swing.*;
> import java.awt.*;
> import java.awt.event.*;
>
>
> public class TwoButtons {
>
>
>
> public static void main (String[] args) {
> JFrame frame = new JFrame();
>
> JButton button = new JButton("click HERE");
>
> frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOS E);
>
> frame.getContentPane().add(button);
>
> frame.setSize(300,300);
>
> frame.setVisible(true);
> }
>
>
> }
>
>
>
> WHY??? Am I blind?? Thank you!!!!


 
Reply With Quote
 
 
 
 
Ryan Stewart
Guest
Posts: n/a
 
      09-08-2003
(Bill C) wrote in message news:< om>...
> Hi, I cannot figure out
> what is wrong with this simple code.
>
> I get "illegal start of type" as an error and "identifier expected" as
> a second error with the file called SimpleGui5.java
> as:
> import javax.swing.*;
> import java.awt.*;
> import java.awt.event.

^^^
Notice something missing?

*snip the rest*
 
Reply With Quote
 
Y2KYZFR1
Guest
Posts: n/a
 
      09-08-2003
(Bill C) wrote in message
>
> WHY??? Am I blind?? Thank you!!!!


yes you are blind, get a good syntax checking IDE, you are welcome.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I really need help with this so if anyone can help me out that wouldbe really great of you. adityagaddam90@gmail.com Java 30 02-10-2008 11:29 PM
Frustrated, please help! arickyf33 Computer Support 0 01-02-2005 11:37 PM
Getting VERY frustrated - somebody help..............Please defacto DVD Video 2 11-15-2004 03:23 PM
Frustrated with this network setup, Can Anyone Help? =?Utf-8?B?TUo=?= Wireless Networking 2 11-09-2004 02:43 AM
Unable to Run ANY ASP.NET Samples :: REALLY Frustrated! Don Wash ASP .Net 10 07-21-2004 04:32 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57