gpt4 book ai didi

java - GridLayout 面板上的面板

转载 作者:行者123 更新时间:2023-11-30 04:12:50 25 4
gpt4 key购买 nike

是否可以在具有 GridLayout 图像的面板上显示面板(例如几乎透明的面板 A)?

JPanel mainPanel = new JPanel(new BorderLayout());

JPanel gridOfImages = new JPanel(new GridLayout(3,3));//Panel with a grid of images
JPanel nearlyOpaquePanel = new JPanel(); //A panel that is almost transparent.

// assuming that all already have the required properties like size and colour.

mainPanel.add(gridOfImages,Borderlayout.CENTER);
mainPanel.add(nearlyOpaquePanel,BorderLayout.CENTER);

我对这个想法的想法是,面板将堆叠在一起,并且 gridOfImages 将通过 nearlyOpaquePanel 显示,但我的结果是我只得到 nearlyOpaquePanel 显示,但我无法通过它看到 gridOfImages

最佳答案

关于java - GridLayout 面板上的面板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19206006/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com