gpt4 book ai didi

java - JFileChooser 查询

转载 作者:行者123 更新时间:2023-12-02 00:42:17 28 4
gpt4 key购买 nike

如何在屏幕中央显示 JFile-Chooser。使用 ToolKit 的常规方法不起作用。

最佳答案

查看 Javadoc 中的方法 JFileChooser#showDialog(Component parent, String approveButtonText) throws HeadlessException ,它说:

The parent argument determines two things: the frame on which the open dialog depends and the component whose position the look and feel should consider when placing the dialog. If the parent is a Frame object (such as a JFrame) then the dialog depends on the frame and the look and feel positions the dialog relative to the frame (for example, centered over the frame). If the parent is a component, then the dialog depends on the frame containing the component, and is positioned relative to the component (for example, centered over the component). If the parent is null, then the dialog depends on no visible window, and it's placed in a look-and-feel-dependent position such as the center of the screen.

关于java - JFileChooser 查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6026796/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com