Hy guys! I start to learn game programming in the david brackeen’s book - Developing Games in Java, and I’m having a little problem going fullscreen in my pc.
It functions perfectly, but looks like the JFrame its not going fullscreen, it just place itself in the center of screen with while the rest of the screen around him turns to black.
I already test the code in other computer and functions normally, with the JFrame extending occuping all the screen. Soo, I want to know what are causing this on my computer, and how to fix this so it not occur in others computers too.
Thanks guys!
implement ComponentListener, then:
public void componentResized(ComponentEvent evt) {
// Reset the game dimensions:
screenWidth = getSize().width;
screenHeight = getSize().height;
}
Then reszize your JFrame?
Have you set the JFrame ‘undecorated’? :persecutioncomplex:
If you are using laptop with and windows 7, check this (5’th poost)
Hi
How do you use full screen in Java? Have you read the example provided in the documentation of the standard Java API? Set the location at the top left corner (JFrame.setLocation(0,0)), get the size of the screen with java.awt.Toolkit.getScreenSize() and set this size or use the Swing method to maximize it. As someone else said, don’t forget to call JFrame.setUndecorated(true). Then, try to switch to exclusive full screen mode. If it fails but by a smart way (if you use it properly), your program will use software simulated full screen mode, i.e a maximized window occupying the whole screen without decoration. I use this kind of technic in the alpha version of TUER, it works fine except on KDE 4 (one of the window managers used on GNU Linux).
I discovered the problem. I follow the tip of SteM. Just have to set some things on my ATI application. Now all its working fine.
Thanks for all your help guys!