Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 'Is it possible to import a video into Java
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
C




PostPosted: Thu May 27, 2010 6:23 pm   Post subject: 'Is it possible to import a video into Java

I am using an IDE called Ready To Program , and just wondering if it is possible to import a .swf OR a .gif file into a .java file...
Sponsor
Sponsor
Sponsor
sponsor
Insectoid




PostPosted: Thu May 27, 2010 7:16 pm   Post subject: RE:\'Is it possible to import a video into Java

I dunno for sure, but it's probably something like 'include <filename>.

Don't think .swf files can be included 'cause they run in a VM (Flash). Technically swf's are programs themselves that are disguised as a movie file (as the controls and whatnot (stop, start, fast forward) are all included in the file). Gifs should be fine.
TheGuardian001




PostPosted: Thu May 27, 2010 7:41 pm   Post subject: Re: 'Is it possible to import a video into Java

I'm sure that somebody has written a loader for .swf files (although I don't know of one offhand.) Even if there is one, I'm fairly certain it won't be compatible with RTP (RTP uses a really old version of Java.)

.Gifs, on the other hand, are significantly easier (and even probably compatible with RTP!) the java.awt.Image class has the ability to load jpg, png, and gif images. To load the image,

Java:

Image myImage;
//If your class extends Applet&#058;
myImage = getImage(URL) //Alt: getImage(location, filename);

//OR

//If your class is an Application:
myImage = java.awt.Toolkit.getDefaultToolkit.getImage(URL) //Alt:getImage(location,filename);


I'm not entirely sure that that will treat it as an animation though. It may be drawn as a static image.

Even though that should be compatible with the java version packaged with RTP, Unless you have to use RTP for school, you should stop using it. It's old and barely functional, and uses an archaic version of Java.
unoho




PostPosted: Thu May 27, 2010 8:51 pm   Post subject: RE:\'Is it possible to import a video into Java

I suggest NetBeans or Eclipse in case you wanna change RTP Smile
Insectoid




PostPosted: Fri May 28, 2010 10:23 am   Post subject: RE:\'Is it possible to import a video into Java

I suggest notepad.
DtY




PostPosted: Fri May 28, 2010 7:27 pm   Post subject: RE:\'Is it possible to import a video into Java

I suggest vim and a makefile.

Is this a text editor thread now?
TheGuardian001




PostPosted: Fri May 28, 2010 9:05 pm   Post subject: Re: 'Is it possible to import a video into Java

I think it's more of a "Stop using RTP" thread...
C




PostPosted: Thu Jun 03, 2010 10:31 pm   Post subject: RE:\'Is it possible to import a video into Java

thanks for all your help!
and yes, RTP is for my school, and it IS barely functional D:
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 8 Posts ]
Jump to:   


Style:  
Search: