News:

Tekforums.net - The improved home of Tekforums! :D

Main Menu

Java Arrays of objects

Started by M3ta7h3ad, March 27, 2006, 15:32:01 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

M3ta7h3ad

I feel so n00bish for posting this but has to be done as ive drawn a blank and my brain is empty.

I have the following



javax.swing.JLabel [] thumbLbl = new javax.swing.JLabel();



but now I want to initialise that array with a size.

I thought it was something along the lines of

thumbLbl[] = thumbLbl[files.length];

but its wrong. Any ideas folks?

This is such a simple question just I cant remember it.

M3ta7h3ad

lol what a gimp :)

Twas easy.


javax.swing.JLabel thumbLbl = new javax.swing.JLabel[files.length];


Dah cant believe I couldnt think of it. :D