0

JApplet の背景色を変更できません。いつもグレー色です。私は NetBeans で作業しています。誰にも提案はありますか?ありがとうございました。

ソリューションКрысa の回答のおかげで、次のように問題を解決できます。

@Override
public void init() {

    /* Set the Nimbus look and feel */
    //Look and feel setting code (optional)

    /* Create and display the applet */
    try {
        java.awt.EventQueue.invokeAndWait(new Runnable() {

            public void run() {
                getContentPane().setBackground(Color.WHITE);
                initComponents();
            }
        });
    } catch (Exception ex) {}

}

4

1 に答える 1

1

JAppletコンテンツ ペインの背景を設定する必要があります。

于 2011-12-02T14:13:13.290 に答える