Import the library import javax.swing.JFrame;
JButton jb = new JButton (fill in the initial content of the button here); When the content of the
button needs to be changed later (such as: minesweeping), the following methods can be used to change it.
①jb.setText(s);//s is a variable of string type
②jb.setText("Changed content");