In my opinion the problem was, that the JSlider control does not have a PreferredSize before being packed into the layout, which only seems to be a problem in Linux
So I added the following in PatternSimilaritySlider::init()
So I would really appreciate, if you could test my version as well (not urgent though).
BTW: the update of the formula is correct. The problem is simply the width value returned at the beginning of paintComponent:
in your case it seems to be the sliders minimum size of 38 (left and right margin of 13 and the knob size of 12), which reveals, that the formula is wrong.
On Mac and Windows, I get a width of around 200, so the max calculated score is 187/174 = 1,07, which does not lead to the problem.
uups, now we worked in parallel ;-)
In my opinion the problem was, that the JSlider control does not have a PreferredSize before being packed into the layout, which only seems to be a problem in Linux
So I added the following in PatternSimilari tySlider: :init()
private void init() { lblVal, curVal);
setPreferr edSize( new Dimension(250, 54));
showValue(
}
In the layout part of PatternPaneScre enshot I simplified the layout this way
GridBagCons traints c = new GridBagConstrai nts();
c.fill = GridBagConstrai nts.BOTH; nts.REMAINDER; add(btnSimilar, c); add(sldSimilar, c);
c.gridwidth = GridBagConstrai
pane.
pane.
which makes this ugly stuff look a bit better.
So I would really appreciate, if you could test my version as well (not urgent though).
BTW: the update of the formula is correct. The problem is simply the width value returned at the beginning of paintComponent:
in your case it seems to be the sliders minimum size of 38 (left and right margin of 13 and the knob size of 12), which reveals, that the formula is wrong.
On Mac and Windows, I get a width of around 200, so the max calculated score is 187/174 = 1,07, which does not lead to the problem.
Many thanks for your efforts and contribution.