Hi, I want to make the background of the JFRAME and image??? but everytime the background image paints over the buttons???? please help!
zyaday
0
Junior Poster in Training
Recommended Answers
Jump to PostPlace 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); } };
All 4 Replies
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
zyaday
0
Junior Poster in Training
peter_budo
2,532
Code tags enforcer
Team Colleague
Featured Poster
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.