Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Problem running AWT code

 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the Swing / JFC / AWT forum...
 
John Dell'Oso
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
What a stench! Central nervous system shutting down. Save yourself tiny ad!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic