Welcome to Dream.In.Code
Become a Java Expert!

Join 150,394 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 1,037 people online right now. Registration is fast and FREE... Join Now!




How to make JFrame Appear to the Center of Desktop?

 
Reply to this topicStart new topic

How to make JFrame Appear to the Center of Desktop?

fsloke
12 Mar, 2008 - 04:44 AM
Post #1

D.I.C Regular
***

Joined: 19 Dec, 2007
Posts: 258



Thanked: 4 times
My Contributions
How to make JFrame Appear to the Center of Desktop?

When we build the JFrame, we can setLocation of the frame...

This not good because thewe cannot expect the user use what size desktop resolution....

Any recommendation or advise...

* Compile Java the Frame always appear at the center

Thank...
User is offlineProfile CardPM
+Quote Post

1lacca
RE: How To Make JFrame Appear To The Center Of Desktop?
12 Mar, 2008 - 06:34 AM
Post #2

code.rascal
Group Icon

Joined: 11 Aug, 2005
Posts: 3,822



Thanked: 12 times
My Contributions
Getting the screen size
From here it is simple arithmetics.
User is offlineProfile CardPM
+Quote Post

fsloke
RE: How To Make JFrame Appear To The Center Of Desktop?
14 Mar, 2008 - 08:57 PM
Post #3

D.I.C Regular
***

Joined: 19 Dec, 2007
Posts: 258



Thanked: 4 times
My Contributions
Ya, this information is very useful for me...

Thank, 1lacca
User is offlineProfile CardPM
+Quote Post

1lacca
RE: How To Make JFrame Appear To The Center Of Desktop?
15 Mar, 2008 - 01:51 AM
Post #4

code.rascal
Group Icon

Joined: 11 Aug, 2005
Posts: 3,822



Thanked: 12 times
My Contributions
You are welcome.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 06:07PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month