Hello everyone,

I'm brand new to coding, and I have a small GUI question. I want to open a JFrame that fills the computer screen initially and that holds a JPanel that fills the entire JFrame. Further, I want this JPanel to hold a graphic JPG file that I have downloaded. Basically, I want a JFrame that is completely filled with "wallpaper". I have found the proper classes and methods to accomplish this and have coded properly. However, the wallpaper graphic only fills the upper left corner of the JFrame window and not the entire window. How do I reach my goal?

Here is my attempt at a code. Please, offer any suggestions that come to mind:

import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.JPanel;


public class lexicon extends JFrame
{

public lexicon (String str)
{
super (str);
}
private void process()
{
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
this.setLocation(0,0);
this.setSize(dim.width, dim.height);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setVisible(true);
}
public static void main(String [] args)
{
lexicon frame = new lexicon("Lexicon");
frame.process();
panel dragon = new panel();
dragon.setMaximumSize(Toolkit.getDefaultToolkit().getScreenSize());
frame.setContentPane(dragon);

}

public static class panel extends JPanel
{
public panel()
{
super();
}

BufferedImage image;

public void paintComponent(Graphics g)
{
try
{

image = ImageIO.read(new File("C:\\Users\\Urban\\Desktop\\Chinese Dragon.jpg"));
}
catch (Exception ex)
{
}

g.drawImage(image, 0, 0, null);
}
}
}