Solved

Hide and Show applet

Posted on 2006-07-03
14
577 Views
Last Modified: 2009-12-16
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?
0
Comment
Question by:Phoebe_Yi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +2
14 Comments
 
LVL 92

Accepted Solution

by:
objects earned 43 total points
ID: 17034906
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
 

Author Comment

by:Phoebe_Yi
ID: 17035172
Anyone know how to hide and show an applet when there are incoming msgs, assume the applet is an chat applet.
0
 
LVL 92

Expert Comment

by:objects
ID: 17035181
you can just show/hide the applet panel using setVisible()
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 35

Expert Comment

by:girionis
ID: 17035234
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
 
LVL 8

Assisted Solution

by:colr__
colr__ earned 41 total points
ID: 17035508
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
 
LVL 26

Expert Comment

by:ksivananth
ID: 17040636
I think, setVisisble() method will work for you and u can call this method by javascript.
0
 

Author Comment

by:Phoebe_Yi
ID: 17040802
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
 

Author Comment

by:Phoebe_Yi
ID: 17040809
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
 
LVL 92

Expert Comment

by:objects
ID: 17040902
0
 
LVL 8

Expert Comment

by:colr__
ID: 17041074
The code I've posted above does exactly this.
0
 
LVL 35

Assisted Solution

by:girionis
girionis earned 41 total points
ID: 17041223
> 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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question