import javax.swing.JButton;
publicclass Main {
publicstaticvoid main(String[] argv) throws Exception {
JButton button = new JButton();
// Change the label
button.setText("New Label");
// Remove the label; this is useful for a button with only an icon
button.setText(null);
}
}