【问题标题】:How to change the color and style of text in a JList?如何更改 JList 中文本的颜色和样式?
【发布时间】:2012-01-18 00:35:44
【问题描述】:

我有一个包含名称列表的 DefaultListModel。当名称添加到列表中时,它们只是作为字符串添加。我需要做的是在特定时间更改某些名称的颜色/样式(即斜体)。有什么有效的方法吗?

【问题讨论】:

    标签: java swing colors jlist defaultlistmodel


    【解决方案1】:

    您需要使用自定义渲染器。见Writing a Custom Renderer

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-18
      • 2013-09-23
      • 2020-01-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多