The Artima Developer Community
Sponsored Link

Java Answers Forum
Casting applet to JApplet

2 replies on 1 page. Most recent reply: Sep 5, 2003 8:16 AM by mausam

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Senthil

Posts: 1
Nickname: shawntil23
Registered: Sep, 2003

Casting applet to JApplet Posted: Sep 5, 2003 7:35 AM
Reply to this message Reply
Advertisement
Hi,

I have 2 applets in a webpage and I want applet2 to invoke a method in applet1. In applet2, I do the following:
appletContext().appletName(applet1_html_name) but I cannot cast this to applet1. Can someone help me out here...

thanks for any help

SK


mausam

Posts: 243
Nickname: mausam
Registered: Sep, 2003

Re: Casting applet to JApplet Posted: Sep 5, 2003 8:12 AM
Reply to this message Reply
I guess it shud be reverse....

casting of JApplet into Applet..
Hierarchy is as


java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--java.awt.Panel
|
+--java.applet.Applet
|
+--javax.swing.JApplet

mausam

Posts: 243
Nickname: mausam
Registered: Sep, 2003

Re: Casting applet to JApplet Posted: Sep 5, 2003 8:16 AM
Reply to this message Reply
if u created an instance of JApplet u can use

JApplet j = (JApplet)getAppletContext().getApplet(name)

Flat View: This topic has 2 replies on 1 page
Topic: Problems with Classpath, Packages and Imports Previous Topic   Next Topic Topic: getParameter returns null even though checkbox is checked!

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use