JAVA怎么写不规则窗口?比如圆形什么滴.......
package 程序;
import java.awt.BorderLayout;
import javax.swing.JFrame;
import 程序.Frame2;
public class Frame1 extends JFrame {
public Frame1() {
try {
jbInit();
} catch (Exception exception) {
exception.printStackTrace();
}
}
private void jbInit() throws Exception {
getContentPane().setLayout(borderLayout1);
this.setSize(500, 500);
this.setResizable(false);
this.setUndecorated(true);//没有边框
this.setLocationRelativeTo(null);
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
}
public static void main(String[] args) {
int i;
Frame1 f1 = new Frame1();
f1.setVisible(true);
for (i = 0; i < 999999999; i++) {
}
if (i <= 999999999) {
f1.dispose();
}
Frame2 f2 = new Frame2();
f2.setVisible(true);
}
BorderLayout borderLayout1 = new BorderLayout();
}