0

Hi, I want to make the background of the JFRAME and image??? but everytime the background image paints over the buttons???? please help!

3
Contributors
4
Replies
5
Views
10 Years
Discussion Span
Last Post by Ezzaral
0

Place your components on a JPanel instead and override the paintComponent method of that JPanel to paint the image

ImagePanel = new javax.swing.JPanel(){
    Image img = new ImageIcon(getClass().getResource(
      "images/blackX.gif")).getImage();

    public void paintComponent(Graphics g){
        g.drawImage(img, 0, 0, getWidth(), getHeight(), this);
    }
};
0

thank u very much, that part is working ...now i dont know how to reposition the buttons......................

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.