Java applet behave as button link?

Thread Solved

Join Date: Nov 2008
Posts: 6
Reputation: nopaso is an unknown quantity at this point 
Solved Threads: 0
nopaso nopaso is offline Offline
Newbie Poster

Java applet behave as button link?

 
0
  #1
Nov 8th, 2008
I was looking at this wobbly java applet and wanted to make it a link on my website, hot do I do that so it uses the "#Bottom" link to go to the bottom of the webpage its on:

http://www.javascriptkit.com/java/java13.shtml

I found this forum from that website, so I apologise in advance if Java is not covered here.

Thanks.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,178
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 481
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: Java applet behave as button link?

 
0
  #2
Nov 9th, 2008
This neither concerns Java or JavaScript, links are matter of HTML
Somewhere in your page you will place that applet into view surrounded by link tag as this
  1. <a href="#Bottom">APPLET_HERE</a>
and then somewhere in the document you place
  1. <a name="Bottom">Bottom</a>
indicate where is the bottom
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 6
Reputation: nopaso is an unknown quantity at this point 
Solved Threads: 0
nopaso nopaso is offline Offline
Newbie Poster

Re: Java applet behave as button link?

 
0
  #3
Nov 9th, 2008
That looks so simple, I can't believe I didn't think of that - the amount of searching I have done.

Thanks!
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 6
Reputation: nopaso is an unknown quantity at this point 
Solved Threads: 0
nopaso nopaso is offline Offline
Newbie Poster

Re: Java applet behave as button link?

 
0
  #4
Nov 11th, 2008
Oh dear, I know this was a one off, but while the trick does work in Safari - it does not in FF or IE.

Any suggestions?
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,178
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 481
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: Java applet behave as button link?

 
0
  #5
Nov 11th, 2008
Can you direct me to page you use it or provide coding to have look at?
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 6
Reputation: nopaso is an unknown quantity at this point 
Solved Threads: 0
nopaso nopaso is offline Offline
Newbie Poster

Re: Java applet behave as button link?

 
0
  #6
Nov 11th, 2008
Thanks. Sure its here:

http://lovelago.googlepages.com/java_button_2.html

I thought maybe (and have tried) to add the "#Bottom" as the link inside the java applet when using "mousePressed", but it didn't work. Somebody told me:

"I suspect: an object captures the mouse, so the click does not go to the <a> element in which you have embedded the object. I don't see any way around that, but you might be able to place a transparent click-catching-div in front of the object." -- but I don't want all tha MS lock-in stuff and its frontpage, which is old right?

It's annoying really, I was doing al my testing in Safari because its so clean and nice, I thik I've finished and try it in FF and it doesn't work!
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,178
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 481
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: Java applet behave as button link?

 
0
  #7
Nov 11th, 2008
You have problem with tags closing order and tags not being close at all. You start as
  1. <a href="#Bottom"> <div id="content">
  2. <div id="java_button_eg_container">
  3.  
  4. <object . . .
but you close as
  1. </object></a>
  2.  
  3. </object>
  4.  
  5. </div>
You forgot to close your first tag for object before opening the next one. You closing link tag before closing "div" tag and you never close the other div at all.
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 6
Reputation: nopaso is an unknown quantity at this point 
Solved Threads: 0
nopaso nopaso is offline Offline
Newbie Poster

Re: Java applet behave as button link?

 
0
  #8
Nov 11th, 2008
Thanks for your reply, I got the code as an output from the processing app I was using, I just added the #bottom anchor to it. I've counted the object openings and divs and it looks like there are enough, I think, so I count 1stDiv open, 2ndDiv open, 1stObject open, 2ndObject open, 1stObject close, 2ndObject close, 1stDiv close, 2ndDiv close.

I've never had a problem with the processing output code before, I tried closing an object before opening another but it did not make any difference. I also tried adding two #bottom links for those object beginnings but that didn't work either.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 6
Reputation: nopaso is an unknown quantity at this point 
Solved Threads: 0
nopaso nopaso is offline Offline
Newbie Poster

Re: Java applet behave as button link?

 
0
  #9
Nov 26th, 2008
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the HTML and CSS Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC