• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Trouble creating a stand alone window

 
trish mo
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • 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

 
prem pillai
Ranch Hand
Posts: 87
Java Opera
  • Mark post as helpful
  • send pies
  • 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
  • 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
Java Opera
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
My bad ! Of course it works...thanks a lot !
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic