Changing the Label of a JButton Component
See also Creating a Multiline Label for a JButton Component.
// To create a button, see Creating a JButton Component
// Change the label
button.setText("New Label");
// Remove the label; this is useful for a button with only an icon
button.setText(null);
Post a comment