This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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 ]
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?
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);.
Joined: Dec 10, 2001
Moving this to the Swing / JFC / AWT forum...
Joined: Apr 08, 2004
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