I am trying to get the Decimal point to display with the click of an GUI button. I using the method below, which works fine for the numbers but not the decimal point. Any advise would be great. thanks
private void displayWeightedquantity(ActionEvent event){
JButton currentButton = null;
JButton[] numberButtonsarray = {bnDecimal,bnZero,bnOne, bnTwo, bnThree, bnFour, bnFive,bnSix,bnSeven,
bnEight,bnNine};
currentButton = (JButton)event.getSource();
for (int i = 0; i <numberButtonsarray.length; i++){
if (currentButton == numberButtonsarray[i]){
lbDisplayitemQty.setText(lbDisplayitemQty.getText() + currentButton.getText());
break;
}
}
}
My virtual numberpad :