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


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

Re: Is there a method to update control size?

Path csiph.com!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Is there a method to update control size?
Date Thu, 31 May 2018 20:05:26 +0200
Organization A noiseless patient Spider
Lines 21
Message-ID <pepdje$sq2$1@dont-email.me> (permalink)
References <7a7e726d-051d-4f17-93ac-3dabdde80894@googlegroups.com> <pep4b3$qnp$1@dont-email.me> <959c54c7-9fb9-4bba-93c9-6983553999bf@googlegroups.com> <pepb3b$bpb$1@dont-email.me> <6d179195-f875-4bc0-bd96-465c4b6ca804@googlegroups.com> <pepcdg$jr8$1@dont-email.me> <c176ec49-e0b0-42f4-8b68-b2941e47fe48@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 7bit
Injection-Date Thu, 31 May 2018 18:06:38 -0000 (UTC)
Injection-Info h2725194.stratoserver.net; posting-host="ac2fb51c39738a4e35109bf9466fc77b"; logging-data="29506"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/75A1t/iHxx390I3Le8/0P"
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0
Cancel-Lock sha1:aNTVw1xHIKHown46RZeX7gI0Xok=
In-Reply-To <c176ec49-e0b0-42f4-8b68-b2941e47fe48@googlegroups.com>
X-Antivirus-Status Clean
Content-Language en-GB
X-Antivirus AVG (VPS 180531-0, 05/31/2018), Outbound message
Xref csiph.com comp.lang.java.programmer:38320

Show key headers only | View raw


On 2018-05-31 19:55, Eric Douglas wrote:
> On Thursday, May 31, 2018 at 1:46:37 PM UTC-4, Daniele Futtorovic wrote:
>>> Am I mistaken that JLabel and JPanel are often interchangeable?
>>
>> In my view, you are. A JLabel is for displaying text (and an optional
>> icon). A JPanel is a generic container. You should never have to add any
>> children to a JLabel. Your custom wrapper should extend JPanel instead.
>> Then everything else you wrote would make sense.
>>
> So far it appears to be working in this usage.  I don't recall if I specifically chose JLabel for a reason.  I'll try JPanel.

IIRC the default LayoutManager on a JPanel is BorderLayout, and a
BorderLayout automatically fills its central component to its bounds. So
you wouldn't need to touch the LM; just add the JScrollPane to the
JPanel with BorderLayout.CENTER constraint, then set the preferred size
on the JPanel (the container), and you can pass it as such to your
custom Window thingie.

-- 
DF.

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


Thread

Is there a method to update control size? Eric Douglas <e.d.programmer@gmail.com> - 2018-05-31 07:34 -0700
  Re: Is there a method to update control size? Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2018-05-31 17:20 +0200
  Re: Is there a method to update control size? Eric Sosman <esosman@comcast-dot-net.invalid> - 2018-05-31 11:28 -0400
    Re: Is there a method to update control size? Eric Douglas <e.d.programmer@gmail.com> - 2018-05-31 09:42 -0700
      Re: Is there a method to update control size? Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2018-05-31 19:22 +0200
        Re: Is there a method to update control size? Eric Douglas <e.d.programmer@gmail.com> - 2018-05-31 10:38 -0700
          Re: Is there a method to update control size? Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2018-05-31 19:45 +0200
            Re: Is there a method to update control size? Eric Douglas <e.d.programmer@gmail.com> - 2018-05-31 10:55 -0700
              Re: Is there a method to update control size? Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2018-05-31 20:05 +0200
                Re: Is there a method to update control size? Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2018-06-03 15:00 -0500
                Re: Is there a method to update control size? Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2018-06-04 02:25 +0200
      Re: Is there a method to update control size? Eric Sosman <esosman@comcast-dot-net.invalid> - 2018-05-31 15:55 -0400
        Re: Is there a method to update control size? Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2018-06-03 15:02 -0500

csiph-web