[RSS]
CategoryNeedCleanup Needs answer, needs rename, maybe needs sample app. See discussion at http://www.nabble.com/Wiki-pages-with-questions...-tf3561091.html

I have a background within a layered pane and another layer with a Jlabel. I would like to make this label move from one side of the screen to another. I can't find where to add a timer or an animation type property if it does exist. If I need to hand code it, where would this go and how would I do it? Any help is much apprecaiated

A: If the application is intended to be embedded in a client-side web page I would suggest using a script element to hold your animation function and attach it to the onload attribute of the body element:

<head> <!-- The title element and other head section content goes here --> <script type="text/javascript"> <!-- Index=0; MIN_FRAMES=1; MAX_FRAMES=30;

function AnimateButton() { if(Index>=MAX_FRAMES) Index=MIN_FRAMES; LogoSrc='images/Anim'+Index+'.gif'; document.getElementById('AnimButton').setAttribute('src', LogoSrc); if(document.all) setTimeout('AnimateButton()',MAX_FRAMES); Index++; } // --> </script> </head>

<body onload="AnimateButton()"> <input type="image" id="AnimButton" src="images/Anim1.gif" border="0" /> </body> With some imagination and the use of Live Connect you should be able to interact with a java object and alter its position coordinates accordingly.

Hope this helps ;-> madzoink