> The problem is this: If I minimize any of the internal frames, the
> getAllFrames() method still returns those frames in its list. However,
[quoted text clipped - 5 lines]
> minimized JInternalFrame get transformed into some other kind of object
> when it's minimized?
You can't transform an object from one type into another (but see the
strategy pattern). What I believe happens during minimisation is that
the JInternalFrame is removed and replaced by its matching
JInternalFrame.JDesktopIcon. JDesktopPane.getAllFrames looks as if it
returns all the internal frames, whether they are minimised or not.
As a complete guess, you are not calling getName on a minimised
JInternalFrame, but on its JInternalFrame.JDesktopIcon. Possibly through
JDesktopPane.getComponents or similar.
You can easily see what a component is by dumping either it or its class
and hashCode to System.err. You can see the whole window's contents by
pressing shift-control-F1.
I would tend to keep track of components though a mechanism other than
name. Name works okay if each child component is different. For instance
a Look & Feel managing the subcomponents of a JComboBox. But for general
use, I'd avoid.
Tom Hawtin

Signature
Unemployed English Java programmer
http://jroller.com/page/tackline/
dan.goyette@gmail.com - 15 Apr 2006 06:00 GMT
Your guess was right no. After doing a bit of getClass() printing it
turns out that when the JInternalFrame is minimized getClass() returns
"JInternalFrame$JDesktopIcon". Thanks for the intuition.
I know the Javadoc for JDesktopIcon advises not to use the API for
JDesktopIcon, however I'm planning to use one method, getInternalFrame,
such that I can still access the original JInternalFrame even if it
happens to be minimized.
Thanks for you help.
-Dan