2010-03-16 96 views

回答

1

this thread at coderanch,一个可能的解决方案是在你的JDesktopPane中的子类的paintComponent方法绘制(或者在你的渲染器中,这可能会更好)。

+0

非常感谢你。这个链接中的例子对我来说工作正常 – Arivu2020 2010-03-16 10:26:08

1

您可以将JDeskTopPane类与另一个成员扩展为图像,然后在构造函数中为该图像设置背景。

public ExtendedJDesktopPane(Image image) { 
     super(); 
     this.image = image; 
    } 

    protected void paintComponent(Graphics g) { 
    g.drawImage(scaledImage, 0, 0, this); 
    } 

编辑: 这是类似于下面Riduidel提供的链接..我刚写晚了。

相关问题