1

私は2つのボタンを両方ともファイルダイアログを開いて欲しいものを持っています。

4

1 に答える 1

5

使用したフレームワークに名前を付けませんでしたが、それが Swing であると仮定JFileChooserすると、初期パスを設定できるコンストラクターがいくつかあります。

JFileChooser(File currentDirectory)
      Constructs a JFileChooser using the given File as the path.

FileDialogAWT フレームワークからの場合は、ダイアログを表示する前にセッターを使用してディレクトリを設定します

setDirectory(String dir)
      Sets the directory of this file dialog window to be the specified directory.
于 2011-01-20T07:52:41.957 に答える