private void decorateLabelWithHighestValue(JPanel panel) {
JLabel labelWithHigestValue = new JLabel("0.0");
for (java.awt.Component component : panel.getComponents()) {
if (component instanceof JLabel) {
JLabel label = (JLabel) component;
try {
double value = Double.parseDouble(label.getText());
if (value > Double.parseDouble(labelWithHigestValue.getText())) {
labelWithHigestValue = label;
}
} catch (NumberFormatException ignore) {}
}
}
labelWithHigestValue.setOpaque(true);
labelWithHigestValue.setBackground(Color.lightGray);
}
StyleProfilePanel.java 文件源码
java
阅读 20
收藏 0
点赞 0
评论 0
项目:swing
作者:
评论列表
文章目录