Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #37967

Re: How do you scale a JCheckBox?

From Knute Johnson <nospam@rabbitbrush.frazmtn.com>
Newsgroups comp.lang.java.programmer
Subject Re: How do you scale a JCheckBox?
Date 2018-01-22 11:38 -0600
Organization A noiseless patient Spider
Message-ID <p457io$r3l$1@dont-email.me> (permalink)
References <316fc0bc-d954-41c1-b913-3dd6e52e902a@googlegroups.com> <p42rpp$jku$1@dont-email.me> <0981e378-abef-4acc-a9c4-b67d68a75f35@googlegroups.com>

Show all headers | View raw


On 1/22/2018 09:25, Eric Douglas wrote:
> On Sunday, January 21, 2018 at 3:05:31 PM UTC-5, Knute Johnson wrote:
>>
>> Which runtime version are you using?  I think it was with Java 8 that
>> Swing components started scaling better.  I've got 9 in this computer.
>> Just tested a JCheckBox and changed the size on my display from 225% to
>> 300% and the box got bigger along with the text.
> 
> I put in some logging for debugging.  My desktop (running Windows 8.1) is set to 1920x1080.  I don't see a zoom % option.  It has a "make text larger or smaller" option, whatever that means is set all the way to smaller.  A Surface Pro 4 (running Windows 10) default resolution is 2736x1824.  With this resolution, and a 300% zoom setting, my 800x600 window looks about 1/3 the height of the screen.
> 
> My desktop reports the JCheckBox height of 16 (hardcoded height with a setSize() and a null layout), and an icon (box) height of 13.  The tablet reports the same JCheckBox height of 15 and an icon height of 40, so the text does auto-fit but if I don't manually scale the box it's way too big.
> 
> I forget what I set the resolution to, but we do have one desktop using a 27" tv for output and the boxes have always been too big.
> 
> Oddly, the default resolution for the Surface Pro 4 is a 1.5 ratio, and it's the only resolution option that is 1.5.  If I can't scale all the windows and controls to fit properly on the default resolution my best workaround is to set the resolution on the tablets to 1680x1050, which is 1.6 and gets some black bars on the top and bottom.  I suspect the X, minimize, and maximize buttons on JFrame are also icons since the rest of the JFrame and everything in it got small but those buttons are really big.
> 

I looked back at my notes and it is Java 9 that fixed the Swing scaling 
issues.  Try Java 9 and I think all your problems will be solved.

-- 

Knute Johnson

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How do you scale a JCheckBox? Eric Douglas <e.d.programmer@gmail.com> - 2018-01-19 05:28 -0800
  Re: How do you scale a JCheckBox? Eric Douglas <e.d.programmer@gmail.com> - 2018-01-19 13:13 -0800
    Re: How do you scale a JCheckBox? Daniele Futtorovic <da.futt.news@laposte.net> - 2018-01-20 09:49 +0100
      Re: How do you scale a JCheckBox? Eric Douglas <e.d.programmer@gmail.com> - 2018-01-22 04:56 -0800
    Re: How do you scale a JCheckBox? Eric Douglas <e.d.programmer@gmail.com> - 2018-01-22 08:54 -0800
  Re: How do you scale a JCheckBox? Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2018-01-21 14:05 -0600
    Re: How do you scale a JCheckBox? Eric Douglas <e.d.programmer@gmail.com> - 2018-01-22 07:25 -0800
      Re: How do you scale a JCheckBox? Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2018-01-22 11:38 -0600
        Re: How do you scale a JCheckBox? Eric Douglas <e.d.programmer@gmail.com> - 2018-01-22 10:17 -0800
        Re: How do you scale a JCheckBox? Eric Douglas <e.d.programmer@gmail.com> - 2018-01-22 12:49 -0800
          Re: How do you scale a JCheckBox? Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2018-01-22 15:31 -0600
  Re: How do you scale a JCheckBox? j4n bur53 <janburse@fastmail.fm> - 2018-01-22 22:37 +0100
    Re: How do you scale a JCheckBox? bursejan@gmail.com - 2018-01-22 14:16 -0800
      Re: How do you scale a JCheckBox? bursejan@gmail.com - 2018-01-22 14:18 -0800

csiph-web