From a9cf54aee1344433727788f943b1fd914ec78d1f Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 6 Nov 2021 00:19:01 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:width=E3=80=81height=E6=9C=89=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E6=98=AF""=E7=9A=84=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/tptj/tool/hg/fineui/swing/FineUIEngine.java | 2 +- .../tool/hg/fineui/swing/element/LabelElement.java | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/tptj/tool/hg/fineui/swing/FineUIEngine.java b/src/main/java/com/tptj/tool/hg/fineui/swing/FineUIEngine.java index 081823c..291280a 100644 --- a/src/main/java/com/tptj/tool/hg/fineui/swing/FineUIEngine.java +++ b/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(); diff --git a/src/main/java/com/tptj/tool/hg/fineui/swing/element/LabelElement.java b/src/main/java/com/tptj/tool/hg/fineui/swing/element/LabelElement.java index 9fe4d41..ed6c4c4 100644 --- a/src/main/java/com/tptj/tool/hg/fineui/swing/element/LabelElement.java +++ b/src/main/java/com/tptj/tool/hg/fineui/swing/element/LabelElement.java @@ -43,12 +43,16 @@ public class LabelElement extends AbstractElement { } Dimension dim = getComponent().getPreferredSize(); if ("width".equals(name)) { - dim.width = Integer.parseInt(val); - getComponent().setPreferredSize(dim); + if (val.length() > 0) { + dim.width = Integer.parseInt(val); + getComponent().setPreferredSize(dim); + } } if ("height".equals(name)) { - dim.height = Integer.parseInt(val); - getComponent().setPreferredSize(dim); + if (val.length() > 0) { + dim.height = Integer.parseInt(val); + getComponent().setPreferredSize(dim); + } } } }