This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Trouble creating a stand alone window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Trouble creating a stand alone window" Watch "Trouble creating a stand alone window" New topic
Author

Trouble creating a stand alone window

trish mo
Greenhorn

Joined: Feb 24, 2011
Posts: 14
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

Joined: Nov 02, 2007
Posts: 87

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

Joined: Feb 24, 2011
Posts: 14
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

Joined: Nov 02, 2007
Posts: 87

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

Joined: Feb 24, 2011
Posts: 14
My bad ! Of course it works...thanks a lot !
 
Don't get me started about those stupid light bulbs.
 
subject: Trouble creating a stand alone window
 
Similar Threads
MouseMotionListener
can't figure it out
TextField Population of Mouse Events?
i'm getting an error start:applet not intialized.
Hey ranchers...a lil help here plz