Solved

Hide and Show applet

Posted on 2006-07-03
14
574 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
splitOdd10 challenge 5 105
firstswap challenge 20 77
micro services spring boot application error 3 187
Tomcat: Unable to run tomcat service. 2 18
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
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:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

776 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