public static void main(String[] args){

        final int N = 10;
        final int[] values = new int[N];

    for (int i = 0; i < N; i++) values[i] = 0;
    final Frame frame = new Frame("Random test");
    Canvas canvas = new Canvas(){
         public void paint(Graphics g){
            g.setColor(new Color(255,255,255));
            g.fillRect(0,0,getWidth(),getHeight());
         }
         public void update(Graphics g){
            int max = 0;
            g.setColor(Color.WHITE);
            g.fillRect(0,0,getWidth(),getHeight());
            for (int i = 0; i < 1000; i++) values[(int)Math.round(Math.floor(Random.getGaussian(0, N)))] += 1;
            for (int i = 0; i < N; i++) if (max < values[i]) max = values[i];

            g.setColor(Color.BLACK);
            for (int i =  0; i < N; i++){
                g.fillRect(i * this.getWidth() / N, this.getHeight() - values[i] * this.getHeight() / max,
                        this.getWidth() / N, values[i] * this.getHeight() / max);
            }
         }
    };
    frame.add(canvas);
        canvas.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent e) {
                ((Canvas) e.getSource()).repaint();
            }
        });
    frame.addWindowListener(new WindowAdapter() {
        @Override
        public void windowClosing(WindowEvent e) {
            frame.dispose();
        }
    });
    frame.setSize(800, 500);
    frame.setVisible(true);

    canvas.repaint();
    }