jpanel with image in background
I have a simple doubt, I need to replace this:
panel[1].setBackground(Color.red);
For an image, but I want to avoid a new jlabel
for image, because I tested and I have another label inside this panel th开发者_JAVA技巧at is pushed to below
Background Panel shows two approaches. One involves custom painting, the other involves using a JLabel. The approach you use will be based on your requirement. The custom painting is more flexible but a little more complicated.
精彩评论