wood burning stoves*
The moose likes Swing / AWT / SWT and the fly likes Problem running AWT code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Problem running AWT code" Watch "Problem running AWT code" New topic
Author

Problem running AWT code

John Dell'Oso
Ranch Hand

Joined: Apr 08, 2004
Posts: 130
Hi,
I am having problems getting this code to run. It compiles fine, but when I run it as an application it doesn't do anything (and there are no errors). If I run this from within the Eclipse IDE as a JavaBean it works fine. If I try to run it as a java app. it just doesn't show anything. Any ideas as to what the problem may be would be appreciated.

Regards,
WC
[ edited to preserve formatting using the [code] and [/code] UBB tags -ds ]
[ April 08, 2004: Message edited by: Dirk Schreckmann ]
[ April 08, 2004: Message edited by: Wayne Carey ]
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Welcome to JavaRanch, Wayne!
The code you've posted does not compile.
It's difficult to help you with runtime issues when the example code won't even compile.
Do you need help with the compiler errors?


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
After fixing the compiler errors, it becomes apparent that you forgot (or didn't know) to make the frame visible.
Take a look at this adjusted code.Notice that extra line in the main method, tawt.setVisible(true);.
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Moving this to the Swing / JFC / AWT forum...
John Dell'Oso
Ranch Hand

Joined: Apr 08, 2004
Posts: 130
Thanks for that Dirk. Yes, that was an oversight on my part with setVisible. Sorry about the code not compiling. I must have done something whilst editing the post. Thanks for moving my post to the relevant topic area as well.
Regards,
WC
 
 
subject: Problem running AWT code