wood burning stoves 2.0*
The moose likes Applets and the fly likes JMenuBar on the move Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "JMenuBar on the move" Watch "JMenuBar on the move" New topic
Author

JMenuBar on the move

colin shuker
Ranch Hand

Joined: Apr 11, 2005
Posts: 743
Hi,

I have an applet,
FotoCube
When it is first loaded, the File and Options menu are on the left of the menu bar.

When the applet is reloaded, they slide across to the centre of the JMenuBar, and reloading again makes them slide again.

Currently, I don't have any code in the init() method, and all the Menu stuff is done in the JApplet's constructor.

Is this were I'm going wrong, or perhaps I need a start() method, but I'm not sure how that works.

Thanks
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
The applet methods are called by the AppletContext/Appletviewer.
init is called on startup and only once. It is the place to put/initiate your construction code. start is called each time the applet is restored and is used for starting animation threads which are better left off when the applet is not active. This is considered well-mannered behavior.
When running the applet from the command line (with optional main method) you will have to make other arrangements to call the start and stop methods.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JMenuBar on the move
 
Similar Threads
jmenuitem..unseen
jmenuitem..unseen
Using Policy File
Run JApplet and no JMenuBar - Help!!
Dynamic Menus