Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (488)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (553)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / JOGL Development / Re: Full screen with KeyListeners on: 2005-03-01 13:39:43
I have found a solution:  

course:

A JWindow cannot have focus without it's owing frame being visible (in the situation where i was not crating my own owner frame one was actually being created anyway).  

Solution:

Don't use JWindow use a JFrame and call the method setUndecorated(true);

Sorry to have wasted your time,

Edited for spelling ><
2  Java Game APIs & Engines / JOGL Development / Re: Full screen with KeyListeners on: 2005-03-01 13:12:39
Thanks for your help, unfortunatly i have alrerady tryed this and have been using the website you refrence.  Perhaps I am doing something wronge, her is the code I am using for adding a Listener:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
            
des.addGLEventListener(this);            
des.addKeyListener(this);

this.setFocusable(false);
//this.requestFocus();
des.requestFocus();
// i have played around with altering focus settings
// this is the one I would have thought would have worked
// but it didn't :/

Note: "this" refers to the JWindow I am extending to controle the GLCanvas, it overides boh keyEventListerner and GLEventLsitner

I would Also Like to add that further poking has descoverd that the falure to respond seem to be an artifact of me using a Window instread of a frame as when i disable full screen but still use a Jframe I have the same problem.  Is there some way that JWindows handle focuse diffrently?
3  Java Game APIs & Engines / JOGL Development / Re: Full screen with KeyListeners on: 2005-03-01 12:20:47
I have deoderised my code a bit, but I still have the same problem:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
 
GLCanvas des = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities());
 
JWindow win = new JWindow();
 
win.add(des);
 
// ...  set size, set visible etc.

GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice ().setFullScreenWindow(win);


No more redundant frame hanging around, but still no responce from the kayboard listeners Sad
4  Java Game APIs & Engines / JOGL Development / Full screen with KeyListeners on: 2005-03-01 10:49:26
sorry to post Noob question but i am really getting in a twist over this and i can't seem to find anything on any forums.  

I have a very simple full screen app and i just want a convenient way of closing it, i have very little user input i a simple keyListener seems like the best option.  

I am setting up full screen as follows:

(this has been extracted so that is readable context free)
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
frm = new JFrame();

GLCanvas des = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities());

win = new Window(frm);

win.add(des);

// ...  set size, set visible etc.

GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().setFullScreenWindow(win);


I have tried adding keylisteners to the frame, the window and the canvas, i have tried making various parts unfocusable and requesting focus on others.  The only time I have managed to get it working was by adding a Frame/JFrame to the ScreenDevice.setFullScreenWindow(); and addling the listener to that.  However this results in the menu bar being visible and I wanted that hidden.  

Please tell me what I am doing wrong, i'm sure i'm nearly there and this is frustraiting.  

Thank you,
5  Java Game APIs & Engines / JOGL Development / Full screen with KeyListeners on: 2005-03-01 10:30:56
Sorry for the double post, i don't know how that happened :/
Pages: [1]
 

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

The first screenshot will be displayed as a thumbnail.

TehJavaDev (17 views)
2014-08-28 18:26:30

CopyableCougar4 (26 views)
2014-08-22 19:31:30

atombrot (39 views)
2014-08-19 09:29:53

Tekkerue (36 views)
2014-08-16 06:45:27

Tekkerue (33 views)
2014-08-16 06:22:17

Tekkerue (22 views)
2014-08-16 06:20:21

Tekkerue (33 views)
2014-08-16 06:12:11

Rayexar (68 views)
2014-08-11 02:49:23

BurntPizza (45 views)
2014-08-09 21:09:32

BurntPizza (36 views)
2014-08-08 02:01:56
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!