开发者

jpanel with image in background

开发者 https://www.devze.com 2023-02-09 07:03 出处:网络
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 pan

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号