我正在努力通过更改它的颜色来使内容面板的标题看起来像闪烁。但是我尝试的代码不起作用,这里的代码:
public class Reminder extends ContentPanel{
Timer time = new Timer{
public void run(){
rpc.getReminders(new AsyncCallBack<ArrayList<ModelData>>(){
public voidonFailure(Throwable caught)
{ }
public void onSuccess(ArrayList<ModelData> result){
//the next line does not affect any result
getHeader().setStyleAttribute("backgroundColor","red");
//even tried throught css, but both of them gave no result
getHeader().addStyleName("myredpanel");
//But this method is working, but its also overwriting the parents css styles, but i only need to change backgroun color
getHeader().setStyleName("myredpanel");
})
搜索了论坛,但这些例子不适用于我的?还有什么建议?