Alice Community  

Go Back   Alice Community > Alice 3 > How Do I?

Reply
 
Thread Tools Display Modes
Embedding Alice Animations in Java GUI's
Old
leonknathan
Guest
 
Status:
Posts: n/a
Default Embedding Alice Animations in Java GUI's - 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?

Last edited by leonknathan; 12-03-2009 at 08:51 AM.
   
Reply With Quote
Old
lanceA
Guest
 
Status:
Posts: n/a
Default 12-05-2009, 04:44 PM

Quote:
Originally Posted by leonknathan View Post
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.
   
Reply With Quote
Old
Jeremytroid
Guest
 
Status:
Posts: n/a
Default 12-05-2009, 05:14 PM

Is there a way to embed alice worlds on a webpage so others can play them?
   
Reply With Quote
Old
leonknathan
Guest
 
Status:
Posts: n/a
Default 12-17-2009, 12:38 PM

Quote:
Originally Posted by lanceA View Post
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

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.
   
Reply With Quote
Old
coresplinter
Guest
 
Status:
Posts: n/a
Default 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
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2022, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.