image loading using a JFileChooser into a JFrame
问题 I am trying to write a code that displays an image selected using a JFileChooser into another JFrame .I tried the following code below but only got the following errors. Exception in thread "main" java.lang.NullPointerException at javax.swing.ImageIcon.<init>(ImageIcon.java:228) at power.<init>(fCGUI.java:53) at fCGUI.main(fCGUI.java:11) Here is the code: import javax.imageio.ImageIO; import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.awt.image.BufferedImage; import