だから私はプログラム選択ツールを作っています、そして現在私はすべてがジャバのルックアンドフィールだけで見える方法が好きです。私が変更したいのは、Windowsに対するJFileChooserのルックアンドフィールだけです。filechooserを呼び出して、ルックアンドフィールを変更するように指示すると、何も実行されません。プログラムの起動時に呼び出すと、ボタンがぎこちなく見えます。だからグーグルには何もありません、そして私はこれを機能させる方法を理解することができません。助けてください!どのコードが関連性があり、役立つかを教えてください。前もって感謝します!
編集:JFileChooserに関連するコードとその開始方法を次に示します。
public class Start(){
public static JButton assignButton = new JButton(new AbstractAction(
"Assign") {
public void actionPerformed(ActionEvent e) {
AssignWindow.run();
}
});
}
public class AssignmentWindow(){
public static void run() {
Dialogs.assignmentInfo();
bgImage = aw.getImage("files/background.png");
//aw is the object of this class
aw.makeFrame(); //makes the jframe for all the buttons to sit.
aw.setGraphics(); //assigns a different graphics variable
aw.fileChooser();
}
public void fileChooser() {
JFileChooser jfc = new JFileChooser();
jfc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
// here is where i want to set the look and feel....
if (jfc.showDialog(null, "Select") == JFileChooser.APPROVE_OPTION) {
File file = jfc.getSelectedFile();
fileDir = file.getPath();
} else {
Dialogs.msg("You cancled selecting a file. Returning to file frame...");
AssignWindow.destroy();
}
}
}