私は画像編集アプリを開発しているので、で選択した画像を表示したいJFileChooser
ので、すべての形式を表示できるようにするための最良の方法は何jpg
ですか?などはpng
、filechooser の呼び出しに使用されます。gif
OpenButton
private void OpenActionPerformed(java.awt.event.ActionEvent evt) {
int returnVal = fileChosser.showOpenDialog(this);
if (returnVal == JFileChooser.APPROVE_OPTION) {
File file = fileChosser.getSelectedFile();
// What to do with the file
// I want code for this part
try {
//code that might create an exception
}
catch (Exception e1) {
e.printStackTrace();
}
}
}