with multiple players only the first created is in the foreground

Using JMF 2.1.1, I can create multiple players. There's some fishy behavior though. The application has a JFrame, with a JTabbedPane. Within the JTabbedPane, there are a number of JInternalFrame's - each containing a lightweight Player.

1. The first created player with always be in the foreground. Selecting other players, or moving them around the screen does not bring the video to the foreground. In fact, if they get cascaded, the video is always seen in the order the players were created.

Is there a way to bring a player into the foreground?

2. Moving the JInternalFrame's around the visible area, it behaves strangely at the edges of the application area. The video can actually overlap slightly, the boundary of the JTabbedPane, for example.

thanks in advance

gene

2.

[824 byte] By [gearheadgenea] at [2007-11-27 10:16:05]
# 1

some additional info:

With more than 1 tabbed pane, the video in each tab are quite independant from other tabs. Within a tab, that's when overlapping the players is foobar.

gearheadgenea at 2007-7-28 15:43:26 > top of Java-index,Security,Cryptography...
# 2

getting closer . . .

My containers were wrong. This works closer to correct behavior:

JTabbedPane

|_ JScrollPane

|_JDesktopPane

|_JInternalFrame

|-Player

|-ControlPanel

In order to have the layered affect, the the JInternalFrames needed to belong to a layeredPane, which the JDesktopPane is correct.

Now I can select a JInternalFrame (with it's player) and the video comes to the foreground.

Remaining problems:

1. The JinternalFrame still seems to run at a lower level - that is, moving the frame around, the border of the JInternalFrame (and the title bar) will be obscurred by other video players. Same holds true for the control bar.

gearheadgenea at 2007-7-28 15:43:26 > top of Java-index,Security,Cryptography...
# 3

I have found the root of my problem: you cannot mix heavy and lightweight components very easily. The description at

http://java.sun.com/products/jfc/tsc/articles/mixing/

describes and has perfect examples of what is happening to me. The Player method getVisualComponent() returns a java.awt.Component, and that's the problem!

The heavy weight awt objects are over writing the light weight swing components.

****! Anybody know how to change that? I already use the "lightweight renderer" hint in the manager. Trying to cast the player to javax.swing.JComponent will compile, but bombs at run-time. I'd hate to switch over to all heavyweight awt components just to fix this up.

gearheadgenea at 2007-7-28 15:43:26 > top of Java-index,Security,Cryptography...