gpt4 book ai didi

java - 使 JPanel 透明以查看框架后面?

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

我知道如何做异型或半透明 JFrame ,但我希望在我的框架中有一个半透明的矩形区域,以便用户可以看到后面的内容。
我不知道如何做到这一点并截取框架后面的屏幕截图对我不起作用,因为我真的希望用户看到框架后面的动态变化。

最佳答案

but I would like to have a rectangular zone in my frame which would be translucent so the user can see what is behind.


  • JFrame有一个 BorderLayout , BorderLayout有5个区域,
  • 利用来自 BorderLayout 的这一优势, 创建 Translucent JFrame并留下 CENTER区域半透明,在其他区域放置一个不透明面板。
  • mabye 现在,有真正的理由混合 AWT (不支持透明和半透明)与 Swing ,你可以把AWT PanelsNORTH , SOUTH , EASTWEST地区

  • a screen capture of what is behind the frame is not working for me, because I want really that the user dynamical change behind the frame.


  • Screen Image by @camickr
  • 关于java - 使 JPanel 透明以查看框架后面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13605589/

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