i有一个splitpane,其中正确的组件是一个选项卡式窗格,每个选项卡都是jinternalframe。此JinternalFrame包含AWT面板(我的应用程序需要使用本机句柄传达其他JNI调用)。我在splitpane UI中有一个连续的布局设置为false。现在,当我滑动拆分窗格分隔器时,它落在AWT面板后面。如何解决此Z订单问题。
请参考我已附加的以下图像。 现在我正在附加代码。import javax.swing.*;
import javax.swing.plaf.basic.BasicSplitPaneDivider;
import javax.swing.plaf.basic.BasicSplitPaneUI;
import java.awt.*;
public class SplitPaneExample {
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> {
JFrame frame = new JFrame("SplitPane Example");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(800, 600);
// Create left component
JPanel leftPanel = new JPanel();
leftPanel.add(new JLabel("Left Component"));
// Create right component
JTabbedPane tabbedPane = new JTabbedPane();
JInternalFrame internalFrame = new JInternalFrame("Internal Frame", true, true, true, true);
internalFrame.setSize(400, 300);
internalFrame.setVisible(true);
// Create a layered pane to manage z-order
// Create the AWT Panel
Panel awtPanel = new Panel();
awtPanel.setBackground(Color.CYAN);
awtPanel.add(new Label("AWT Panel inside JInternalFrame"));
// Add AWT Panel to internal frame
internalFrame.add(awtPanel);
internalFrame.pack();
internalFrame.setVisible(true);
// Add internal frame to tabbed pane
tabbedPane.addTab("Tab 1", internalFrame);
// Create SplitPane
JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftPanel, tabbedPane);
splitPane.setDividerLocation(200);
// Add splitPane to layeredPane
frame.add(splitPane);
frame.setVisible(true);
});
}
}
我试图使用jlayeredpane保存splitpane/ tabbedpane/ awt面板...但是什么都没有用。任何建议或解决方法都高度赞赏。 在此层次结构中,以其他方式获得JNI的任何建议也受到了高度赞赏。
我尝试使用jlayeredpane保存splitpane/ tabbedpane/ awt 面板...但是什么都没有用。
任何建议或解决方法都高度赞赏。任何建议 在此层次结构中获得JNI的替代方法也是 高度赞赏