±Û¾´ÀÌ :Yeti Chung 2000³â 5¿ù 25ÀÏ 15:55:59
In Reply to: [Áú¹®] FileDialog ¸¦ ȸé Áß¾ÓÀ¸·Î ? posted by ±Ã±ÝÀÌ on 2000³â 5¿ù 25ÀÏ 09:35:37:
ÀÛ¼ºÇϽŠcodeÀÇ ¾Æ·¡ ºÎºÐÀ» ´ÙÀ½°ú °°ÀÌ ¼öÁ¤ÇϽøé
µË´Ï´Ù.
/* Original code === Start */
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
Dimension dial = fd.getSize();
if ( dial.height > screen.height) dial.height = screen.height;
if ( dial.width > screen.width) dial.width = screen.width;
fd.setVisible(false);
f1.setLocation( screen.width/2 - dial.width/2 , screen.height/2 - dial.height /2 );
f1.setSize( sd.width , sd.height );
fd.setVisible(true);
/* Original code === End */
========= ´ÙÀ½ ===============
/* New code === Start */
fd.pack(); /* ±âº»ÀûÀ¸·Î dialog°¡ º¸¿©Áú ¸ð½ÀÀ» ±¸¼º*/
// Plonk it on center of screen
Dimension WindowSize = fd.getSize(),
ScreenSize = Toolkit.getDefaultToolkit().getScreenSize();
fd.setBounds((ScreenSize.width - WindowSize.width) / 2,
(ScreenSize.height-WindowSize.height) / 2, WindowSize.width, WindowSize.height);
show();
/* New code === End */
°£´ÜÇÏÁÒ?