A、c
flextable1.setWidget(0, 0, new Label("a"));
flexTable1.setWidget(0, 1, new Label("b"));
flexTable1.setWidget(0, 2, new Label("c"));我只想为a列设置橙色背景色。如何设置?请帮帮我。谢谢。
发布于 2014-05-09 17:05:09
尝试使用更易于管理的CSS样式。如果您想在将来更改它,那么您不需要接触JAVA代码。
通过这种方式,您可以从主题中受益。
JAVA:
// set style for first row and first column
flexTable.getFlexCellFormatter().setStyleName(0, 0,"yellowBackground");CSS:
.yellowBackground {
background-color: yellow;
}发布于 2014-05-09 16:28:12
试试这个:
public void onModuleLoad() {
FlexTable flexTable1 = new FlexTable();
Label a = new Label("a");
flexTable1.setWidget(0, 0, a);
flexTable1.setWidget(0, 1, new Label("b"));
flexTable1.setWidget(0, 2, new Label("c"));
//add your widget to your panel, I used RootPanel directly for this example.
RootPanel.get().add(flexTable1);
a.getElement().getStyle().setBackgroundColor("orange");
}https://stackoverflow.com/questions/23559786
复制相似问题