我在列表框中添加int qty和string getname時遇到了一些問題,顯示的錯誤位於中間的jlist.add中。任何幫助,請謝謝!如何將字符串和int添加到按鈕中的列表框中
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt)
{
int id = Integer.parseInt(jTextField1.getText());
int qty = Integer.parseInt(jTextField2.getText());
purchasecontroller.PurchaseProduct(id, qty);
String getname = displaycontroller.SearchbyProductName(id);
jLabel4.setText("" + getname);
jLabel3.setText("" + qty);
jList1.add("" + getname + "" qty);
String getprice = displaycontroller.SearchbyProductPrice(id);
int total = qty * Integer.parseInt (getprice);
jLabel11.setText("" + total);
}
jList1.add(「」+ getname +「」+ qty);我無法補充說這個問題,添加是強調紅色! ,它聲稱找不到符號
*什麼*的錯誤,特別是? –
什麼是錯誤?你究竟在哪裏得到了問題? – Smit
jList1.add(「」+ getname +「」+ qty);我無法補充說這個問題,添加是強調紅色! ,它表示找不到符號 –