Swing/HtmlCellVerticalAlignment のバックアップ(No.1)
- バックアップ一覧
- 差分 を表示
- 現在との差分 を表示
- 現在との差分 - Visual を表示
- ソース を表示
- Swing/HtmlCellVerticalAlignment へ行く。
- 1 (2014-11-07 (金) 03:25:40)
- 2 (2015-06-22 (月) 17:58:29)
- 3 (2017-03-22 (水) 20:47:25)
- 4 (2017-04-07 (金) 13:51:51)
- 5 (2018-01-25 (木) 18:09:40)
- 6 (2019-02-06 (水) 17:20:54)
- 7 (2020-12-03 (木) 10:17:11)
- 8 (2023-04-14 (金) 14:58:14)
- 9 (2025-01-03 (金) 08:57:02)
- 10 (2025-01-03 (金) 09:01:23)
- 11 (2025-01-03 (金) 09:02:38)
- 12 (2025-01-03 (金) 09:03:21)
- 13 (2025-01-03 (金) 09:04:02)
- title: TableCellRendererに複数行のHtmlテキストを表示する場合に行揃えを設定する tags: [JTable, TableCellRenderer, Html, JLabel] author: aterai pubdate: 2014-08-11T00:16:05+09:00 description: JTableのCellに複数行になるHtmlテキストを表示する場合の行揃えによる描画の変化をテストします。
概要
JTable
のCell
に複数行になるHtml
テキストを表示する場合の行揃えによる描画の変化をテストします。
Screenshot

Advertisement
サンプルコード
((JLabel) table.getDefaultRenderer(Object.class)).setVerticalAlignment(JLabel.TOP);
View in GitHub: Java, Kotlin解説
DefaultTableCellRenderer
(JLabel
を継承)に複数行になるHtml
テキストを表示する場合、行揃え(VerticalAlignment
)にJLabel.TOP
以外が設定されていると、マウスドラッグによるセル選択で描画が乱れることがあります。