Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  having trouble with fulscreen!  (Read 304 times)
0 Members and 1 Guest are viewing this topic.
Offline Avendur

JGO n00b
*

Posts: 3



« on: 2012-01-12 00:42:15 »

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!
Offline gbeebe

Full Member
**

Posts: 145
Medals: 5



« Reply #1 on: 2012-01-12 00:49:47 »

implement ComponentListener, then:
1  
2  
3  
4  
5  
public void componentResized(ComponentEvent evt) {
      // Reset the game dimensions:
     screenWidth = getSize().width;
      screenHeight = getSize().height;
}


Then reszize your JFrame?
Offline GabrielBailey74

Full Member
**

Posts: 157
Medals: 2


Owner of Elite Demons R.I.P


« Reply #2 on: 2012-01-12 01:07:34 »

Have you set the JFrame 'undecorated'? persecutioncomplex

Games published by our own members! Go get 'em!
Offline SteM

JGO n00b
*

Posts: 7



« Reply #3 on: 2012-01-12 02:18:23 »

If you are using laptop with and windows 7, check this (5'th poost)

http://www.sevenforums.com/gaming/58467-full-screen-problem-my-laptop-while-playing-games.html

Offline gouessej

JGO Kernel
*****

Posts: 3558
Medals: 30


TUER


« Reply #4 on: 2012-01-12 04:23:50 »

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).

Julien Gouesse
Offline Avendur

JGO n00b
*

Posts: 3



« Reply #5 on: 2012-01-12 11:32:33 »

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!
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.12 seconds with 20 queries.