Java Applet executed by OnClick event


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Java Applet executed by OnClick event

  1. #1
    Join Date
    Apr 2005
    Posts
    3

    Question Java Applet executed by OnClick event

    I have the following applet:

    <applet archive="truemotion_debug.jar"
    code="On2.VPXDecoderApplet.class" height="240" width="320">
    <param name="EndImage" value="IMG_4763.jpg">
    <param name="InputFileName" value="new.avi">
    <param name="Seconds" value="50,20">
    <param name="SoundSystem" value="JSND">
    <param name="StartImage" value="IMG_4763.jpg">
    <param name="TimeOut" value="10000">
    <param name="JumpToURL" value="http://www.on2.com/sdks.php3">
    </applet>

    It streams a video using On2. The problem is that I want this applet to be executed after the user clicks on a particular pic. At the moment the applet is executed automatically when the page is loaded. How can I change that? Can somebody give me an advice? I will be very grateful...

  2. #2
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    1,560
    Since I haven't got the code for this I can only guess what needs to be done;
    How about making the applet implement the mouseListener interface and add it
    as a mouse listener to whatever component you use for displaying the image, and
    start the streaming in the mousePressed() calback method in the applet.

    But, this is only an option if you have the source code.
    Last edited by sjalle; 04-05-2005 at 11:03 AM.

  3. #3
    Join Date
    Apr 2005
    Posts
    3
    To sjalle: Thank you for your quick respond. What exactly is mouseListener interface ? I have some experience only with PHP and all this is totally new for me...

  4. #4
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    1,560
    In short; its how you code to make your java program respond to mouse-events
    like press, release, click. The listener concept is an integral part of the java GUI,
    and the mouseListener is just one of many listener types.

  5. #5
    Join Date
    Apr 2005
    Posts
    3
    To sjalle: Thank you once again. I found some resources from which I can learn more about listener. I hope I'll find a solution after a little digging.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center