Libraryless. Click here for Pure Java version (9480L/53K).
please include function newButton.
static JButtonWithInset jButtonWithInset(fS text, fO action) {
ret swing(func -> JButtonWithInset {
S text2 = dropPrefix("[disabled] ", text);
final JButtonWithInset btn = new(text2);
if (l(text2) < l(text)) btn.setEnabled(false);
if (newButton_autoToolTip) {
btn.setToolTipText(btn.getText());
//onChangeAndNow(btn, r { btn.setToolTipText(btn.getText()) });
}
// submitButtonOnEnter(btn); // test this first
if (action != null)
btn.addActionListener(actionListener(action, btn));
ret btn;
});
}
static JButton jButtonWithInset(S text) {
ret jButtonWithInset(text, null);
}
static JButton jButtonWithInset(Action action) {
ret swingNu(JButtonWithInset, action);
}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: | 874 / 1013 |
| Version history: | 5 change(s) |
| Referenced in: | [show references] |