import java.awt.*;
import javax.swing.*;
import java.awt.Color;
import javax.swing.JPanel;
public class FirstFrame extends JFrame {
// FirstFrame properties
public FirstFrame() {
setTitle("Stacker");
setLayout(new GridBagLayout());
setSize(380, 650);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setUndecorated(true);
setVisible(true);
setResizable(true);
JLabel background = new JLabel(new ImageIcon("fw.jpg"));
background.setLayout(new BorderLayout());
add(background);
}
public static void main(String[] args) {
new FirstFrame();
}
}
Okay now that I have the frame undecorated .. (thanks to you guys) I'm trying to put a background image for the frame. but when I run it, all it shows is a blank frame.
What is wrong? How to correct it?