zl程序教程

您现在的位置是:首页 >  后端

当前栏目

java实现jframe透明窗体示例

JAVA 实现 示例 透明 窗体
2023-06-13 09:15:19 时间

复制代码代码如下:


importjavax.swing.JFrame;
publicclassTansluFrameextendsJFrame
{
   publicTansluFrame()
   {
       com.sun.awt.AWTUtilities.setWindowOpacity(this,0.6f);  
   }
   publicstaticvoidmain(String[]args)
   {
       TansluFrameframe=newTansluFrame();
       frame.setTitle("半透明的窗口");
       frame.setSize(400,300);
       frame.setVisible(true);
       frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
   }
}