Browse Source

bugfix:width、height有可能是""的问题修复

pull/1/head
guy 3 years ago
parent
commit
a9cf54aee1
  1. 2
      src/main/java/com/tptj/tool/hg/fineui/swing/FineUIEngine.java
  2. 4
      src/main/java/com/tptj/tool/hg/fineui/swing/element/LabelElement.java

2
src/main/java/com/tptj/tool/hg/fineui/swing/FineUIEngine.java

@ -227,7 +227,7 @@ public class FineUIEngine {
//demo下面的就是实际使用时的代码了,该框架包开发完毕,使用者要写的就是按照demo目录下那些代码了
// .importJs("com/tptj/tool/hg/fineui/swing/demo/layout.border.js");
// .importJs("com/tptj/tool/hg/fineui/swing/demo/layout.tape.js");
//.importJs("com/tptj/tool/hg/fineui/swing/demo/layout.grid.js");
// .importJs("com/tptj/tool/hg/fineui/swing/demo/layout.grid.js");
.importJs("com/tptj/tool/hg/fineui/swing/demo/layout.window.js");
return null;
}).run();

4
src/main/java/com/tptj/tool/hg/fineui/swing/element/LabelElement.java

@ -43,12 +43,16 @@ public class LabelElement extends AbstractElement<UILabel> {
}
Dimension dim = getComponent().getPreferredSize();
if ("width".equals(name)) {
if (val.length() > 0) {
dim.width = Integer.parseInt(val);
getComponent().setPreferredSize(dim);
}
}
if ("height".equals(name)) {
if (val.length() > 0) {
dim.height = Integer.parseInt(val);
getComponent().setPreferredSize(dim);
}
}
}
}

Loading…
Cancel
Save