1个回答
展开全部
import java.awt.Color;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class JFDemo extends JFrame {
public JFDemo() {
JPanel jp = new JPanel();
jp.setBackground(Color.RED);
add(jp);
setSize(300, 300);
setLocationRelativeTo(null);
setUndecorated(true);//不显示边框
setOpacity(0.3f);//透明度30%
setVisible(true);
setDefaultCloseOperation(EXIT_ON_CLOSE);
}
public static void main(String[] args) {
new JFDemo();
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询