构建不规则窗体

public static void main(String[] args)
	{

		JFrame.setDefaultLookAndFeelDecorated(true);
		SwingUtilities.invokeLater(new Runnable()
		{
			public void run()
			{
				Window win = new CrasyDownload();

				AWTUtilities.setWindowShape(win, new Ellipse2D.Double(0, 0, win
						.getWidth(), win.getHeight()));
// , win.getHeight()));
				AWTUtilities.setWindowOpaque(win, true);
				AWTUtilities.setWindowOpacity(win, 0.9f);
			}
		});
	}

  必须加上JFrame.setDefaultLookAndFeelDecorated(true);
 否则看不到效果

你可能感兴趣的:(不规则 窗体)