I am trying to build a window with one picture that covers up the screen. The picture is a JLabel and the window is a JFrame. After trying countless ways and looking up multiple tutorials for hours, I have not figured out how to do this. I agree, this is a very simple question, but I simply do not understand how I can approach this problem. Here is my code I have tried(I commented out some things that I tried earlier):
package Buttons;
import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
import java.awt.GridLayout;
public class Mewindow extends JFrame {
private JFrame mewindow;
private JLabel mepic = new JLabel(new ImageIcon("me.png"));
public Mewindow() {
super("Here is a picture of ME!");
mewindow.setLayout(new GridLayout(1, 0, 0, 0));
// Icon me = new ImageIcon(getClass().getResource("me.png"));
add(mepic);
mewindow.setVisible(true);
mewindow.setSize(250, 250);
mewindow.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
}
}
Thank you so much for the time you are taking for reading this, I really appreciate the effort you are putting into helping a fellow programmer!