public static void main(String[] args) {
JFrame j = new JFrame();
JPanel p =new JPanel();
j.setSize(600, 400);
j.setUndecorated(true);
j.setLocationRelativeTo(null);
/**
* 设置背景透明
*/
j.setBackground(new Color(0,0,0,0));
j.setVisible(true);
/**
* 添加border
*/
j.add(p);
p.setBackground(new Color(0,0,0,0));
p.setBorder(new LineBorder(new Color(255, 0, 0)));
}