public MapViewer(int[][] rgbArray, String title, Dimension dmx) {
        this.rgbAr = rgbArray;
        this.setTitle("MapViewer- " + title);
        this.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);

        if (dmx == null) {
            dmx = new Dimension(rgbArray[0].length, rgbArray.length);
        }
        int height = (int) dmx.getHeight() + 100;
        int width = (int) dmx.getWidth() + 100;
        this.setMinimumSize(new Dimension(width, height));
        this.setPreferredSize(new Dimension(width, height));
        Container cont = this.getContentPane();

        cont.setLayout(new GridLayout());

        JPanel jpx = new MapViewer.mapPanel(rgbAr);

        cont.add(jpx);

        this.setVisible(true);


    }