cmrka
asked on
clicking on an applet?
I basically have a picture of the word "LOGIN" on a website... (asp, javascript, html)
I want this picture to change colors every few seconds... kinda like a rainbow effect...
So, I have applet code that will do this and works fine. The problem is that it is not clickable to get to a login page. Is there a way to make an applet picture clickable?
If not, is there another way to do this? Say with a timer?
Thank for your help.
This is some of my code:
<td colspan=1 align=center class="row2"><A HREF="dblogin.html">
<APPLET CODE="photoalbum.class" CODEBASE="PhotoAlbum" WIDTH=75 HEIGHT=24 align=right>
<PARAM name="developer" value="Demicron (www.demicron.se)">
<PARAM name="userinterface" value="standardui">
<PARAM name="standardui.maincolor " value="849EBD">
<PARAM name="standardui.usepauseb utton" value="no">
<PARAM name="standardui.innerbord erwidth" value="0">
<PARAM name="standardui.middlebor derwidth" value="0">
<PARAM name="standardui.outerbord erwidth" value="0">
<PARAM name="transtime" value="5000">
<PARAM name="timeout" value="12000">
<PARAM name="pause" value="5000">
<PARAM name="minframenr" value="0">
<PARAM name="bgcolor" value="849EBD">
<PARAM name="fxmod0" value="shatterfxmod">
<PARAM name="image0" value="PhotoAlbum/titleblo ck_loginbl ue.jpg">
<PARAM name="fxmod1" value="shatterfxmod">
<PARAM name="image1" value="PhotoAlbum/titleblo ck_loginpu rple.jpg">
<PARAM name="fxmod2" value="shatterfxmod">
<PARAM name="image2" value="PhotoAlbum/titleblo ck_loginre d.jpg"> heli
<PARAM name="fxmod3" value="shatterfxmod">
<PARAM name="image3" value="PhotoAlbum/titleblo ck_loginor ange.jpg"> wires
<A HREF="dblogin.html"></A></ APPLET>
</td>
I want this picture to change colors every few seconds... kinda like a rainbow effect...
So, I have applet code that will do this and works fine. The problem is that it is not clickable to get to a login page. Is there a way to make an applet picture clickable?
If not, is there another way to do this? Say with a timer?
Thank for your help.
This is some of my code:
<td colspan=1 align=center class="row2"><A HREF="dblogin.html">
<APPLET CODE="photoalbum.class" CODEBASE="PhotoAlbum" WIDTH=75 HEIGHT=24 align=right>
<PARAM name="developer" value="Demicron (www.demicron.se)">
<PARAM name="userinterface" value="standardui">
<PARAM name="standardui.maincolor
<PARAM name="standardui.usepauseb
<PARAM name="standardui.innerbord
<PARAM name="standardui.middlebor
<PARAM name="standardui.outerbord
<PARAM name="transtime" value="5000">
<PARAM name="timeout" value="12000">
<PARAM name="pause" value="5000">
<PARAM name="minframenr" value="0">
<PARAM name="bgcolor" value="849EBD">
<PARAM name="fxmod0" value="shatterfxmod">
<PARAM name="image0" value="PhotoAlbum/titleblo
<PARAM name="fxmod1" value="shatterfxmod">
<PARAM name="image1" value="PhotoAlbum/titleblo
<PARAM name="fxmod2" value="shatterfxmod">
<PARAM name="image2" value="PhotoAlbum/titleblo
<PARAM name="fxmod3" value="shatterfxmod">
<PARAM name="image3" value="PhotoAlbum/titleblo
<A HREF="dblogin.html"></A></
</td>
Hmm, thought I might as well do it and be sure we understand each other... The code should look like this :
<td colspan=1 align=center class="row2">
<A HREF="dblogin.html">
<APPLET CODE="photoalbum.class" CODEBASE="PhotoAlbum" WIDTH=75 HEIGHT=24 align=right>
<PARAM name="developer" value="Demicron (www.demicron.se)">
<PARAM name="userinterface" value="standardui">
<PARAM name="standardui.maincolor " value="849EBD">
<PARAM name="standardui.usepauseb utton" value="no">
<PARAM name="standardui.innerbord erwidth" value="0">
<PARAM name="standardui.middlebor derwidth" value="0">
<PARAM name="standardui.outerbord erwidth" value="0">
<PARAM name="transtime" value="5000">
<PARAM name="timeout" value="12000">
<PARAM name="pause" value="5000">
<PARAM name="minframenr" value="0">
<PARAM name="bgcolor" value="849EBD">
<PARAM name="fxmod0" value="shatterfxmod">
<PARAM name="image0" value="PhotoAlbum/titleblo ck_loginbl ue.jpg">
<PARAM name="fxmod1" value="shatterfxmod">
<PARAM name="image1" value="PhotoAlbum/titleblo ck_loginpu rple.jpg">
<PARAM name="fxmod2" value="shatterfxmod">
<PARAM name="image2" value="PhotoAlbum/titleblo ck_loginre d.jpg"> heli
<PARAM name="fxmod3" value="shatterfxmod">
<PARAM name="image3" value="PhotoAlbum/titleblo ck_loginor ange.jpg"> wires
</APPLET>
</A>
</td>
<td colspan=1 align=center class="row2">
<A HREF="dblogin.html">
<APPLET CODE="photoalbum.class" CODEBASE="PhotoAlbum" WIDTH=75 HEIGHT=24 align=right>
<PARAM name="developer" value="Demicron (www.demicron.se)">
<PARAM name="userinterface" value="standardui">
<PARAM name="standardui.maincolor
<PARAM name="standardui.usepauseb
<PARAM name="standardui.innerbord
<PARAM name="standardui.middlebor
<PARAM name="standardui.outerbord
<PARAM name="transtime" value="5000">
<PARAM name="timeout" value="12000">
<PARAM name="pause" value="5000">
<PARAM name="minframenr" value="0">
<PARAM name="bgcolor" value="849EBD">
<PARAM name="fxmod0" value="shatterfxmod">
<PARAM name="image0" value="PhotoAlbum/titleblo
<PARAM name="fxmod1" value="shatterfxmod">
<PARAM name="image1" value="PhotoAlbum/titleblo
<PARAM name="fxmod2" value="shatterfxmod">
<PARAM name="image2" value="PhotoAlbum/titleblo
<PARAM name="fxmod3" value="shatterfxmod">
<PARAM name="image3" value="PhotoAlbum/titleblo
</APPLET>
</A>
</td>
If that doesn't work (which it might not do, as I believe the applet will catch the mouse click event, and not the browser), you will need to add a mouse handler to your applet to catch the mouseclick, and redirect the page it is loaded on...
ASKER
No, this does not work... tried this already & tried it again...
Can you give me some example of the mouse click event code?
Thanks again..
Can you give me some example of the mouse click event code?
Thanks again..
In it's simplest form:
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.net.*;
public class Applet1 extends Applet
{
public boolean mouseDown( Event e, int x, int y )
{
try
{
getAppletContext().showDoc ument( new java.net.URL( "https://www.experts-exchange.com" ) ) ;
}
catch( MalformedURLException ex )
{
ex.printStackTrace() ;
}
return true ;
}
}
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.net.*;
public class Applet1 extends Applet
{
public boolean mouseDown( Event e, int x, int y )
{
try
{
getAppletContext().showDoc
}
catch( MalformedURLException ex )
{
ex.printStackTrace() ;
}
return true ;
}
}
ASKER
This may be a silly question, but I am a newbie at this...
Can I put this code directly in an asp page?
Do I have to do anything special?
Can I put this code directly in an asp page?
Do I have to do anything special?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ahh.. I see..
no, I don't have the source code for the applet..
I guess that option is out...
Thanks for the help anyway...
no, I don't have the source code for the applet..
I guess that option is out...
Thanks for the help anyway...
Awww...you didn't have to accept the answer (as I didn't really help you)
Good luck with it anyway!!
Tim
Good luck with it anyway!!
Tim
At the top of your code snippet, you open a link/anchor as such :
<td colspan=1 align=center class="row2"><A HREF="dblogin.html">
note the <A HREF="dblogin.html">
... then at the end of it all, you re-open the same tag (<A HREF="dblogin.html">) before closing it with a '</A>' The problem is, your tags aren't properly nested. Right now you have...
<td>
.......<A>
.............<APPLET>
..................<A>
..................</A>
.............</A>
........</APPLET>
</TD>
while it should be :
<td>
.......<A>
............<APPLET>
............</APPLET>
.......</A>
</td>
Re-work that and test, there's a lots of chance it will work.
Good luck