Libraryless. Click here for Pure Java version (12539L/73K).
1 | meta-for JWindow also as JFrame { |
2 | |
3 | static IProgressShower tempProgressBar_addToWindowIfPossible(JWindow window, S text, double total default 1) { |
4 | if (!isVisibleWindow(window)) ret tempProgressBar(text, total); |
5 | |
6 | JProgressBar bar = jProgressBarWithText(iround(total), text); |
7 | var closeable = tempAddToWindow(window, |
8 | withMargin(jCenteredRaisedSection(text, bar))); |
9 | |
10 | ret new IProgressShower { |
11 | public void setValue(double value) { |
12 | setProgressBarValue(bar, iround(value)); |
13 | } |
14 | |
15 | public void setTotal(double total) { |
16 | setProgressBarTotal(bar, iround(total)); |
17 | } |
18 | |
19 | public void setText(S text) { |
20 | setProgressBarText(bar, print(text)); |
21 | } |
22 | |
23 | public void close { |
24 | _close(closeable); |
25 | } |
26 | }; |
27 | } |
28 | |
29 | } |
Began life as a copy of #1022691
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1034180 |
Snippet name: | tempProgressBar_addToWindowIfPossible |
Eternal ID of this version: | #1034180/3 |
Text MD5: | 86406aa214cd248160a43e1f952eda13 |
Transpilation MD5: | c2c42c62ba1714def1a9a61096e4e120 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-01-25 21:36:11 |
Source code size: | 835 bytes / 29 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 135 / 227 |
Version history: | 2 change(s) |
Referenced in: | [show references] |