java-JFrame(绝对布局)
package Demo;import java.awt.Container;import javax.swing.JButton;
import javax.swing.JFrame;@SuppressWarnings("serial")
public class demo7 extends JFrame{
public demo7(String title){setTitle(title);setLayout(null); setBounds(200,200,500,500); Container container = getContentPane(); JButton jButton1 = new JButton("按钮1");JButton jButton2 = new JButton("按钮2");jButton1.setBounds(10, 30,80,30); jButton2.setBounds(60, 70,100,20);container.add(jButton1);container.add(jButton2);setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);setVisible(true);}public static void main(String[] args) {new demo7("我的JFrame");}}