() -> {
JFrame frame = new ImageViewerFrame();
frame.setTitle("ImageViewer");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
Event -> {
int result = chooser.showOpenDialog(null);
if (result == JFileChooser.APPROVE_OPTION){
String name = chooser.getSelectedFile().getPath();
label.setIcon(new ImageIcon(name));
|
|