This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Eugene, Sorry. I wish there is one for the JFrame. You have the set absolute position for the JFrame.
Joined: Mar 23, 2001
Thanks you all, i wonder why sun not encapsulate that function of the class JFrame into a method , since it's so common and widely-demanded
Joined: Oct 08, 2001
It turns out that the setLocationRelativeTo() is a new addition to java.awt.Window (and consequently to JFrame) in JDK 1.4. This addition actually makes perfect sense, and I think that up to 1.4, that method implementation was simply in the wrong place (JDialog instead of its immediate parent) and that's why it didn't work for JFrame. Eugene.