Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #25307 > unrolled thread
| Started by | clusardi2k@aol.com |
|---|---|
| First post | 2013-09-20 12:43 -0700 |
| Last post | 2013-09-22 19:57 -0400 |
| Articles | 18 — 6 participants |
Back to article view | Back to comp.lang.java.programmer
Is there something better than ComponentListener on Resized clusardi2k@aol.com - 2013-09-20 12:43 -0700
Re: Is there something better than ComponentListener on Resized Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-09-20 17:16 -0400
Re: Is there something better than ComponentListener on Resized clusardi2k@aol.com - 2013-09-21 11:40 -0700
Re: Is there something better than ComponentListener on Resized Jeff Higgins <jeff@invalid.invalid> - 2013-09-21 22:46 -0400
Re: Is there something better than ComponentListener on Resized "clus@aol.com" <clusardi2k@aol.com> - 2013-09-30 08:08 -0700
Re: Is there something better than ComponentListener on Resized Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-09-30 11:29 -0400
Re: Is there something better than ComponentListener on Resized Jeff Higgins <jeff@invalid.invalid> - 2013-09-30 16:24 -0400
Re: Is there something better than ComponentListener on Resized Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-09-30 17:15 -0400
Re: Is there something better than ComponentListener on Resized "John B. Matthews" <nospam@nospam.invalid> - 2013-09-30 20:10 -0400
Re: Is there something better than ComponentListener on Resized Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-09-30 20:38 -0400
Re: Is there something better than ComponentListener on Resized Jeff Higgins <jeff@invalid.invalid> - 2013-09-30 22:16 -0400
Re: Is there something better than ComponentListener on Resized Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-09-30 22:32 -0400
Re: Is there something better than ComponentListener on Resized Jeff Higgins <jeff@invalid.invalid> - 2013-10-01 03:28 -0400
Re: Is there something better than ComponentListener on Resized Jeff Higgins <jeff@invalid.invalid> - 2013-10-01 03:41 -0400
Re: Is there something better than ComponentListener on Resized Arne Vajhøj <arne@vajhoej.dk> - 2013-10-01 20:04 -0400
Re: Is there something better than ComponentListener on Resized clusardi2k@aol.com - 2013-10-01 05:39 -0700
Re: Is there something better than ComponentListener on Resized Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-10-01 09:37 -0400
Re: Is there something better than ComponentListener on Resized "John B. Matthews" <nospam@nospam.invalid> - 2013-09-22 19:57 -0400
| From | clusardi2k@aol.com |
|---|---|
| Date | 2013-09-20 12:43 -0700 |
| Subject | Is there something better than ComponentListener on Resized |
| Message-ID | <aa287a36-de15-45eb-90a6-bb3f4e0e2853@googlegroups.com> |
The following code produced results which sometimes looked bad. I.E.: Resizing the window did not stop at my preferred width or the window had an unrealistic jerkly look to it. It's hard to discribe.
Is there some way other than the below code which will prevent resizing beyond a certain limit. I'm typed this in from a piece of paper!
myframe.addComponentListener(new ComponentAdapter()
{
@Override
public void componentResized (ComponentEvent e)
{
setSize (new Dimension (myPreferredWidth, getHeight()));
//super.coponentResized (e);
}
});
Thanks,
[toc] | [next] | [standalone]
| From | Eric Sosman <esosman@comcast-dot-net.invalid> |
|---|---|
| Date | 2013-09-20 17:16 -0400 |
| Message-ID | <l1iduk$smc$1@dont-email.me> |
| In reply to | #25307 |
On 9/20/2013 3:43 PM, clusardi2k@aol.com wrote:
> The following code produced results which sometimes looked bad. I.E.: Resizing the window did not stop at my preferred width or the window had an unrealistic jerkly look to it. It's hard to discribe.
>
> Is there some way other than the below code which will prevent resizing beyond a certain limit. I'm typed this in from a piece of paper!
>
> myframe.addComponentListener(new ComponentAdapter()
> {
> @Override
> public void componentResized (ComponentEvent e)
> {
> setSize (new Dimension (myPreferredWidth, getHeight()));
> //super.coponentResized (e);
> }
> });
It's not quite what you asked for, but would setResizable(false)
meet your need?
--
Eric Sosman
esosman@comcast-dot-net.invalid
[toc] | [prev] | [next] | [standalone]
| From | clusardi2k@aol.com |
|---|---|
| Date | 2013-09-21 11:40 -0700 |
| Message-ID | <419a414e-356f-4d1c-ab98-cc6613081bcd@googlegroups.com> |
| In reply to | #25309 |
On Friday, September 20, 2013 4:16:04 PM UTC-5, Eric Sosman wrote:
> On 9/20/2013 3:43 PM, clusk@aol.com wrote:
>
> > The following code produced results which sometimes looked bad. I.E.: Resizing the window did not stop at my preferred width or the window had an unrealistic jerkly look to it. It's hard to discribe.
>
> >
>
> > Is there some way other than the below code which will prevent resizing beyond a certain limit. I'm typed this in from a piece of paper!
>
> >
>
> > myframe.addComponentListener(new ComponentAdapter()
>
> > {
>
> > @Override
>
> > public void componentResized (ComponentEvent e)
>
> > {
>
> > setSize (new Dimension (myPreferredWidth, getHeight()));
>
> > //super.coponentResized (e);
>
> > }
>
> > });
>
>
>
> It's not quite what you asked for, but would setResizable(false)
>
> meet your need?
>
No, because I want one dimension to be resizable!
[toc] | [prev] | [next] | [standalone]
| From | Jeff Higgins <jeff@invalid.invalid> |
|---|---|
| Date | 2013-09-21 22:46 -0400 |
| Message-ID | <l1lllj$plo$1@dont-email.me> |
| In reply to | #25312 |
On 09/21/2013 02:40 PM, clusardi2k@aol.com wrote: LayoutManager
[toc] | [prev] | [next] | [standalone]
| From | "clus@aol.com" <clusardi2k@aol.com> |
|---|---|
| Date | 2013-09-30 08:08 -0700 |
| Message-ID | <db2d0fc9-8ff0-4b7c-b7d8-cf987960c0f2@googlegroups.com> |
| In reply to | #25313 |
On Saturday, September 21, 2013 10:46:10 PM UTC-4, Jeff Higgins wrote: > On 09/21/2013 02:40 PM, clus@aol.com wrote: LayoutManager How would I do this with GridLayout, since I'm using GridLayout. Here are the details. In a frame, I first add a push button at the top. Below the button I add two tables, side by side. The frame already resizes vertically to any length which is good. But, I want the frame to not resize horizontally beyond a certain hardcoded limit. I.E.: I want the frame to resize horizontally, but attempts to resize beyond a certain limit are prevented. So, if a user were to try to resize horizontally beyond the limit then the resulting horizontal width of the frame would be the limit. Thanks,
[toc] | [prev] | [next] | [standalone]
| From | Eric Sosman <esosman@comcast-dot-net.invalid> |
|---|---|
| Date | 2013-09-30 11:29 -0400 |
| Message-ID | <l2c5cd$j32$2@dont-email.me> |
| In reply to | #25394 |
On 9/30/2013 11:08 AM, clus@aol.com wrote:
> On Saturday, September 21, 2013 10:46:10 PM UTC-4, Jeff Higgins wrote:
>> On 09/21/2013 02:40 PM, clus@aol.com wrote: LayoutManager
>
> How would I do this with GridLayout, since I'm using GridLayout. Here are the details.
>
> In a frame, I first add a push button at the top. Below the button I add two tables, side by side.
>
> The frame already resizes vertically to any length which is good.
>
> But, I want the frame to not resize horizontally beyond a certain hardcoded limit. I.E.: I want the frame to resize horizontally, but attempts to resize beyond a certain limit are prevented. So, if a user were to try to resize horizontally beyond the limit then the resulting horizontal width of the frame would be the limit.
Perhaps it's time to ask a question: Why do you think it's a
good idea to prevent the user from arranging his own screen as
he pleases? Does your program understand the user's needs and
desires better than he himself does?
--
Eric Sosman
esosman@comcast-dot-net.invalid
[toc] | [prev] | [next] | [standalone]
| From | Jeff Higgins <jeff@invalid.invalid> |
|---|---|
| Date | 2013-09-30 16:24 -0400 |
| Message-ID | <l2cmlo$4ca$1@dont-email.me> |
| In reply to | #25395 |
On 09/30/2013 11:29 AM, Eric Sosman wrote: > On 9/30/2013 11:08 AM, clus@aol.com wrote: >> On Saturday, September 21, 2013 10:46:10 PM UTC-4, Jeff Higgins wrote: >>> On 09/21/2013 02:40 PM, clus@aol.com wrote: LayoutManager >> >> How would I do this with GridLayout, Shrugs: provide some code and perhaps we'll see. >> since I'm using GridLayout. Here >> are the details. >> >> In a frame, I first add a push button at the top. Below the button I >> add two tables, side by side. >> >> The frame already resizes vertically to any length which is good. >> >> But, I want the frame to not resize horizontally beyond a certain >> hardcoded limit. I.E.: I want the frame to resize horizontally, but >> attempts to resize beyond a certain limit are prevented. So, if a user >> were to try to resize horizontally beyond the limit then the resulting >> horizontal width of the frame would be the limit. > > Perhaps it's time to ask a question: Why do you think it's a > good idea to prevent the user from arranging his own screen as > he pleases? Does your program understand the user's needs and > desires better than he himself does? I've used such a program.
[toc] | [prev] | [next] | [standalone]
| From | Eric Sosman <esosman@comcast-dot-net.invalid> |
|---|---|
| Date | 2013-09-30 17:15 -0400 |
| Message-ID | <l2cpku$mau$1@dont-email.me> |
| In reply to | #25398 |
On 9/30/2013 4:24 PM, Jeff Higgins wrote:
> On 09/30/2013 11:29 AM, Eric Sosman wrote:
>> On 9/30/2013 11:08 AM, clus@aol.com wrote:
>>> On Saturday, September 21, 2013 10:46:10 PM UTC-4, Jeff Higgins wrote:
>>>> On 09/21/2013 02:40 PM, clus@aol.com wrote: LayoutManager
>>>
>>> How would I do this with GridLayout,
>
> Shrugs: provide some code and perhaps we'll see.
>
>>> since I'm using GridLayout. Here
>>> are the details.
>>>
>>> In a frame, I first add a push button at the top. Below the button I
>>> add two tables, side by side.
>>>
>>> The frame already resizes vertically to any length which is good.
>>>
>>> But, I want the frame to not resize horizontally beyond a certain
>>> hardcoded limit. I.E.: I want the frame to resize horizontally, but
>>> attempts to resize beyond a certain limit are prevented. So, if a user
>>> were to try to resize horizontally beyond the limit then the resulting
>>> horizontal width of the frame would be the limit.
>>
>> Perhaps it's time to ask a question: Why do you think it's a
>> good idea to prevent the user from arranging his own screen as
>> he pleases? Does your program understand the user's needs and
>> desires better than he himself does?
>
> I've used such a program.
Did you enjoy it? ;-)
That is: Did you consider it a benefit, a point in the
program's favor, when the program's window resisted all your
efforts to make it larger? Did this behavior improve your
experience of using the program?
--
Eric Sosman
esosman@comcast-dot-net.invalid
[toc] | [prev] | [next] | [standalone]
| From | "John B. Matthews" <nospam@nospam.invalid> |
|---|---|
| Date | 2013-09-30 20:10 -0400 |
| Message-ID | <nospam-FADF6D.20101430092013@news.aioe.org> |
| In reply to | #25399 |
In article <l2cpku$mau$1@dont-email.me>, Eric Sosman <esosman@comcast-dot-net.invalid> wrote: > >> Perhaps it's time to ask a question: Why do you think it's a > >> good idea to prevent the user from arranging his own screen as he > >> pleases? Does your program understand the user's needs and > >> desires better than he himself does? > > > > I've used such a program. > > Did you enjoy it? ;-) > > That is: Did you consider it a benefit, a point in the > program's favor, when the program's window resisted all your efforts > to make it larger? Did this behavior improve your experience of > using the program? I too have used such a program, almost daily, and I do not enjoy it. This example is somewhat contrived, but it gives the flavor of the experience. <http://stackoverflow.com/a/12532237/230513> -- John B. Matthews trashgod at gmail dot com <http://sites.google.com/site/drjohnbmatthews>
[toc] | [prev] | [next] | [standalone]
| From | Eric Sosman <esosman@comcast-dot-net.invalid> |
|---|---|
| Date | 2013-09-30 20:38 -0400 |
| Message-ID | <l2d5j4$jie$1@dont-email.me> |
| In reply to | #25400 |
On 9/30/2013 8:10 PM, John B. Matthews wrote:
> In article <l2cpku$mau$1@dont-email.me>,
> Eric Sosman <esosman@comcast-dot-net.invalid> wrote:
>
>>>> Perhaps it's time to ask a question: Why do you think it's a
>>>> good idea to prevent the user from arranging his own screen as he
>>>> pleases? Does your program understand the user's needs and
>>>> desires better than he himself does?
>>>
>>> I've used such a program.
>>
>> Did you enjoy it? ;-)
>>
>> That is: Did you consider it a benefit, a point in the
>> program's favor, when the program's window resisted all your efforts
>> to make it larger? Did this behavior improve your experience of
>> using the program?
>
> I too have used such a program, almost daily, and I do not enjoy it.
> This example is somewhat contrived, but it gives the flavor of the
> experience.
>
> <http://stackoverflow.com/a/12532237/230513>
Yeah, although I was thinking more about "accessibility,"
as it's now often called. Somebody with vision difficulties
may well use a
M U C H L A R G E R F O N T
M U C H L A R G E R F O N T
M U C H L A R G E R F O N T
than the programmer gifted with good eyesight had anticipated.
The large-font user might not be pleased at being forced to
scroll back and forth and back and forth instead of just making
the damn' window wider.
Now, perhaps the programmer is foresighted enough to
calculate his NoBiggerThan dimension based on the chosen font
size (if that's straightforward; I don't know how well Java
font metrics interact with externally-imposed overrides).
But wouldn't it be simpler just to let the user adjust the
window to whatever dimensions he likes?
We programmers grow accustomed to issuing commands to our
computers, telling them what to do in every circumstance (the
entire art of debugging amounts to discovering how our own
commands differ from what we really meant). The tendency to
treat the users as extensions of our computers -- to command
them the same way we do the machines -- must be resisted.
Clusardi: If your goal proves difficult or even impossible
to achieve, that may not be entirely a Bad Thing. Try to look
on the bright side, and strike a blow for libertarianism.
--
Eric Sosman
esosman@comcast-dot-net.invalid
[toc] | [prev] | [next] | [standalone]
| From | Jeff Higgins <jeff@invalid.invalid> |
|---|---|
| Date | 2013-09-30 22:16 -0400 |
| Message-ID | <l2db9n$d53$1@dont-email.me> |
| In reply to | #25399 |
On 09/30/2013 05:15 PM, Eric Sosman wrote: > On 9/30/2013 4:24 PM, Jeff Higgins wrote: >> On 09/30/2013 11:29 AM, Eric Sosman wrote: >>> On 9/30/2013 11:08 AM, clus@aol.com wrote: >>>> On Saturday, September 21, 2013 10:46:10 PM UTC-4, Jeff Higgins wrote: >>>>> On 09/21/2013 02:40 PM, clus@aol.com wrote: LayoutManager >>>> >>>> How would I do this with GridLayout, >> >> Shrugs: provide some code and perhaps we'll see. >> >>>> since I'm using GridLayout. Here >>>> are the details. >>>> >>>> In a frame, I first add a push button at the top. Below the button I >>>> add two tables, side by side. >>>> >>>> The frame already resizes vertically to any length which is good. >>>> >>>> But, I want the frame to not resize horizontally beyond a certain >>>> hardcoded limit. I.E.: I want the frame to resize horizontally, but >>>> attempts to resize beyond a certain limit are prevented. So, if a user >>>> were to try to resize horizontally beyond the limit then the resulting >>>> horizontal width of the frame would be the limit. >>> >>> Perhaps it's time to ask a question: Why do you think it's a >>> good idea to prevent the user from arranging his own screen as >>> he pleases? Does your program understand the user's needs and >>> desires better than he himself does? >> >> I've used such a program. > > Did you enjoy it? ;-) > > That is: Did you consider it a benefit, a point in the > program's favor, when the program's window resisted all your > efforts to make it larger? Did this behavior improve your > experience of using the program? > Oh. I was responding to your comment concerning the program(mer) who perhaps understands my needs and desires better than I do. Many programmers provide sensible default behavior for users, like me, who might not be familiar with the program or even the subject matter. I don't recall seeing a GUI behavior such as clus@aol.com describes, but maybe the subject matter warrants such.
[toc] | [prev] | [next] | [standalone]
| From | Eric Sosman <esosman@comcast-dot-net.invalid> |
|---|---|
| Date | 2013-09-30 22:32 -0400 |
| Message-ID | <l2dc7p$h0i$1@dont-email.me> |
| In reply to | #25402 |
On 9/30/2013 10:16 PM, Jeff Higgins wrote:
> On 09/30/2013 05:15 PM, Eric Sosman wrote:
>> On 9/30/2013 4:24 PM, Jeff Higgins wrote:
>>> On 09/30/2013 11:29 AM, Eric Sosman wrote:
>>>> On 9/30/2013 11:08 AM, clus@aol.com wrote:
>>>>> On Saturday, September 21, 2013 10:46:10 PM UTC-4, Jeff Higgins wrote:
>>>>>> On 09/21/2013 02:40 PM, clus@aol.com wrote: LayoutManager
>>>>>
>>>>> How would I do this with GridLayout,
>>>
>>> Shrugs: provide some code and perhaps we'll see.
>>>
>>>>> since I'm using GridLayout. Here
>>>>> are the details.
>>>>>
>>>>> In a frame, I first add a push button at the top. Below the button I
>>>>> add two tables, side by side.
>>>>>
>>>>> The frame already resizes vertically to any length which is good.
>>>>>
>>>>> But, I want the frame to not resize horizontally beyond a certain
>>>>> hardcoded limit. I.E.: I want the frame to resize horizontally, but
>>>>> attempts to resize beyond a certain limit are prevented. So, if a user
>>>>> were to try to resize horizontally beyond the limit then the resulting
>>>>> horizontal width of the frame would be the limit.
>>>>
>>>> Perhaps it's time to ask a question: Why do you think it's a
>>>> good idea to prevent the user from arranging his own screen as
>>>> he pleases? Does your program understand the user's needs and
>>>> desires better than he himself does?
>>>
>>> I've used such a program.
>>
>> Did you enjoy it? ;-)
>>
>> That is: Did you consider it a benefit, a point in the
>> program's favor, when the program's window resisted all your
>> efforts to make it larger? Did this behavior improve your
>> experience of using the program?
>>
> Oh. I was responding to your comment concerning the program(mer)
> who perhaps understands my needs and desires better than I do.
> Many programmers provide sensible default behavior for users,
> like me, who might not be familiar with the program or even
> the subject matter. I don't recall seeing a GUI behavior such as
> clus@aol.com describes, but maybe the subject matter warrants such.
Sorry for the misunderstanding.
It's certainly possible that Clusardi's situation does in fact
make such Thou Shalt Not behavior desirable, perhaps useful or even
essential. That's why I raised the question: Not to deny that there
could be a reason, but to ensure that the reason had actually been
examined and evaluated.
I guess there are three questions, really:
1) Is the size restriction really desirable?
2) If (1), then must it be applied to the entire frame
rather than to a sub-component like an interior JPanel?
3) If (2), then Clusardi's original question: "How?"
Maybe if the reasons for "Yes" answers to (1) and (2) were
made public, somebody might have a better idea how to answer
(3) -- or how to do something different but satisfactory.
--
Eric Sosman
esosman@comcast-dot-net.invalid
[toc] | [prev] | [next] | [standalone]
| From | Jeff Higgins <jeff@invalid.invalid> |
|---|---|
| Date | 2013-10-01 03:28 -0400 |
| Message-ID | <l2dtim$mgn$1@dont-email.me> |
| In reply to | #25403 |
On 09/30/2013 10:32 PM, Eric Sosman wrote: > On 9/30/2013 10:16 PM, Jeff Higgins wrote: >> On 09/30/2013 05:15 PM, Eric Sosman wrote: >>> On 9/30/2013 4:24 PM, Jeff Higgins wrote: >>>> On 09/30/2013 11:29 AM, Eric Sosman wrote: >>>>> On 9/30/2013 11:08 AM, clus@aol.com wrote: >>>>>> On Saturday, September 21, 2013 10:46:10 PM UTC-4, Jeff Higgins >>>>>> wrote: >>>>>>> On 09/21/2013 02:40 PM, clus@aol.com wrote: LayoutManager >>>>>> >>>>>> How would I do this with GridLayout, >>>> >>>> Shrugs: provide some code and perhaps we'll see. >>>> >>>>>> since I'm using GridLayout. Here >>>>>> are the details. >>>>>> >>>>>> In a frame, I first add a push button at the top. Below the button I >>>>>> add two tables, side by side. >>>>>> >>>>>> The frame already resizes vertically to any length which is good. >>>>>> >>>>>> But, I want the frame to not resize horizontally beyond a certain >>>>>> hardcoded limit. I.E.: I want the frame to resize horizontally, but >>>>>> attempts to resize beyond a certain limit are prevented. So, if a >>>>>> user >>>>>> were to try to resize horizontally beyond the limit then the >>>>>> resulting >>>>>> horizontal width of the frame would be the limit. >>>>> >>>>> Perhaps it's time to ask a question: Why do you think it's a >>>>> good idea to prevent the user from arranging his own screen as >>>>> he pleases? Does your program understand the user's needs and >>>>> desires better than he himself does? >>>> >>>> I've used such a program. >>> >>> Did you enjoy it? ;-) >>> >>> That is: Did you consider it a benefit, a point in the >>> program's favor, when the program's window resisted all your >>> efforts to make it larger? Did this behavior improve your >>> experience of using the program? >>> >> Oh. I was responding to your comment concerning the program(mer) >> who perhaps understands my needs and desires better than I do. >> Many programmers provide sensible default behavior for users, >> like me, who might not be familiar with the program or even >> the subject matter. I don't recall seeing a GUI behavior such as >> clus@aol.com describes, but maybe the subject matter warrants such. > > Sorry for the misunderstanding. > > It's certainly possible that Clusardi's situation does in fact > make such Thou Shalt Not behavior desirable, perhaps useful or even > essential. That's why I raised the question: Not to deny that there > could be a reason, but to ensure that the reason had actually been > examined and evaluated. > > I guess there are three questions, really: > > 1) Is the size restriction really desirable? > > 2) If (1), then must it be applied to the entire frame > rather than to a sub-component like an interior JPanel? > > 3) If (2), then Clusardi's original question: "How?" > > Maybe if the reasons for "Yes" answers to (1) and (2) were > made public, somebody might have a better idea how to answer > (3) -- or how to do something different but satisfactory. > Oops. I need to learn to read, or at least pay attention. I missed the fact that we were discussing the resize behavior of a top level window. Not really sure how one would go about that. Maybe back to the listener route.
[toc] | [prev] | [next] | [standalone]
| From | Jeff Higgins <jeff@invalid.invalid> |
|---|---|
| Date | 2013-10-01 03:41 -0400 |
| Message-ID | <l2duad$q34$1@dont-email.me> |
| In reply to | #25406 |
On 10/01/2013 03:28 AM, Jeff Higgins wrote: > Oops. I need to learn to read, or at least pay attention. > I missed the fact that we were discussing the resize behavior > of a top level window. Not really sure how one would go about that. > Maybe back to the listener route. > Or maybe there's a way to disable the gripper when you reach a size? Shrug. Over and out.
[toc] | [prev] | [next] | [standalone]
| From | Arne Vajhøj <arne@vajhoej.dk> |
|---|---|
| Date | 2013-10-01 20:04 -0400 |
| Message-ID | <524b6323$0$292$14726298@news.sunsite.dk> |
| In reply to | #25399 |
On 9/30/2013 5:15 PM, Eric Sosman wrote: > On 9/30/2013 4:24 PM, Jeff Higgins wrote: >> On 09/30/2013 11:29 AM, Eric Sosman wrote: >>> On 9/30/2013 11:08 AM, clus@aol.com wrote: >>>> On Saturday, September 21, 2013 10:46:10 PM UTC-4, Jeff Higgins wrote: >>>>> On 09/21/2013 02:40 PM, clus@aol.com wrote: LayoutManager >>>> >>>> How would I do this with GridLayout, >> >> Shrugs: provide some code and perhaps we'll see. >> >>>> since I'm using GridLayout. Here >>>> are the details. >>>> >>>> In a frame, I first add a push button at the top. Below the button I >>>> add two tables, side by side. >>>> >>>> The frame already resizes vertically to any length which is good. >>>> >>>> But, I want the frame to not resize horizontally beyond a certain >>>> hardcoded limit. I.E.: I want the frame to resize horizontally, but >>>> attempts to resize beyond a certain limit are prevented. So, if a user >>>> were to try to resize horizontally beyond the limit then the resulting >>>> horizontal width of the frame would be the limit. >>> >>> Perhaps it's time to ask a question: Why do you think it's a >>> good idea to prevent the user from arranging his own screen as >>> he pleases? Does your program understand the user's needs and >>> desires better than he himself does? >> >> I've used such a program. > > Did you enjoy it? ;-) > > That is: Did you consider it a benefit, a point in the > program's favor, when the program's window resisted all your > efforts to make it larger? Did this behavior improve your > experience of using the program? The program was hard to code - only fair if it is also hard to use. :-) :-) :-) I mean UX does mean "User eXpel" right? :-) Arne
[toc] | [prev] | [next] | [standalone]
| From | clusardi2k@aol.com |
|---|---|
| Date | 2013-10-01 05:39 -0700 |
| Message-ID | <a4d1b7c8-690a-4e9f-b5ca-88cd9bbe5dde@googlegroups.com> |
| In reply to | #25395 |
> On Monday, September 30, 2013 11:29:16 AM UTC-4, Eric Sosman wrote: > Perhaps it's time to ask a question: Why do you think it's a good idea to > prevent the user from arranging his own screen as he pleases? Does your program > understand the user's needs and desires better than he himself does? I want to prevent the user from horizontally resizing the window beyond a certain width because (if I didn't) anything to the right of my two tables would be a a solid gray color of nothing. So, without the functionality that I want, if the user resizes the window it will look somthing like this exaggerated example: [][]|||||| Where I represent a table with [] and gray solid areas are represented by |. The code that I've, unsuccessfully, tried to use is similar to the code here: http://docs.oracle.com/javase/tutorial/uiswing/layout/gridbag.html
[toc] | [prev] | [next] | [standalone]
| From | Eric Sosman <esosman@comcast-dot-net.invalid> |
|---|---|
| Date | 2013-10-01 09:37 -0400 |
| Message-ID | <l2ej65$a46$1@dont-email.me> |
| In reply to | #25413 |
On 10/1/2013 8:39 AM, clusardi2k@aol.com wrote:
>> On Monday, September 30, 2013 11:29:16 AM UTC-4, Eric Sosman wrote:
>> Perhaps it's time to ask a question: Why do you think it's a good idea to
>> prevent the user from arranging his own screen as he pleases? Does your program
>> understand the user's needs and desires better than he himself does?
>
> I want to prevent the user from horizontally resizing the window beyond a certain width because (if I didn't) anything to the right of my two tables would be a a solid gray color of nothing.
>
> So, without the functionality that I want, if the user resizes the window it will look somthing like this exaggerated example:
>
> [][]||||||
>
> Where I represent a table with [] and gray solid areas are represented by |.
Maybe the user will find the blank gray expanses soothing?
In any event, they're of his own making -- and he can un-make
them again if he finds them objectionable. I sincerely doubt
that your efforts to protect him from his own faulty aesthetic
sense are worth while.
> The code that I've, unsuccessfully, tried to use is similar to the code here:
>
> http://docs.oracle.com/javase/tutorial/uiswing/layout/gridbag.html
Notice that this page is in a section whose title is
"Lesson: Layout Out Components *Within* a Container" [emphasis
mine]. You can control the sizes and layouts of things *inside*
a top-level container pretty closely, but the TLC itself is a
creature of the native windowing system, sized and positioned
(and decorated, hidden, revealed, ...) by that native system.
You're free to provide hints -- for example, the layout manager
of the frame's content pane can suggest the pane's dimensions --
but the native windowing system is not obliged to honor your
suggestions. (This is viewed as a Good Thing, because it gives
your desktop app a fighting chance of being usable on a teeny-
tiny phone screen, for example.)
To put it more simplistically: Java doesn't own "the screen"
and has no layout manager for it.
--
Eric Sosman
esosman@comcast-dot-net.invalid
[toc] | [prev] | [next] | [standalone]
| From | "John B. Matthews" <nospam@nospam.invalid> |
|---|---|
| Date | 2013-09-22 19:57 -0400 |
| Message-ID | <nospam-F55B22.19571722092013@news.aioe.org> |
| In reply to | #25312 |
In article <419a414e-356f-4d1c-ab98-cc6613081bcd@googlegroups.com>, clusardi2k@aol.com wrote: > I want one dimension to be resizable! BoxLayout; override get*Size() for the reasons mentioned here: <http://stackoverflow.com/q/7229226/230513> -- John B. Matthews trashgod at gmail dot com <http://sites.google.com/site/drjohnbmatthews>
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.java.programmer
csiph-web