即使我启用了按钮,按钮默认也被禁用

时间:2019-06-24 09:51:58

标签: java jbutton netbeans-8

即使指定了要启用的按钮,它也会一直被禁用

我尝试将启用代码放置在不同的区域,但是没有任何效果。

btn_Receipt.setEnabled(true);
btn_Reset.setEnabled(true);
txtA_ProofOfPurchase.setEnabled(true);

double deposit = Double.parseDouble(JOptionPane.showInputDialog("Please specify the amount of money that you would like to withdraw (in Rands)"));

String name = "Nia Sanderson";
String action ="Deposit";

txtA_ProofOfPurchase.setText
    ("******************************* \nNedbank Online Banking  " +
      "\nCustomers Name: " + name +
      "\nAction: " + action +
      "\nDeposit Amount: R " + deposit + 
      "\n*******************************"      
    );

我希望输出结果会启用两个按钮和文本区域

0 个答案:

没有答案