View Single Post
  #4 (permalink)  
Old 05-09-2008, 05:08 AM
kewlgeye kewlgeye is offline
Member
 
Join Date: Apr 2008
Posts: 33
kewlgeye is on a distinguished road
JOptionPane Display Difficulties
This is what I changed. it compiles, but I am still not able to start a new line after 40 numbers show.

Code:
public class MyAction implements ActionListener{ public void actionPerformed(ActionEvent e){ String input = JOptionPane.showInputDialog(null, "Enter the size of the array: "); int arraySize = //console.nextInt(); Integer.parseInt(input.trim()); int[] list = new int[arraySize]; for (int arrayIndex = 0; arrayIndex < list.length; arrayIndex++){ list[arrayIndex] = arraySize - arrayIndex;} values = Arrays.toString(list); if ((arraySize - 0 + 1) % 40 != 0) JOptionPane.showMessageDialog(frame, values + " " + "are your numbers", "Your Silly Numbers", JOptionPane.INFORMATION_MESSAGE); } }
Reply With Quote