JPanel p = new JPanel() {
BufferedImage img;
try {
img = ImageIO.read(new File("...."));
} catch (IOException e) {}

void testA() {}
void testB() {}
};
な感じのインナークラスの書き方で、どのようにimgをtry catch書いたらいいでしょうか?