Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (524)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (592)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  having trouble with fulscreen!  (Read 633 times)
0 Members and 1 Guest are viewing this topic.
Offline Avendur

Junior Newbie





« Posted 2012-01-12 05: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

Senior Devvie


Medals: 5
Projects: 1



« Reply #1 - Posted 2012-01-12 05: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
« Reply #2 - Posted 2012-01-12 06:07:34 »

Have you set the JFrame 'undecorated'? persecutioncomplex

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline SteM

Junior Newbie





« Reply #3 - Posted 2012-01-12 07: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
« Reply #4 - Posted 2012-01-12 09: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).

Offline Avendur

Junior Newbie





« Reply #5 - Posted 2012-01-12 16: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]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

SHC (24 views)
2014-11-25 12:00:59

SHC (24 views)
2014-11-25 11:53:45

Norakomi (22 views)
2014-11-25 11:26:43

Gibbo3771 (22 views)
2014-11-24 19:59:16

trollwarrior1 (36 views)
2014-11-22 12:13:56

xFryIx (74 views)
2014-11-13 12:34:49

digdugdiggy (52 views)
2014-11-12 21:11:50

digdugdiggy (46 views)
2014-11-12 21:10:15

digdugdiggy (41 views)
2014-11-12 21:09:33

kovacsa (69 views)
2014-11-07 19:57:14
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!