을 유지하면서 구성을 설정 나는 다음과 같은 소스를 실행하지만는 JPanel의 유형
형식 불일치를 얻으려고 : JPanel의
오류 CustomJPan에서 변환 할 수 없습니다. 누군가 도와 주실 수 있습니까? 소스를 변명해라, 나는 내 머리 꼭대기에서 그것을했다.
public class rebuiltgui extends JApplet {
public void init() {
JPanel jpan = new CustomJPan();
}
}
class CustomJPan {
public JPanel CustomJPan() {
thispan = new JPanel();
thispan.setBackground(Color.red);
return thispan;
}
public changeColour() {
// Change colour to blue here
}
}
http://docs.oracle.com/javase/tutorial/java/javaOO/classes.html –
내가 생각했던 죄송합니다 서브 클래 싱 (facepalm) –