基本的には、JTextfield が編集可能かどうかを切り替えるボタンであるはずです
これを行うためのより良い方法があるとほぼ100%確信しています(これは機能しません)forループを推測していますか?
while (e.getSource() == button2)
{
int count=0;//odd
if (count % 2 == 0) // if count is even
{
textField1.setEditable(false);
button2.setEnabled(true);
count++;
}
else//odd
{
textField1.setEditable(true);
count++;
}
}