first of all, sorry if this is the wrong thread.
my problem is, i'm trying to put a backround image in a jPanel using netbeans. I got this code here in this forum:
import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
public class NewJFrame extends javax.swing.JFrame {
public NewJFrame() {
initComponents();
ImageIcon image = new ImageIcon("C:\\VideoKarera\\bg.jpg");
JLabel background = new JLabel(image);
background.setBounds(0, 0, image.getIconWidth(), image.getIconHeight());
getLayeredPane().add(background, new Integer(Integer.MIN_VALUE));
JPanel panel = new JPanel();
panel.setOpaque(false);
setContentPane( panel );
}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
NewJFrame JFrame = new NewJFrame();
JFrame.setVisible(true);
JFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JFrame.setSize(1091, 689);
}
});
}
}
when I select run then run main project, the project runs correctly with the picture. but the problem is the jPanel I've created does not show in the "Inspector" and "Design" panels so I can't design the project and add other components using the palette panel of netbeans.
is there a way to remedy this? sorry I'm just still a newbie in java programming and I only know how to use netbeans.
Edited by: mihwak on Feb 12, 2008 8:13 PM
Edited by: mihwak on Feb 12, 2008 8:13 PM