Download Jar. Libraryless. Click here for Pure Java version (5212L/37K).
1 | !7 |
2 | |
3 | sclass JListWithBackground extends JList { |
4 | BufferedImage image; |
5 | Color backgroundColor; |
6 | |
7 | *(BufferedImage *image, Color *backgroundColor) { |
8 | jtransparent_hard(this); |
9 | setColorizationFactor(this); |
10 | } |
11 | |
12 | protected void paintComponent(Graphics g) { |
13 | paintCenteredBackgroundImage(this, g, image, backgroundColor); |
14 | super.paintComponent(g); |
15 | } |
16 | } |
17 | |
18 | p/*-subst*/ { |
19 | BufferedImage img = bufferedImageContrastAndBrightness(loadImage2(#1101314), 1, 150); |
20 | Color bgColor = new Color(img.getRGB(0, 0)); |
21 | |
22 | JList list = jtransparent_hard(jlist()); |
23 | fillListWithStrings(list, repF(100, f aGlobalID)); |
24 | |
25 | final JScrollPane scrollPane = jscroll(list); |
26 | swing { |
27 | scrollPane.setOpaque(false); |
28 | scrollPane.getViewport().setOpaque(false); |
29 | } |
30 | |
31 | //setForeground(Color.red, list); |
32 | //showFrame(scrollPane); |
33 | |
34 | showFrame(setBackground(bgColor, |
35 | jCenteredBackgroundImage(img, scrollPane))); |
36 | } |
Began life as a copy of #1016232
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1016234 |
Snippet name: | List With Background Test attempt 2 (WORKS without Substance) |
Eternal ID of this version: | #1016234/6 |
Text MD5: | a49e3f4810888ce51434ab3c8258c857 |
Transpilation MD5: | 056e5adda50f31506dca0b8ba92d831d |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX source code (desktop) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-06-11 15:01:57 |
Source code size: | 948 bytes / 36 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 474 / 1178 |
Version history: | 5 change(s) |
Referenced in: | [show references] |