jPanel, printing colours (int)
Hi, I have an array of ints which represent an image and i want to display them as blocks of colour on a jpanel. I have looked through the docs, but I can't seem to make anything work!
My array pixelMap[]
,-8232397,-14798523,-4668741,-11453661,-13676685,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1256524,-9206366,-1,-4418443,-5782302,0
My jpanel...
JPanel panel =new JPanel(new GridLayout(7,5));
Dimension e =new Dimension(40,40);
for (int y = 0; y < 35; y++){
JPanel z =new JPanel();
z.setPreferredSize(e);
z.setBackground(?) );
panel.add(z);
}
JFrame f =new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(panel);
f.pack();
f.setLocationRelativeTo(null);
f.setVisible(true);
Thanks, Ron

