🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #12646

Re: Making a ScalingPane...

#12646
From: John P. McGrath
Date: Sat, 05 Dec 1998 00:00
31 lines
1621 bytes
Johan Forsberg <jfo@stmf.se> wrote:

> Unfortunately there are two problems.

I have some ideas that you might try.  I am basing these on reading I 
have done, not on code I have written, so I could be way off the mark.  
If you try either of these ideas, please let us know how it works out.

> 1) In some situations (when clicking in them for instance) 
> subcomponents are repainted directly without going through 
> my paintChildren() method, and so they are redrawn unscaled
> in their 'real' positions.

You might try overriding getGraphics() rather than paint Children().
 
> 2) MouseEvents are passed directly to the subcomponents, 
> even if my Pane is set to receive MouseEvents. I've looked
> everywhere, but found no way to intercept them.

Try placing a transparent component in the JFrame's JLayeredPane, 
directly above the components in question.  Then this new component 
should get the mouse events, rather than the other components.  You 
could then perform whatever translations you want on the events and 
send them on to the other components.

-- 
Regards,

John P. McGrath
<mcgrath@enter.net>
<jpm@nscs.fast.net>
Technical Details
Message-ID: <MPG.10d2cfc247c22f42989742@forums.inprise.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <01be1df7$a2f14100$6bcc79c0@pc4107.stmf.se>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,835f9c1b9550c0fb
X-Google-Attributes: gid111d45,public
From: mcgrath@enter.net (John P. McGrath)
Subject: Re: Making a ScalingPane...
Date: 1998/12/05
Message-ID: <MPG.10d2cfc247c22f42989742@forums.inprise.com>
X-Deja-AN: 418906754
References: <01be1df7$a2f14100$6bcc79c0@pc4107.stmf.se>
Organization: Software Consulting Services
Newsgroups: borland.public.jbuilder.java.swing