1.你可以使用AWTUtils类绘制,需要较高版本JDK支持。2.引入JNA的Jar包。// Case 2 // System.setProperty("sun.java2d.noddraw", "true");WinShape win = new WinShape(); win.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); win.setLayout(new BorderLayout());// Must to add this win.setUndecorated(true); win.getContentPane().setBackground(Color.white);JLabel imageLabel = new JLabel(icon);win.getContentPane().add(imageLabel); win.setSize(800, 600);// Case 1 // AWTUtilities.setWindowOpaque(win, false); // AWTUtilities.setWindowOpacity(win, 0.5f);// Case 2 // WindowUtils.setWindowTransparent(win, true); win.setLocationRelativeTo(null); win.setVisible(true);