更新时间:2022-06-27 05:53:35
创建一个类并将其扩展到 JButton,如下所示,您可以在那里更改与 JButton 相关的所有类型.
create a class and extend it to JButton like below and there you can change all sort of things that has to do with JButton.
import javax.swing.JButton;
public class CustomJButton extends JButton {
public CustomJButton() {
this.setText("Custom JButton");
// initialize
}
// add your own methods or override JButton methods
public void myFunc(){
}
}