我的问题在标题里已经说得很清楚了,有谁知道?
------解决方案--------------------
- Java code
import java.awt.*;import javax.swing.*;class ImagePanel extends JPanel { private Image backgroundImage; ImagePanel() { // 从系统中加载图片 backgroundImage = new ImageIcon("image address").getImage(); } @Override protected void paintComponent(Graphics g) { super.paintComponent(g); if (backgroundImage != null) { g.drawImage(backgroundImage, 0, 0, getWidth(), getHeight(), this); } }}