PDA

View Full Version : Embedding Alice Animations in Java GUI's


leonknathan
12-03-2009, 08:36 AM
Hi,

I've installed alice 3 and the netbeans plugins needed (alice and open gl) which allows the import of alice animations into netbeans. The import works quite nicely.

I'm now trying to add the animations to my own JFrame GUI instead of the default one with a pause button etc but I'm having trouble doing it.

I'm trying to determine whether the myProgram.showInAWTContainer(container, args); will do this however the animation doesn't seem to show in the container which i've added as a parameter (an awt Panel at the moment).

Does anyone have any ideas at all of how an alice animation can be run in a user's JFrame/GUI instead of the one provided?

lanceA
12-05-2009, 04:44 PM
Hi,

I've installed alice 3 and the netbeans plugins needed (alice and open gl) which allows the import of alice animations into netbeans. The import works quite nicely.

I'm now trying to add the animations to my own JFrame GUI instead of the default one with a pause button etc but I'm having trouble doing it.

I'm trying to determine whether the myProgram.showInAWTContainer(container, args); will do this however the animation doesn't seem to show in the container which i've added as a parameter (an awt Panel at the moment).

Does anyone have any ideas at all of how an alice animation can be run in a user's JFrame/GUI instead of the one provided?

Search the forums. Dr. Jim and I did some work with the Alice 3.0 & netBeans programs. He used an event listener to insert a Restart message box into an Alice program so that it could be restarted in Java.

This might work for your Pause in a JFrame. I have the code if you would like to view it. Email me off-line and I can send it to you.

Good luck.

Jeremytroid
12-05-2009, 05:14 PM
Is there a way to embed alice worlds on a webpage so others can play them?

leonknathan
12-17-2009, 12:38 PM
Search the forums. Dr. Jim and I did some work with the Alice 3.0 & netBeans programs. He used an event listener to insert a Restart message box into an Alice program so that it could be restarted in Java.

This might work for your Pause in a JFrame. I have the code if you would like to view it. Email me off-line and I can send it to you.

Good luck.


Hey lanceA :) Thanks for your reply. In the end i was able to have my alice animations play inside my own java project's JFrame using the Animation.showInAWTContainer(Container, Args) method passing a JInternalFrame (housed inside my JFrame) and the static args from the java program. While this did mean I did still have the pause button and speed slider, keeping them in seemed useful anyway.

I'm pretty impressed that you can have a realtime alice animation inside a java program and it worked nicely for me :D

Jeremytroid - you can easily have your alice world on a webpage by either:
1. Running realitime in a web page as an applet (this is exported by default)
2. Possibly mod an applet from netbeans once you've imported your project there (provided you have the required versions of netbeans, alice 3 beta, opengl and the alice-netbeans libraries) - see the alice blog for details on how to install these if needed.
Or:
3. Alice animaions can also export as a movie as I recall which can, of course, be embedded on web pages.

coresplinter
05-03-2011, 08:23 AM
Hi i'm also trying to start up an alice (3) world using netbeans, so i have a jform and would like to start the world after pressing a button, is this possible? I tried many ways but it doesnt work. Any suggestions or the correct way of doing it would be much appreciated