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
Java-Gaming.org
>
Game Development
>
Newbie & Debugging Questions
>
Focus problem
Pages: [
1
]
Print
Focus problem
(Read 701 times)
0 Members and 1 Guest are viewing this topic.
Grand Poeba
Full Member
Posts: 143
Focus problem
«
on:
2006-01-21 18:54:03
»
Hey
As yo u may know i am working on a conversing of ttd but i am having thefollowing problem
When i let the user choose its resolution (by using a jdialog) before launching the game my jframe
doenst gain the focus when opening.
When i start my app without the jdialog first aeverything goes fine but when i use the jdialog before creating
the jframe it doens obtain the focus. Any ideas how this comes and to solve it?
thx
oNyx
JGO Kernel
Posts: 2943
Medals: 5
pixels! :x
Re: Focus problem
«
Reply #1 on:
2006-01-21 18:56:11
»
requestFocus()
弾幕 ☆
@mahonnaise
☆
blog
Grand Poeba
Full Member
Posts: 143
Re: Focus problem
«
Reply #2 on:
2006-01-21 19:37:49
»
Quote from: oNyx on
2006-01-21 18:56:11
requestFocus()
tried it but didnt help (i dont have to it when just using jframe)
even tried requestFocusInWindow
Games published by our own members! Go get 'em!
swpalmer
JGO Kernel
Posts: 3438
Medals: 4
Where's the Kaboom?
Re: Focus problem
«
Reply #3 on:
2006-01-22 23:24:02
»
setFocusable(true); ?
Digital Video
Welcome to reality
Sanity
Mr_Light
JGO Strike Force
Posts: 893
shiny.
Re: Focus problem
«
Reply #4 on:
2006-01-23 10:52:25
»
whats the JDialog's owner?
this is one of the few uses where one should use requestFocus() over requestFocusInWindow(), make sure that setVisible(true); is called,and executed before the requestFocus();
It's harder to read code than to write it. - it's even harder to write readable code.
The gospel of brother Riven: "The guarantee that all bugs are in *your* code is worth gold." Amen brother a-m-e-n.
Grand Poeba
Full Member
Posts: 143
Re: Focus problem
«
Reply #5 on:
2006-01-23 12:07:46
»
Quote from: Mr_Light on
2006-01-23 10:52:25
whats the JDialog's owner?
this is one of the few uses where one should use requestFocus() over requestFocusInWindow(), make sure that setVisible(true); is called,and executed before the requestFocus();
the jdialog has no owner because its just appearing before the actual launch of the game. So no jframe has been created yet
cylab
JGO Kernel
Posts: 1940
Medals: 27
Re: Focus problem
«
Reply #6 on:
2006-01-24 03:03:28
»
I think the only way to overcome this problem is by creating the frame first, show it with a placeholder panel inside, display the dialog with this frame as the owner and modify the existing frame after the dialog exits.
Mathias - I Know What [you] Did Last Summer!
Jeff
JGO Kernel
Posts: 3535
Got any cats?
Re: Focus problem
«
Reply #7 on:
2006-01-29 19:56:13
»
if requestFocus on the window doesnt work, try it on the window's content pane.
Got a question about Java and game programming? Just new to the Java Game Development Community? Try my FAQ. Its likely you'll learn something!
http://wiki.java.net/bin/view/Games/JeffFAQ
Pages: [
1
]
Print
Jump to:
Please select a destination:
-----------------------------
Games Center
-----------------------------
=> Featured Games
=> Showcase
=> Contests
===> LWJGL16k - 2011
===> 4K Game Competition - 2012
===> JGO Comp Petite
===> Finished Contests
=====> 4K Game Competition - 2011
=====> 4K Game Competition - 2010
=====> 4K Game Competition - 2009
=====> 4K Game Competition - 2008
=====> 4K Game Competition - 2007
=====> 4K Game Competition - 2006
=====> 4K Game Competition - 2005
=====> Tiny Game 2010
=====> JGO Comp 2009
=====> 16K LWJGL Competition - 2005
=====> Java Technology Game Development Contest - 2004
-----------------------------
Discussions
-----------------------------
=> General Discussions
===> Suggestions
=> Business and Project Discussions
===> Jobs and Resumes
===> Community & Volunteer Projects
=> Miscellaneous Topics
-----------------------------
Game Development
-----------------------------
=> Newbie & Debugging Questions
=> Articles & tutorials
=> Game Play & Game Design
=> Game Mechanics
===> Artificial Intelligence
=> Networking & Multiplayer
=> Performance Tuning
=> Shared Code
-----------------------------
Java Game APIs & Engines
-----------------------------
=> Engines, Libraries and Tools
===> Java 3D
===> JInput
===> jMonkeyEngine
===> Xith3D Forums
===> Tools Discussion
=> Java 2D
===> JavaFX
=> OpenGL Development
===> JOGL Development
===> LWJGL Development
=> Java Sound & OpenAL
===> JOAL Development
=> Java on Mobile Devices
===> Android
===> J2ME
Loading...