제 JApplet의 배경색을 변경할 수 없습니다. 항상 회색입니다. 나는 NetBeans에서 일하고있다. 누구든지 어떤 제안이 있습니까? 고맙습니다.자바 - Japplet은 배경색을 변경할 수 없습니다.
솔루션 Крысa의 답변 덕분에 다음 문제가 해결되었습니다. getContentPane()을 사용해야합니다. setBackground (Color.WHITE);
@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) {}
}
코드를 볼 수 있습니까? – SJuan76