20060928 Thursday September 28, 2006

Centering Windows on the Screen

Here is a nifty Java trick. I wanted to center a JDialog relative to the physical screen, vs. having it appear in the upper left corner or aligned relative to another component. After a quick web search, I found the following tidbit which takes care of the issue in a single line of code (assuming you have previously created a JDialog called "dialog"):

dialog.setLocationRelativeTo(null);

Works for JFrames too, and should work for anything that with java.awt.Window as a parent, though I have only tested this with JDialog and JFrame.

Posted by rickg ( Sep 28 2006, 02:09:36 AM PDT ) Permalink Comments [0]
20060927 Wednesday September 27, 2006

Inspiron E1705 3DMark06 Crash

Just got my new Dell Inspiron E1705 today with a 2 GHz Core 2 Duo and nVidia 7900 GS graphics. However, when I tried to run 3DMark06, it just crashed.

I was able to fix this by upgrading to the latest graphics drivers from nVidia.

http://www.nvidia.com/object/winxp_2k_mobile_84.63.html

Of course if you read this in the future, there will probably be newer drivers available, so just go to nvidia.com, click "download drivers" and go from there. Be sure to select "GeForce Go 7 Series" to get the mobile drivers.

By the way, I had bought an Alienware laptop about a month ago, but I returned it. I will post a followup article on why Alienware sucks, and no one should ever buy from them (and yes, I know that they are owned by Dell now, but lets just say that customer service quality has yet to filter down...).
Posted by rickg ( Sep 27 2006, 07:44:27 AM PDT ) Permalink Comments [1]