Download Jar. Uses 3874K of libraries. Click here for Pure Java version (6680L/44K).
1 | !7 |
2 | |
3 | p-noconsole { |
4 | final DynamicHStack stack = dynamicHStack(); |
5 | |
6 | // Layout 1 (picture in the middle, text directly underneath it) |
7 | stack.addComponent(jImageAndTextButton(#1101204, "A cat")); |
8 | stack.addComponent(jImageAndTextButton(#1101216, "A rocket")); |
9 | |
10 | // Layout 2 (text at the top, icon below it, bold text) |
11 | swing { |
12 | JButton b1, b2; |
13 | stack.addComponent(b1 = jImageAndTextButton(#1101204, "CAT")); |
14 | stack.addComponent(b2 = jImageAndTextButton(#1101216, "ROCKET")); |
15 | for (JButton b : ll(b1, b2)) { |
16 | setFontSize(15, makeBold(b)).setVerticalTextPosition(JButton.TOP); |
17 | b.setVerticalAlignment(JButton.TOP); |
18 | } |
19 | } |
20 | |
21 | // Layout 3 (bold text at the bottom, icon above it) |
22 | swing { |
23 | JButton b1, b2; |
24 | stack.addComponent(b1 = jImageAndTextButton(#1101204, "A cat")); |
25 | stack.addComponent(b2 = jImageAndTextButton(#1101216, "A rocket")); |
26 | for (JButton b : ll(b1, b2)) |
27 | makeBold(b).setVerticalAlignment(JButton.BOTTOM); |
28 | } |
29 | |
30 | centerFrameWithWidth(700, showFrame(jscroll(jfullcenter(stack)))); |
31 | } |
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: | #1015031 |
Snippet name: | Image buttons for AI concepts [Swing] |
Eternal ID of this version: | #1015031/11 |
Text MD5: | 7947b1ece84665b6f87772cbb2965fab |
Transpilation MD5: | f49b0544a2b911556ad53f3103867700 |
Author: | stefan |
Category: | javax / a.i. / gui |
Type: | JavaX source code (desktop) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-05-07 13:08:43 |
Source code size: | 1076 bytes / 31 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 463 / 1181 |
Version history: | 10 change(s) |
Referenced in: | [show references] |