import java.awt.*; import javax.swing.*; public class TwoDArrayDemo { public static void main(String[] argv) { String input; int rows, cols, range; int sum=0; input = JOptionPane.showInputDialog("Enter # of rows"); rows = Integer.parseInt(input); input = JOptionPane.showInputDialog("Enter # of columns"); cols = Integer.parseInt(input); input = JOptionPane.showInputDialog("Enter range of data"); range = Integer.parseInt(input); JTextArea textarea = new JTextArea(20,100); //textarea.setLineWrap( true ); textarea.setFont( new Font("Courier",Font.BOLD,18) ); JScrollPane scrollpane = new JScrollPane(textarea); int [][] A2 = new int [rows][cols]; //*** 2D array of ints //first index is row, second is column int []freq = new int[range]; //frequency/count of each value for (int i=0; i