import java.awt.*;
import javax.swing.*;
public class Test extends JFrame{
public Test(){
this.setSize(500,500);
this.setDefaultCloseOperation(this.EXIT_ON_CLOSE);
this.setResizable(false);
this.setLayout(null);//屏蔽 默认布局
JButton button = new JButton("Test");
int x = 30;//坐标x
int y = 30;//坐标y;
int width = 200;//组件宽
int height = 200;//组件高
button.setBounds(x,y,width,height);
this.getContentPane().add(button);
}
public static void main(String [] args){
new Test().setVisible(true);
}
}