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


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

Re: How do you scale a JCheckBox?

Newsgroups comp.lang.java.programmer
Date 2018-01-22 04:56 -0800
References <316fc0bc-d954-41c1-b913-3dd6e52e902a@googlegroups.com> <985fa054-03a9-4490-a298-a0df9ac4171f@googlegroups.com> <p3uvrh$91o$1@dont-email.me>
Message-ID <27c7b83e-173e-466f-b44e-cb11bccff237@googlegroups.com> (permalink)
Subject Re: How do you scale a JCheckBox?
From Eric Douglas <e.d.programmer@gmail.com>

Show all headers | View raw


On Saturday, January 20, 2018 at 3:50:09 AM UTC-5, Daniele Futtorovic wrote:
> Seems to me you've already found the answer to your question: the
> JCheckbox icon doesn't change size because, drumroll... it's an icon.
> 
> I believe there should be a way for you to change the icon used by the
> JCheckbox component without any UI-specific code, probably via some
> Swing property. I'd look into that if I were you.
> 
> -- 
> DF.

I'm using Java 8, currently update 144.  Yes I don't want to create my own custom icon, and I'd rather not create a new icon every time it draws the checkbox.  I just want the default look and feel to scale the icon.  I managed to do that with a custom UI, which looks ok except I keep getting the box in the wrong x,y.  The w,h comes out fine but I can't figure out quite the right positioning calculation.  It is also odd the paintIcon method still only accepts int, while Graphics2D accepts doubles.

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