Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2005

Tip: Looking for answers? Try searching our database.

MacOSX growbox question

Thread view: 
aurengo@wanadoo.fr - 29 Aug 2005 08:50 GMT
Hi,

I have a problem with growing a JFrame which displays an array of, say n
images.
I use a combo box which sets on how many lines and columns these images
are displayed. When lines x columns < n, buttons enable to navigate
among the subset of visible images.
When I grow or shrink the JFrame (with the growbox) I increase in real
time either the number of lines or columns or both if the window size
becomes broad and/or high enough.
When the mouse button is released, the JFrame is sometimes in an
intermediate position (for example too broad than necessary to display
the images but not broad enough to increase the column count). I should
then like to pack() my JFrame (which my combo box action realizes
perfectly).
The problem is that I can't get any "mouseReleased" event on which I
could fire my packing function, since a click in the growbox does not
seem to fire any MouseEvent. I tried to catch such MouseEvents in the
JFrame itself, in its glassPane, rootPane, contentPane and in the
component inside the JFrame ; none works.
Thanks for your help and suggestions
Thomas Hawtin - 29 Aug 2005 10:48 GMT
> The problem is that I can't get any "mouseReleased" event on which I
> could fire my packing function, since a click in the growbox does not
> seem to fire any MouseEvent. I tried to catch such MouseEvents in the
> JFrame itself, in its glassPane, rootPane, contentPane and in the
> component inside the JFrame ; none works.
> Thanks for your help and suggestions

JFrame is a Frame and uses the native component to handle resizing and
the like. On Linux/UNIX the application can crash and the window still
be resizable. Only recently have frame's minimum bounds been taken into
consideration. It therefore become tricky to do anything about it from Java.

If the PL&F supports setUndecorated, it is possible to replace JFrames
decorations with Java ones. Neither Windows nor Gtk PL&F support that,
apparently because it is not necessary.

Tom Hawtin
Signature

Unemployed English Java programmer
http://jroller.com/page/tackline/

aurengo@wanadoo.fr - 29 Aug 2005 21:34 GMT
Bad news but a good light on my problem. Thank you very much.

Thomas Hawtin a écrit:

>> The problem is that I can't get any "mouseReleased" event on which I
>> could fire my packing function, since a click in the growbox does not
[quoted text clipped - 13 lines]
>
> Tom Hawtin
Scott Ellsworth - 01 Sep 2005 00:28 GMT
> The problem is that I can't get any "mouseReleased" event on which I
> could fire my packing function, since a click in the growbox does not
> seem to fire any MouseEvent. I tried to catch such MouseEvents in the
> JFrame itself, in its glassPane, rootPane, contentPane and in the
> component inside the JFrame ; none works.
> Thanks for your help and suggestions

I was about to tell you to look at isPopupTrigger in both mousePressed
and mouseReleased, as this is different between the Mac and Windows,
then realized that it probably will not help - you are not doing a popup
menu.

Best guess I have now is that the native component is eating the click
in the growbox before Java is ever seeing it.

Try posting this in java-dev, the Apple java development list hosted at
lists.apple.com, and see if anyone there has ever heard of it.

Scott

Signature

Scott Ellsworth
scott@alodar.nospam.com
Java and database consulting for the life sciences

aurengo@wanadoo.fr - 05 Sep 2005 06:38 GMT
I think your guess is right : the click event is probably consumed and
"Java" is never aware of it.
Thanks for your suggestion, I will try to post my question to an Apple
Java development forum.

a écrit:

>>The problem is that I can't get any "mouseReleased" event on which I
>>could fire my packing function, since a click in the growbox does not
[quoted text clipped - 15 lines]
>
> Scott


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.