how to add a button to java app code example Example: how to create a button in java JButton button = new JButton();