【发布时间】:2012-10-20 22:01:33
【问题描述】:
我想声明一个 HTMLPanel 的子类。 在它的构造函数中,我想给它一些参数来构造包含的 html。
因为我必须调用超级构造函数作为第一个语句,所以我必须稍后在构造函数中更改 html。
我该怎么做?
public class MyHTMLPanel extends HTMLPanel
{
public MyHTMLPanel(String id, int anotherParameter)
{ super("");
String html=""
// ... some code th construct the html
//??? this.setHtml(html);
}
}
【问题讨论】: