Buat tombol ayunan Java baru

JButton button = new JButton("Button text");

frame.add(button);
Mikicrep