I'm not sure how to initialize GraphicsDevice and Window
Java keeps telling me that the variables have not been initialized and it won't let me run my applet unless they are. I have looked and looked and LOOKED for the answer and have found none. Please and Thank you!
Code :
GraphicsDevice myDevice;
Window CallofDuty;
myDevice.setFullScreenWindow(CallofDuty);
and then I have a second question is there a way to load video into an applet?
Re: I'm not sure how to initialize GraphicsDevice and Window
Hello DotChris,
Welcome to the Java Programming Forums :D
Try:
Code :
GraphicsDevice myDevice = null;
Window CallofDuty = null;
myDevice.setFullScreenWindow(CallofDuty);
Re: I'm not sure how to initialize GraphicsDevice and Window
Yes you can play video in a Java applet. Take a look at the Java Media Framework.
Quote:
The Java Media Framework (JMF) is a Java library that enables audio, video and other time-based media to be added to Java applications and applets.
Java SE Desktop Technologies - Java Media Framework API (JMF)
Java Media Framework - Wikipedia, the free encyclopedia
Re: I'm not sure how to initialize GraphicsDevice and Window
omg *face smack* I never thought to put a null there doh! Thank you so much! Wow >.> it just seems so apparent now. But of course a new problem arises, it still won't load in full screen.
The whole point of this program is to trick a game addicted friend that he's playing call of duty 4 what he DOESN'T know is that it's going to be a very clever rick roll/annoying program and i'm going to make it so he has to press something like the tilde sign to stop it, the only problem is I can't really continue if it doesn't load full screen lol(preferably undecorated).
Code :
import java.awt.*;
import java.applet.*;
import java.awt.Image;
import javax.swing.*;
import java.awt.Frame;
public class Test extends Applet {
private Image picture;
public void init() {
resize(800,600);
picture=getImage(getDocumentBase(),"CallofDuty.jpg");
}
public void paint(Graphics g) {
g.drawImage(picture,0,0,this);
}
public static void ControlPanel() {
GraphicsDevice myDevice=null;
Window CallofDuty=null;
myDevice.setFullScreenWindow(CallofDuty);