错误修正
import javax.swing.*;
public class test4{
public static void main(String args[]){
int a[] = new int [10];
for (int counter =0; counter<=a.length;counter++)
a[counter] = 2*counter;
String output ="INDEX\tVALUE\n";
for (int counter=0; counter<=a.length; counter++)
output += counter+"\t"+a[counter]+"\n";
JTextArea outputArea = new JTextArea();
outputArea.setText(output);
JOptionPane.showMessageDialog( null, outputArea,"shuzu",JOptionPane.INFORMATION_MESSAGE);
System.exit( 0 );
}
}