SO I have this program that is kind of like paint, it lets you draw shapes and lines, but my assignment is to add a menu bar with a sub menu File-> About, when Click on the about section. It should pull up a panel or a frame or a something that has a image which I have already made.
However it’s not working and I have never actually dealt with images before. All I have is from a Google search and that failed. I know the method is being called from the delightful system.out.println, and a box opens up but there is no picture!~ any help would be very nice.
if (e.getActionCommand().equals("About"))
{
System.out.println("stfu");
JFrame about = new JFrame("About");
about.setSize(300, 300);
BufferedImage img = null;
try{
img = ImageIO.read(new File("C:/Users/TehRobot/Desktop/Logo.png"));
}catch (IOException e1)
{
}
You’ll want to …
setIcon(...)method.In all this should just take a few lines of code, that’s all.