Gwt 如何更改内容面板gxt的标题

Gwt 如何更改内容面板gxt的标题,gwt,gxt,Gwt,Gxt,我正在努力通过改变内容面板的颜色使其标题看起来像闪烁一样。但是我正在尝试的代码不起作用,下面是代码: public class Reminder extends ContentPanel{ Timer time = new Timer{ public void run(){ rpc.getReminders(new AsyncCallBack<ArrayList<ModelData>>(){ public voidonFailure(Throwable caught) {

我正在努力通过改变内容面板的颜色使其标题看起来像闪烁一样。但是我正在尝试的代码不起作用,下面是代码:

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");
})
公共类提醒扩展ContentPanel{
定时器时间=新定时器{
公开募捐{
getememenders(新的AsyncCallBack(){
公共失效失效(可丢弃捕获)
{ }
成功时公共无效(ArrayList结果){
//下一行不影响任何结果
getHeader().setStyleAttribute(“背景色”、“红色”);
//甚至尝试过css,但都没有结果
getHeader().addStyleName(“myredpanel”);
//但是这个方法是可行的,但是它也覆盖了父css样式,但是我只需要改变背景颜色
getHeader().setStyleName(“myredpanel”);
})

搜索了论坛,但这些示例对我不起作用?还有什么建议吗?

在调用
setStyleAttribute
时不要使用驼峰大小写名称

getHeader().setStyleAttribute("backgroundColor","red"); // WRONG

getHeader().setStyleAttribute("background-color","red"); // CORRECT

如果您使用的是gxt 3.0.X,您应该更改ContentPanelAppreance,直接样式设置可能没有帮助。如果您愿意,我可以发送一个示例。

设置/添加样式可能很棘手。您是否查看了编译应用程序中的样式名称?您使用的是内部还是外部样式表?您是否能够进行/观察样式更改在firebug中?您需要编写您的示例,使您的答案相关。