我在弄清楚如何爲選項窗格中使用的選項指定名稱/標題,以便我可以在if語句中使用它們。這裏是我到目前爲止的代碼: int i = 0;
while(i<1){
JFrame frame = new JFrame();
String[] options = new String[2];
options[0] = new String("Peat");
我想從我的主類調用我的JOptionPane 的方法。 有沒有具體的方法來做到這一點? Dictionary word1 = new Dictionary(null);
CardCatalog catalog = new CardCatalog();
final ImageIcon welcome = new ImageIcon("welcome.jpg");
JOptionPane.sh
我有這樣的代碼: int rev=0;
int opt=Integer.parseInt(JOptionPane.showInputDialog("How many numbers do you need?"));
for (int i=0; i<numbers; i++) {
int numbers=Integer.parseInt(JOptionPane.showInputDia
如何區分正數和負數?我有這樣的代碼: import java.util.ArrayList;
import java.swing.JOptionPane;
public class Test {
public static void main(String[] args) {
ArrayList al = new ArrayList();
int num=
如何刪除重複的號碼並要求用戶添加新號碼以替換重複的號碼?比方說,用戶要求5號碼:使用我做的代碼6, 7, 8, 7, 9,輸出Number 7 was duplicated in position 3 現在我需要,是要求用戶添加一個新的號碼,以取代7這樣就不會有幫助任何重複。 所以我希望整個輸出爲Your numbers without duplicates:,它會打印輸入的數字而不會有任何重複。