diff --git a/designer-base/src/main/java/com/fr/design/components/table/TablePanel.java b/designer-base/src/main/java/com/fr/design/components/table/TablePanel.java index 769efec515..304ade6f9e 100644 --- a/designer-base/src/main/java/com/fr/design/components/table/TablePanel.java +++ b/designer-base/src/main/java/com/fr/design/components/table/TablePanel.java @@ -160,9 +160,20 @@ public class TablePanel extends JPanel { cellPanel.remove(0); } cellPanel.add(component); - if(component instanceof UILabel) { - cellPanel.setToolTipText(((UILabel)component).getText()); - } + } + + /** + * 为单元格Panel添加tooltip + * + * @param row 行数 + * @param column 列数 + * @param value tooltip值 + */ + public void updateCellToolTip(int row, int column, String value) { + int x = row - 1; + int y = column - 1; + JPanel cellPanel = this.cellPanels[x][y]; + cellPanel.setToolTipText(value); } public void updateCell(int row, int column, String value) { diff --git a/designer-base/src/main/java/com/fr/env/detect/ui/EnvDetectorDialog.java b/designer-base/src/main/java/com/fr/env/detect/ui/EnvDetectorDialog.java index 312bf71074..f7ede9f1a0 100644 --- a/designer-base/src/main/java/com/fr/env/detect/ui/EnvDetectorDialog.java +++ b/designer-base/src/main/java/com/fr/env/detect/ui/EnvDetectorDialog.java @@ -361,6 +361,7 @@ public class EnvDetectorDialog extends JDialog { } EnvDetectorItem item = items.get(i); tablePanel.updateCell(row, 2, new UILabel(item.getDescription())); + tablePanel.updateCellToolTip(row, 2, item.getDescription()); DetectorResult result = item.getResult(); int detectRow = currentDetectIndex + 1;