GWT DockLayoutPanel无法正确显示Firefox

时间:2012-04-23 19:01:05

标签: gwt css3 docklayoutpanel

我有一个简单的GWT应用程序,它在TextArea中获取源代码,将其发送到远程编译器,并在其他一些TextAreas中显示汇编语言输出和编译器错误。下面的代码在Safari和Chrome中运行良好,但TextAreas和Buttons没有调整大小以填充Firefox中的面板。我可以手动将小部件的大小设置为100%,这几乎是可以接受的,但我肯定缺少一些重要的CSS知识。我将文档类型设置为严格的HTML4 DTD(“http://www.w3.org/TR/html4/strict.dtd”)。该应用正在http://ferret.granberrys.us:8080/Compiler.html运行。

RootLayoutPanel rootPanel = RootLayoutPanel.get();
DockLayoutPanel panel = new DockLayoutPanel(Unit.EM);
codeArea = new TextArea();
codeArea.setText("int main() {return 0};");

DockLayoutPanel outputPanel = new DockLayoutPanel(Unit.EM);
ListBox compiler = new ListBox();
compiler.addItem("Clang/LLVM");
outputPanel.addNorth(compiler, 2);
assemblyArea = new TextArea();
assemblyArea.setText("Asm");

Button compileButton = new Button();
compileButton.setText("Compile");
outputPanel.addSouth(compileButton, 2);
outputPanel.add(assemblyArea);
panel.addEast(outputPanel, 20);

compilerOutput = new TextArea();
compilerOutput.setReadOnly(true);
compilerOutput.setText("Compiler");
//panel.addWest(codeArea, 800);
panel.addSouth(compilerOutput, 10);
panel.add(codeArea);
rootPanel.add(panel);

1 个答案:

答案 0 :(得分:0)

根据documentation您应该使用<!DOCTYPE html>,但我不确定这是否是问题所在。它也可能是TextArea是一个span元素,或者至少不是一个css块元素。您可以通过将display:block添加到特定小部件来完成此操作。