[英]How to disable JButton without changing background on Netbeans
輕松:保留實例變量“ isButtonEnabled”,而不是啟用或禁用按鈕,而是更改此按鈕的值。
然后,您需要做的所有事情:
public void actionPerformed(ActionEvent event){
if ( isButtonEnabled){
// the actual code
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.