Libraryless. Click here for Pure Java version (9480L/53K).
1 | please include function newButton. |
2 | |
3 | static JButtonWithInset jButtonWithInset(fS text, fO action) {
|
4 | ret swing(func -> JButtonWithInset {
|
5 | S text2 = dropPrefix("[disabled] ", text);
|
6 | final JButtonWithInset btn = new(text2); |
7 | if (l(text2) < l(text)) btn.setEnabled(false); |
8 | if (newButton_autoToolTip) {
|
9 | btn.setToolTipText(btn.getText()); |
10 | //onChangeAndNow(btn, r { btn.setToolTipText(btn.getText()) });
|
11 | } |
12 | // submitButtonOnEnter(btn); // test this first |
13 | if (action != null) |
14 | btn.addActionListener(actionListener(action, btn)); |
15 | ret btn; |
16 | }); |
17 | } |
18 | |
19 | static JButton jButtonWithInset(S text) {
|
20 | ret jButtonWithInset(text, null); |
21 | } |
22 | |
23 | static JButton jButtonWithInset(Action action) {
|
24 | ret swingNu(JButtonWithInset, action); |
25 | } |
Began life as a copy of #1003312
download show line numbers debug dex old transpilations
Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1020540 |
| Snippet name: | jButtonWithInset - bigger button |
| Eternal ID of this version: | #1020540/6 |
| Text MD5: | af91df0a4b7a49b216d9cb7d9cf153d1 |
| Transpilation MD5: | d9c818c432c02518a10b0ec04b2cca72 |
| Author: | stefan |
| Category: | javax / gui |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2019-07-14 11:58:54 |
| Source code size: | 783 bytes / 25 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 633 / 748 |
| Version history: | 5 change(s) |
| Referenced in: | [show references] |