JFrame JDialog透明

  1.         JFrame.setDefaultLookAndFeelDecorated(true );  
  2.         SwingUtilities.invokeLater(new  Runnable() {  
  3.             public   void  run() {  
  4.                 Window w = new  TranslucentWindow();  
  5.                 w.setVisible(true );  
  6.   
  7.         //要使窗口透明,您可以使用 AWTUtilities.setWindowOpacity(Window, float) 方法   
  8.                 com.sun.awt.AWTUtilities.setWindowOpacity(w, 0 .5f);  
  9.             }  
  10.          });

你可能感兴趣的:(dialog)