1 | sclass SmoothLabel extends JLabel { |
2 | *() {} |
3 | *(S text) { super(text); } |
4 | *(Icon icon) { super(icon); } |
5 | |
6 | public void paintComponent(Graphics g) { |
7 | Graphics2D g2d = (Graphics2D) g; |
8 | g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); |
9 | g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); |
10 | g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
11 | super.paintComponent(g2d); |
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: | #1007791 |
Snippet name: | SmoothLabel - JLabel with anti-alias rendering |
Eternal ID of this version: | #1007791/5 |
Text MD5: | 392131f5d3c0256122d2d9d2adb07429 |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-04-06 22:50:47 |
Source code size: | 526 bytes / 13 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 555 / 1120 |
Version history: | 4 change(s) |
Referenced in: | [show references] |