私は2つのボタンを両方ともファイルダイアログを開いて欲しいものを持っています。
3118 次
1 に答える
5
使用したフレームワークに名前を付けませんでしたが、それが Swing であると仮定JFileChooser
すると、初期パスを設定できるコンストラクターがいくつかあります。
JFileChooser(File currentDirectory)
Constructs a JFileChooser using the given File as the path.
FileDialog
AWT フレームワークからの場合は、ダイアログを表示する前にセッターを使用してディレクトリを設定します。
setDirectory(String dir)
Sets the directory of this file dialog window to be the specified directory.
于 2011-01-20T07:52:41.957 に答える