ユーザーが選択肢を入力した後、プログラムは同じ選択肢を再び提供するように見え、その後完全にフリーズします。そこに設定されているのは、一度だけオプションを提供し(私は信じています)、次に以下の選択に従います. 代わりに、トップに戻ったように見え、奇妙な理由でフリーズします。しばらくそれを理解しようとしましたが、役に立ちませんでした。
public void init() //Initialize method {
    setSize(1000, 800); //Set size
    Container c = getContentPane();
    c.setBackground(Color.GREEN); //Set background
}    
public void paint(Graphics g)  {
    super.paint(g); //Start paint method
    g.setFont(new Font("Veranda", Font.PLAIN, 20));
    g.setColor(Color.BLACK);
    g.drawString("Hello", 250, 25); //top display message
    String number = JOptionPane.showInputDialog("Would you like a custom loop count or an infinite? 1. Custom 2. Infinite"); //test choice
    n = Integer.parseInt(number);
    while (n>0 || n<2)
    if (n==1) { 
            String number2 = JOptionPane.showInputDialog("How many times would you like to loop?");
            integer = Integer.parseInt(number2);
            while (integer>0)
                while (x < integer) {   
                    g.drawString("hi", 200, y); 
                    x+=1;
                    y = y+40; //test
                }//end while
    }//end if 
    else if (n==2)  {
        while (true); //im aware this is an endless loop. Can't find anything more stable for an endless one, so its just there for now..
    }//end if   
    else;
    g.drawString("Please pick a valid choice", 200, 200);               
}//end paint
}//end