'Is it possible to import a video into Java
Author |
Message |
C
|
Posted: 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

|
|
 |
Insectoid

|
Posted: 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
|
Posted: 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:
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

|
Posted: 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  |
|
|
|
|
 |
Insectoid

|
Posted: Fri May 28, 2010 10:23 am Post subject: RE:\'Is it possible to import a video into Java |
|
|
I suggest notepad. |
|
|
|
|
 |
DtY

|
Posted: 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
|
Posted: 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
|
Posted: 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

|
|
 |
|
|