我知道如何制作成形或半透明的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
区域保持半透明,在其他地区。也许现在,有真正的理由将
AWT
(不支持透明度和半透明)与Swing
混合,您可以放置AWT 面板
到NORTH
、SOUTH
、EAST
和WEST
区域
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.
关于java - 使 JPanel 透明以查看框架后面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13605589/