How to use Flash buttons/animation in a Swing/Applet?

Hello,
I want to use flash button as like as JButton that we use in Swing/ Applet. How can I do So?
Please help me.
Thanks-

[http://java.sun.com/docs/books/tutorial/uiswing/misc/timer.html]
Or maybe just...
import java.awt.*;
import java.net.*;
import javax.swing.*;
public class Blinky {
    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable(){
            public void run() {
                URL url = null;
                try {
                    url = new URL("http://www.gifanimations.com/GA/image/animations/bodyparts/eyes/eye-01.gif");
                } catch (MalformedURLException e) {
                    throw new RuntimeException(e);
                JFrame f = new JFrame("Blinky");
                f.getContentPane().add(new JButton(new ImageIcon(url)));
                f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                f.pack();
                f.setLocationRelativeTo(null);
                f.setVisible(true);
}

Similar Messages

  • Do you know how to use Flash? can you help?

    hi all,
    Do you know how to use Flash?
    I have been trying for months to find someone who can use
    flash, who can help me, with no luck.
    I need my links on my website updating, just a couple of them
    need the text changing as i need
    to change the name/title of some pages. I have tried to do it
    myself (using a trial version of flash,
    as i dont have flash). the site was made using dreamweaver.
    the files are .FLA
    and before anyone says 'get the person who made the site to
    do it'....He wont, ive tried.
    when i tried to change them myself i cocked them up and now
    they dont work at all, see my
    website and you will see; www.stevenallenphotography.co.uk
    so, if you can use flash please can you help me? all i need
    doing is the file updating with some
    of the link titles/names changing, i.e. one link is
    'exhibitions' which needs changing to 'published work',
    please get in touch if you can help.
    thanks,
    steven.

    I used divx in my site once its really very nice! but i use it in different host not .mac...try this divx web player with video selector code --------<object id="ie_plugin" classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616"
    width="640" height="480"
    codebase="http://go.divx.com/plugin/DivXBrowserPlugin.cab">
    <embed id="np_plugin" type="video/divx"
    width="640" height="480"
    pluginspage="http://go.divx.com/plugin/download/">
    </embed>
    </object>
    <script type="text/javascript">
    // This code detects which browser we are
    // running into (IE or others) and assigns
    // the correct element (object or embed) to
    // the "plugin" variable, that we will use.
    var plugin;
    if(navigator.userAgent.indexOf('MSIE') != -1)
    plugin = document.getElementById('ie_plugin');
    else
    plugin = document.getElementById('np_plugin');
    // This is a local JS function used by our form
    // element to call the plugin functions using
    // the "plugin" variable that we defined above
    function openNewMovie()
    var url = document.forms['videoSelector'].movie.value;
    if(url != '')
    plugin.Open(url);
    </script><form name="videoSelector">
    Choose a video to play:
    <select name="movie" onChange="javascript:openNewMovie();">
    <option value="" selected>Video Selector
    <option value="http://www.yourdomain.com/folderdivx/name.divx">title1 divx
    <option value="http://www.yourdomain.com/folderdivx/name.divx">title2 divx
    </select>
    </form> ---------------------
    Hope this help!

  • IPAQ how to use hardware buttons in java

    Hi,
    Does anyone know how to be able to use the iPAQs harware buttons and joystick in Suns Personal Java?
    I moved a Tetris applet i have written for PC's to the iPAQ and it works except for the arrow keys that i use to control it with.
    Any help would be greatly appreciated!

    I have the same problem.
    Does anyone know how to use the buttons of the iPAQ for your java applications?
    Thanks
    Hector

  • How to use Flash Builder  for Eclipse Luna ( is it possible??)

    How to use Flash Builder  for Eclipse Luna ( is it possible??)

    Yes. I have Flash Builder 4.6 and 4.7 running in different Eclipse Luna installs.
    More details at http://forums.adobe.com/message/4527443
    On Mac, I had to have the 32bit version of Luna for 4.6, and the 64bit version of Luna for 4.7 (and  I recently started using  4.7 with Eclipse Mars).
    For 4.6 you need to first download Eclipse 3.6 and install the Flash Builder 4.6 plugin to that Eclipse install. For 4.7 you need to download Eclipse 3.7 and install the plugin to that Eclipse install. Once it's installed in the 3.x version, you can then copy the fb*.link files from the Eclipse 3.x dropins folders into your Eclipse Luna's dropin folder.
    There is an issue where something in Flash Builder 4.7 won't work right when using it as a plugin, not sure but it might be something with building ANEs.

  • How to use one button rollover symbol to create 100 graphically different buttons

    I do know how to create a button rollover symbol.
    I don't know how to make that button rollover symbol reuseable. I'd like to put 100 different images in 100 copies of the button. I'd rather not make new symbols for every button, since the rollover animation may change.
    Symbol "Accessibility" allows the title to be changed for copies of the symbol. Does similar functionality exist for bitmaps used in the symbol?
    Could the copied button bring in new graphics from the timeline in another symbol or a xml sheet?
    Any help would be greatly appreciated. I've been following tutorials, except none of them cover this situation.
    Thanks for your help!

    Created in EA version 3:
    I have 2 samples for you that are very similar.
    1- uses the symbol with no image and loads the image as a background-image for the div.
    https://app.box.com/s/co7uki3fm3b11a3o1xjw
    2- uses an image in the symbol and replaces this image with a new one in the img (not div)
    https://app.box.com/s/3ms92f5cv0mylspsi5uo
    Choose what you prefer.
    3. An example with more elements in the symbol directly on the stage instead of a container. use a container if you want to place the symbols in a specific rectangle div for example.
    https://app.box.com/s/y92bpo82kncxnn2w567y

  • How to use Flash to create an interactive diagram

    Hi all.
    I am an extreme newbie. I would like to create an interactive diagram and somebody said I should use Flash to do it.
    The idea is to create an organisational chart (like the ones you can produce in MS Word 2010). Each position will have its own box or button. When a user clicks on that box or button, a Word document or internet link will be activated and take the user to this other resource.
    Is it possible to do this in Flash?
    The reason why I am choosing Flash is because I would like to make alot of these diagrams and they have to go into Moodle. Apparently Flash is the only program I should use to import the diagram into Moodle.
    Can anybody please help me with some advice on how to do this?
    Thanks
    Sharyn

    For the diagram end of things... start by creating the diagram in Flash.  Whatever you intend to use as clickable items, create them as movieclip symbols so that you will be able to assign instance names to them.  You assign instance names by selecting the object on the stage and entering a unique name in the Properties panel where it says <Instance Name>.  That name will be used in the code you will use to create the clicking/linking functionality.
    The the linking end of things, start simple... create a diagram that has just one item to click and get that one item working.  What you learn from that can be applied to the larger version.  The same as stated in the first paragraph applies.  The only additional info you need is creating the actual code.  To help with that you need to decide which version of Actionscript you will be using, which might depend on which version of Flash you are using.  AS3 is the most recent version of Actionscript, and it first came into being back with Flash CS3.
    The first thing you need to do to make a movieclip useful code-wise is to assign it a unique instance name.  So you drag a copy of it out to the stage from the library, and while it's still selected, you enter that unique instance name for it in the Properties panel... let's say you name it "btn1"
    In AS3, to make a movieclip work with code, you need to add an event listener and event handler function for it.  You might need to add a few (for different events, like rollover, rollout, clicking it, but for now we'll just say you want to be able to click it to get a web page to open.  In the timeline that holds that button, in a separate actions layer that you create, in a frame numbered the same as where that button exists, you would add the event listener:
    btn1.addEventListener(MouseEvent.CLICK, btn1Click);
    The name of the unique function for processing the clicking of that button is specified at the end of the event listener assignment, so now you just have to write that function out:
    function btn1Click(evt:MouseEvent):void {
       var url:String = "http://www.awebsite.com/awebpage.html";
       var req:URLRequest = new URLRequest(url);
       navigateToURL(req);

  • How to use Sprites in animation.

    Umm hi I would like some help on how to use sprites (8 or 16
    bit characters from games) to make an animation could any one
    provide me a link to any sprites animation or a link on how to do
    it. It will help much.
    Mr.Idiot

    if you have Flash, this is one of the main things that it
    does. open up your help file documentation, and start reading at
    the beginning, it will tell you all you need to know and introduce
    you to the basic concepts of the program.

  • How to use single button for different operations

    Hi
    I am using one button with image having 4 controls like left right up and down...
    How to use the single button for 4 different operations??
    Is there any way of defining hotspots on single button to do four different operations...
    Please have a look at the attached image, u can understand my problem better...
    Please let me know ASAP...
    Thanks and Regards
    Aruna.S.N.

    Here ya go:
    http://code.google.com/p/flexlib/wiki/ComponentList
    If this post answers your question or helps, please mark it as such.

  • How to use one button to drive another button click

    I'm trying to figure out a way to fix a bug in my application.  The simple fix would be to have a single button that drives a MouseCLICK event on another button everytime the PlayBar in my application reaches the end of the screen and returns to its origin.
    How would I achieve this?  I have made a lot of headway since I last posted a question in the ActionScript 3 forum, which was only yesterday evening.
    Thanks in advance,
    markerline

    The application is an audio application.  It is like a drum machine sort of.
    Currently there is a grid and whenever active cells get hitTest'ed by the PlayBar they become deactivated, the PlayBar returns to the origin, and when you relaunch the Play functionality the deactivated cells no longer play a sound.
    I have a button which reactivates the sounds.
    I also have a button which has a bug in it that loops the sounds. 
    To go around the looper button that has a bug in it I would like to use a Button "Z" which automatically clicks the "reactivate the sounds" button every time the PlayBar returns to the origin and the PlayBar will then continue to play and return to the origin in a looping fashion.  If the Button Z is in an active state this looping will continue.  To stop looping, click the Button Z until it is no longer in an active state and the PlayBar will then remain at the origin.

  • Need help using flash buttons

    Can anyone help me with flash buttons? I am trying to build
    my first website, and my five flash buttons (inside a 5 col. table)
    for page navigation work fine in testing all 5 web pages with
    mozilla firefox, and they look the same on the index page when
    testing with IE-7. However when I begin navigating to other pages
    in IE-7, the flash buttons disappear, and the 5 cols in the table
    where each flash button was placed now are not equal sizes anymore
    like they are on the index page. In my files area on the right, I
    notice 3 out of the five buttons I created have about 15 to 20
    "generations" shown there, with numbers 1 through 15 or even more
    to qualify them tacked on to the end of the names. Where do these
    come from, and why are 2 out of the five only have 1 "generation"
    each? I never expected this, and I think it has something to do
    with the problem, but maybe not. Please help me if you can!

    If you want to use Flash for navigation, consider this -
    1. Some people don't have Flash installed - what do they do?
    2. Search engines don't parse Flash links - your site will
    not be spidered
    3. Screen assistive devices don't parse Flash links - what
    will those users
    do?
    4. DW cannot maintain links within a Flash movie, so if you
    move or rename
    a linked file, your navigation will break - what will you do?
    It's usually a very bad idea for these reasons...
    Your problem is caused by navigating away from the previewed
    page. In
    general, this is not a good thing to do, since root relative
    links will not
    work as expected when you do that (locally).
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "dreamnovice" <[email protected]> wrote in
    message
    news:[email protected]...
    > Can anyone help me with flash buttons? I am trying to
    build my first
    > website,
    > and my five flash buttons (inside a 5 col. table) for
    page navigation work
    > fine
    > in testing all 5 web pages with mozilla firefox, and
    they look the same on
    > the
    > index page when testing with IE-7. However when I begin
    navigating to
    > other
    > pages in IE-7, the flash buttons disappear, and the 5
    cols in the table
    > where
    > each flash button was placed now are not equal sizes
    anymore like they are
    > on
    > the index page. In my files area on the right, I notice
    3 out of the five
    > buttons I created have about 15 to 20 "generations"
    shown there, with
    > numbers 1
    > through 15 or even more to qualify them tacked on to the
    end of the names.
    > Where do these come from, and why are 2 out of the five
    only have 1
    > "generation" each? I never expected this, and I think it
    has something to
    > do
    > with the problem, but maybe not. Please help me if you
    can!
    >

  • How to use a button in a required field

    Hi,
    this is my scenario:
    1) In a Form I have two Blocks
    2) In the first, I use a text Item for the customer code, with the required property set to true and with a trigger WHEN-VALIDATE-ITEM
    3) In the second block, I use a button that call the 'show_lov' function in order to display the list of the customers.
    If the focus is out of the first block, I can use the button without problems.
    If the focus is on the customer code Item and I try to use the serch button, the alert message "Field required" is displayed and I don't be able to use the function in the button.
    Exist a method in order to use my button when the focus is in the required customer item?
    If Yes, how can perform this ?
    I hope...
    Best Regards
    Gaetano

    When you set Required = Yes, you're telling Forms not to allow the user to navigate away from the item until they enter a required value. That's the way Forms is designed.
    If you don't like that behavior (and I'm one that doesn't), I rarely use Required = Yes. Instead, I write the code to check for a required value in the PRE-COMMIT trigger. If the item doesn't have a value, I set focus to the item, and then issue a RAISE Form_Trigger_Failure.
    I'm sure there are other ways to do this, but that is just one technique.

  • How to use Flash Lite 2.1 as ActiveX component in WM application

    How to embed Flash lite 2.1 as an ActiveX component in
    Windows Mobile application(in C#)?
    From where can i include the supporting flash lite 2.1 dll's.
    Thanks in advance.
    Waiting for your reply.

    I'm having a similar (or the same) problem: I want to embed a
    flash lite (2.0) as an ActiveX component into Windows Mobile. I'm
    using Visual Studio 2005 (VC). For the desktop it works pretty
    well, but for the mobile emulator, the flash component shows no
    video. No errors are thrown.
    could you solve your problem, kts_82?
    Thank you.

  • How to use flash in video FX

    can anyone please explain to me very slllooowwwly on how you use the flash in video fx,looks great but I can't seem to get it the right spot, and then it converts the whole scene with flashes whilst I just want one flash at the particular time................thanks

    On my machine it's simply picking up Flash, Java (openJDK), and Mplayer plug-in, from the Mozilla directories:
    /usr/lib/mozilla/plugins & ~/<user>/.mozilla/plugins. The latter only for nspluginwrapper.

  • How to use customised buttons in the menus

    Hi John,
    In the forms menus i have seen some customised buttons in some of the wrkforce forms. I would ike to knw how to enable these buttons.
    For example in form to add a TBH in menu there is a button ADD. How can we put those buttons.
    And also, there is button VALIDATE in the form where we have GO button. How to populate it. Even when the validate button is clicked, there is a popup menu saying that the entered amount is more than the budgeted amont. Is this done using the alerts?
    Please help regarding these issues

    Hi,
    I take it you are talking about when you right click and a menu appears.
    This is achieved by menus, Administration > Manage menus
    Or read about it here > http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/html_hp_admin/menus.html
    I think the example you talking about is menu "WFPMenuNewHires", if you want to know how it works you can edit it.
    It basically runs a business rule when you select an option like "Add To-be-hired" > Salary, you can customize the label on the buttons in the business options section of the menu set up.
    Once you have created a menu you can add it to a form when you design the form, it is part of the "Other Options" tab.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How To Use Flash Media Server For RPG Game Development Project ?

    I have a educational music video game development project (A Sea Voyage)  for whcih I am thinking to use the Adobe Flash Media Server for develping the 3D Game for which I plan to also use two other key tools,  blenderartist.org for 3D Creation of my ship, and use the popular game engine tool,  unity.com to integrated all my game elements.
    How to use the Adobe Flash Video Streaming Server Element for this RPG Type Game, internet friendly and desktop anchored ?
    Cafe Twin
    Metro Washington DC Hub

    I'm more or less in the same boat. I've got the admin console
    up. I am able to run the vodtest application locally pointing the
    video file to rtmp://localhost/vod/sample.flv or using the server
    name instead of localhost as in rtmp://mclmedia/vod/sample.flv
    I can also load the html and swf file to my xp machine that
    has access to the server via our internal network. (DNS isn't
    configured yet) But the connectionFailed message appears when I try
    to call the videos using rtmp://mclmedia/vod/sample.flv

Maybe you are looking for