1 | import javax.swing.plaf.basic.BasicComboBoxRenderer; |
2 | |
3 | static void setComboBoxListFont(JComboBox cb, final Font font) { |
4 | cb.setRenderer(new BasicComboBoxRenderer { |
5 | new DefaultListCellRenderer defaultRenderer; |
6 | |
7 | public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { |
8 | JLabel renderer = cast defaultRenderer.getListCellRendererComponent(list, value, index, isSelected,cellHasFocus); |
9 | renderer.setFont(theFont); |
10 | ret renderer; |
11 | } |
12 | }); |
13 | } |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1012966 |
Snippet name: | setComboBoxListFont |
Eternal ID of this version: | #1012966/2 |
Text MD5: | df465727ef1b27bbbf8a36b159cd841e |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-12-18 23:06:25 |
Source code size: | 543 bytes / 13 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 392 / 431 |
Version history: | 1 change(s) |
Referenced in: | [show references] |