私はJavaが初めてです。1 つの textField と 1 つのボタンを持つプロジェクトを作成します。ボタンの関数を作成し、そこで他の関数を開始しますが、問題ありません。しかし、関数のパラメーターとして textField から数値を取得する必要があります...
b1.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
{
int price;
int quantity = Integer.parseInt(tf2.getText());
int totalamount = price*quantity;
//need to insert this total amout into textfield tf4 //
tf4.getText(totalamount); //showing error ;
}
});
助けてください、よろしくお願いします