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
Solved

Hide and Show applet

Posted on 2006-07-03
14
576 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
  • 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
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.

 
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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Suggested Solutions

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

840 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