本文整理了Java中java.awt.FileDialog.setLocation()
方法的一些代码示例,展示了FileDialog.setLocation()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileDialog.setLocation()
方法的具体详情如下:
包路径:java.awt.FileDialog
类名称:FileDialog
方法名:setLocation
暂无
代码示例来源:origin: stackoverflow.com
System.setProperty("apple.awt.fileDialogForDirectories", "true");
FileDialog fd = new FileDialog(this);
fd.setDirectory(_projectsBaseDir.getPath());
fd.setLocation(50,50);
fd.setVisible(true);
File selectedFile = new File(fd.getFile());
System.setProperty("apple.awt.fileDialogForDirectories", "false");
代码示例来源:origin: stackoverflow.com
FileDialog fd = new FileDialog(f, title, FileDialog.LOAD);
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
int w = fd.getSize().width;
int h = fd.getSize().height;
int x = (dim.width-w)/2;
int y = (dim.height-h)/2;
System.out.println("Dialog location: " + fd.getLocation().toString());
fd.setLocation(x, y);
System.out.println("Dialog location: " + fd.getLocation().toString());
fd.setVisible(true);
代码示例来源:origin: google/sagetv
fd.setDirectory(Sage.get("studio/last_image_browse_dir", System.getProperty("user.dir")));
fd.pack();
fd.setLocation(setImageFileButton.getLocationOnScreen());
fd.setVisible(true);
String selFilename = fd.getFile();
代码示例来源:origin: AliView/AliView
private void testFileDialog(){
Frame f = new Frame();
FileDialog fd = new FileDialog(f, "Hej", FileDialog.LOAD);
fd.setDirectory("/home/anders/_ormbunkar");
fd.setLocation(100,100);
fd.setSize(600, 600);
fd.setFile("");
fd.setVisible(true);
File selectedFile = new File(fd.getFile());
}
代码示例来源:origin: SimpleAmazonGlacierUploader/SAGU
fd.setFile("Save Archive As...");
fd.setDirectory(System.getProperty("user.dir"));
fd.setLocation(50, 50);
fd.setVisible(true);
代码示例来源:origin: MegaMek/megamek
fd.setFile(boardName.getText());
fd.setLocation(this.getLocation().x + 150, this.getLocation().y + 100);
fd.setVisible(true);
代码示例来源:origin: stackoverflow.com
final FileDialog fileDialog = new FileDialog(applicationFrame,
"Choose a file", FileDialog.LOAD);
/* Lots of code to be able to center an awt.FileDialog on screen... */
Rectangle rect = applicationFrame.getContentPane().getBounds();
/*
* Making sure FileDialog has a size before setVisible, otherwise
* left corner's distance from contentPane center cannot be found.
*/
fileDialog.pack();
fileDialog.setSize(800, 600);
fileDialog.validate();
double width = fileDialog.getBounds().getWidth();
double height = fileDialog.getBounds().getHeight();
double x = rect.getCenterX() - (width / 2);
double y = rect.getCenterY() - (height/ 2);
/* Could be new Point(x, y) */
Point leftCorner = new Point();
leftCorner.setLocation(x, y);
fileDialog.setLocation(leftCorner);
fileDialog.setVisible(true);
代码示例来源:origin: SimpleAmazonGlacierUploader/SAGU
fd.setFile("Glacier.txt");
fd.setDirectory(appProperties.getDir());
fd.setLocation(50, 50);
fd.setVisible(true);
String filePath = "" + fd.getDirectory() + System.getProperty("file.separator") + fd.getFile();
内容来源于网络,如有侵权,请联系作者删除!