• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Trouble creating a stand alone window

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have written the following program to create a stand alone window. I am extending frame class & creating an instance of it inside main. A window appears, however, it shows "Applet not initialised" in status bar, it goes without saying that none of the events that I have taken care of in the program, are working

 
Ranch Hand
Posts: 87
Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How are you trying to run it? I tried running it and its running ....


This code has many basic problems; not following proper naming convensions/coding practices, dont have a way to exit the frame etc ..
Go through this tutorial and understand the basics of swing ..http://download.oracle.com/javase/tutorial/uiswing/
 
trish mo
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My apologies for not having followed conventions but this was merely written to test my own understanding.

I ran the code using appletviewer & as I have mentioned before, the applet remains uninitialised & so the event handling code remains untouched. When you mention running, do you mean that mouse events are being handled etc or just the window appearing ?
 
prem pillai
Ranch Hand
Posts: 87
Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Appletviewer is for running applets. What you have coded is not an applet!! but just an AWT frame. So you can just run it using standard java command.

trish mo wrote:When you mention running, do you mean that mouse events are being handled etc or just the window appearing ?


Your program prints mouse movement coordinates .... so just try it running
 
trish mo
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My bad ! Of course it works...thanks a lot !
reply
    Bookmark Topic Watch Topic
  • New Topic