Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
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 1254 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:
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)

Offline gouessej
« Reply #4 - Posted 2012-01-12 09:23:50 »


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 | Personal blog | Website | Jogamp
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  

EgonOlsen (74 views)
2018-06-10 19:43:48

EgonOlsen (55 views)
2018-06-10 19:43:44

EgonOlsen (74 views)
2018-06-10 19:43:20

DesertCoockie (254 views)
2018-05-13 18:23:11

nelsongames (154 views)
2018-04-24 18:15:36

nelsongames (154 views)
2018-04-24 18:14:32

ivj94 (895 views)
2018-03-24 14:47:39

ivj94 (156 views)
2018-03-24 14:46:31

ivj94 (808 views)
2018-03-24 14:43:53

Solater (172 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!