From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Front to back positioning in GUI
Date: Wed, 16 Dec 2009 22:47:05 +0000 (UTC)
Organization: TACT Computer Systems Ltd
Lines: 21
Message-ID: <hgbo19$q9i$>
References: <hgb1ha$39l$> <hgb3dd$6i7$> <hgb50c$kkl$> <hgb677$9dv$> <hgbavo$ifd$> <hgbe6a$gp1$> <hgbm5d$rvm$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: 1261003625 26930 (16 Dec 2009 22:47:05 GMT)
NNTP-Posting-Date: Wed, 16 Dec 2009 22:47:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 642467
Xref: comp.soft-sys.matlab:593259

"Yair Altman" <altmanyDEL@gmailDEL.comDEL> wrote in message <hgbm5d$rvm$>...
> "Matt Fig" <> wrote in message 
> [snip]
> > There might be a way to set the objects to transparent using JAVA, but I think I will leave that one to Yair Altman.  
> > 
> > Calling Yair Altman!
> Unfortunately, Matlab uicontrols are encased within heavyweight java.awt.Panel containers, which cannot be made transparent. I don't know why MathWorks chose to use heavyweight Panels instead of lightweight javax.swing.JPanels that would have enabled transparent controls and used less resources. I have suggested this improvement a year or two ago to the relevant people, but received no feedback. Maybe the reason is that when Java-based figures were first developed a decade ago, Swing was not yet available, and today nobody really wants to touch this code ("don't fix it if it ain't broke...").
> A more technical description:
> BTW, this is also the reason uicontrols always appear on top of axes, regardless of their Java z-order or Matlab stack order. It is also the reason Matlab controls are all Java Peers instead of regular Swing components.
> Yair Altman

Strike the sentence about uicontrols always appearing on top of axes because of the lightweight/heavyweight issue - it's not exactly correct: axes also use an opaque AxisCanvas and you can actually hide uicontrols beneath axes if you switch their parent containers' z-order. Sorry if this addendum doesn't clarify things - sometimes an attempt to simplify and be concise causes inadvertent inaccuracies.