File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Applets and the fly likes Please Help me with Applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Groovy Fundamentals video training course this week in the Groovy forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Please Help me with Applet" Watch "Please Help me with Applet" New topic

Please Help me with Applet

Rodrigo Cruz

Joined: Jul 29, 2003
Posts: 1
How can I insert a Panel in my Applet??? I know just one method that is add(), but it doesn�t work out of init() and i need to call this Panel out of init method. Someone in the world know how i can do it???
Matthew Orral

Joined: Jul 27, 2003
Posts: 11
you can do this with getContentPane().add(new JPanel(...))
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24189

Matthew's advice is correct for JApplet, which is a Swing-based version of Applet that works only in the Java plug-in.
If you're talking about plain Applets, then why not show us the code that you tried, and be a bit more specific than "it doesn't work" (because "it" should indeed work fine) and maybe we can help.

[Jess in Action][AskingGoodQuestions]
Matthew Orral

Joined: Jul 27, 2003
Posts: 11
Sorry, i was thinking of my own swing applet .With awt this.add(Component) must work.
P.D :Swing (JApplet,etc...) works well also without java plugin.
What about swt (Eclipse)? i've read it's the most efficient ui toolkit with still some portability problems...
[ July 30, 2003: Message edited by: Matthew Orral ]
I agree. Here's the link:
subject: Please Help me with Applet