2

I have 5 JInternalFrames in one JDesktopPane. I have to keep 4 JInternalFrames iconified and keep only 1 active. But when I maximize 1 JinternalFrame, other iconified JInternalFrames goes behind it, so I have to iconify the active JInternalFrame and then restore the required one.

Is there a way that I can keep all my Iconified JInternalFrames on top always?

4

2 回答 2

4

使用JDesktopPane.setComponentZOrder(java.awt.Component, int)并确保图标化的框架位于未图标化的层之上。

于 2012-07-24T12:40:10.410 回答
0

我不确定这对你的情况是否有帮助,但如果你想有一个特定的顺序(例如,一个 JInternalFrame 应该总是在其他人之前),那么就不要使用 JDesktopPane。只需使用 DefaultPane:

默认:

setContentPane(new JDesktopPane());  // Will bring the currently activated JInternalFrame to top
add(frame_A);
add(frame_B);
add(frame_C);

总在最前面:

// setContentPane(new JDesktopPane()); // Dont use the DesktopPane
add(frame_A); // Will always be on top
add(frame_B); // Will always be in front of frame c but behind frame a
add(frame_C);
于 2013-02-12T13:23:41.360 回答