Libraryless. Click here for Pure Java version (7894L/44K).
1 | static double relativeSliderValue(JSlider slider) swing { |
2 | if (slider == null) ret 0.0; |
3 | int min = slider.getMinimum(); |
4 | int max = slider.getMaximum(); |
5 | int val = slider.getValue(); |
6 | ret doubleRatio(val-min, max-min); |
7 | } |
Began life as a copy of #1035162
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1035438 |
Snippet name: | relativeSliderValue (0 to 1) |
Eternal ID of this version: | #1035438/2 |
Text MD5: | 3a0102b1333e582954eca497a5771ccb |
Transpilation MD5: | 9778a8e8df573cf9a370fd25a5758dab |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-05-10 19:12:04 |
Source code size: | 230 bytes / 7 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 131 / 189 |
Version history: | 1 change(s) |
Referenced in: | [show references] |