Web Analytics Made Easy -
StatCounter Change Java with a button - CodingForum

Announcement

Collapse
No announcement yet.

Change Java with a button

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Change Java with a button

    What i am intending on doing is having two buttons and java applet. I want to have it so when you click a button it changes to another applet, and then when you click the other button, it goes to the original appet. how would i do this?

  • #2
    Not sure this gonna work but give it a go.

    PHP Code:
    <div id="applet1">
    <
    applet code="applet1.class"></applet>
    </
    div>
    <
    div id="applet2" style="display:none">
    <
    applet code="applet2.class"></applet>
    </
    div>
    <
    input type="button" value="Show Applet 1" onclick="document.getElementByID('applet1').style.display='block';document.getElementByID('applet2').style.display='none';">
    <
    input type="button" value="Show Applet 2" onclick="document.getElementByID('applet1').style.display='none';document.getElementByID('applet2').style.display='block';"
    Let me know how it goes
    so happy, so cool

    http://coolersport.info

    Comment


    • #3
      there seems to be problems with the script

      http://pageofrage.t35.com/sandgames.php

      its not working on opera or internet explorer.

      Code:
      <div id="applet1">
      <applet code="Falling_Sand_Game" width=520 height=460 archive="fsg_small.mp3"></applet>
      </div>
      <div id="applet2"  style="display:none">
      <applet code="HellOfSand" width=520 height=460 archive="HellOfSand.jar"></applet>
      </div>
      <input type="button" value="Pyro Sand" onclick="document.getElementByID('applet1').style.display='block';document.getElementByID('applet2').style.display='none';">
      <input type="button" value="Hell of Sand" onclick="document.getElementByID('applet1').style.display='none';document.getElementByID('applet2').style.display='block';">
      Last edited by Alphamonkey; Sep 28, 2006, 08:22 PM.

      Comment


      • #4
        plz help someone

        Comment

        Working...
        X