0
사용자가 대화 상자에 다양한 문자열과 정수를 입력하고 싶지만 모든 정보가 포함 된 최종 출력을 하나의 대화 상자에 표시하고 싶습니다. 이것은 내가 가지고있는 것입니다 :하나의 대화 상자에 여러 개의 출력을 표시하려고합니다. 어떻게해야합니까?
JOptionPane.showMessageDialog("Product Name" + inv[i].getName(), JOptionPane.PLAIN_MESSAGE);
JOptionPane.showMessageDialog("Product Type" + theItem.getType(), JOptionPane.PLAIN_MESSAGE);
JOptionPane.showMessageDialog("Product Number", + theItem.getpNumber(), JOptionPane.PLAIN_MESSAGE);
JOptionPane.showMessageDialog("Amount of Units in Stock", + theItem.getUnits(), JOptionPane.PLAIN_MESSAGE);
JOptionPane.showMessageDialog("Price per Unit", + theItem.getPrice(), JOptionPane.PLAIN_MESSAGE);
JOptionPane.showMessageDialog("Total cost for %s in stock: $%.2f", theItem.getName(), theItem.calculateTotalPrice(), JOptionPane.PLAIN_MESSAGE);
제쳐두고, 나는 그 발췌 문장이 어떻게 컴파일 될 수 있는지를 알 수 없습니다. –