私は画像編集アプリを開発しているので、で選択した画像を表示したいJFileChooserので、すべての形式を表示できるようにするための最良の方法は何jpgですか?などはpng、filechooser の呼び出しに使用されます。gifOpenButton
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();
}
}
}