Hide and Show applet

May I know is there any method to hide and show an applet in JSP? by using Javascript or any other method to achieve this?
Phoebe_YiAsked:
Who is Participating?
 
objectsConnect With a Mentor Commented:
obvious method would bt reload the page iwth/without the applet tag.

Javascript you should be able to do similiar, haven't tried it in practice though.
0
 
Phoebe_YiAuthor Commented:
Anyone know how to hide and show an applet when there are incoming msgs, assume the applet is an chat applet.
0
 
objectsCommented:
you can just show/hide the applet panel using setVisible()
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
girionisCommented:
Phoebe_Yi,

> Anyone know how to hide and show an applet when there are incoming
> msgs, assume the applet is an chat applet.

You could use a <div> tag and show hide the applet code. This solution is similar to dynamically showing/hiding text, although I am not sure if this will work in applets, since the applet tag will be there and therefore it will be loaded. Give it a try and see if it works.
0
 
colr__Connect With a Mentor Commented:
Use this, wrap the applet tag in a div:

<div id="theApplet" style="visibility:hidden;">
<applet></applet>
</div>

And use the following javascript to hide/show it:

function hideApplet(){
document.getElementByID("therApplet").style.visibility = "show";
}

function showApplet(){
document.getElementByID("therApplet").style.visibility = "hidden";
}
0
 
ksivananthCommented:
I think, setVisisble() method will work for you and u can call this method by javascript.
0
 
Phoebe_YiAuthor Commented:
if I want to hide/show the div when there is new incoming msg which is controlled by the applet. how can i access it?
0
 
Phoebe_YiAuthor Commented:
let me explain in detail. let say I have a div and applet in jsp. the visibility of the div is controlled by the applet. When there is new incoming msg, the applet need change the visibility of the div to visible.
0
 
objectsCommented:
0
 
colr__Commented:
The code I've posted above does exactly this.
0
 
girionisConnect With a Mentor Commented:
> if I want to hide/show the div when there is new incoming msg which is controlled by the applet. how can i access it?

http://www.codestore.net/store.nsf/unid/DOMM-4UTFCP?OpenDocument
http://www.apl.jhu.edu/~hall/java/JavaScript-from-Java.html
http://www.modernminds.com/Info/UBB2/Doc/JSFromApplet.html
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.