Author Topic: Java Arrays of objects  (Read 2008 times)

Java Arrays of objects
on: March 27, 2006, 15:32:01 PM
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

Code: [Select]


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

Code: [Select]
thumbLbl[] = thumbLbl[files.length];

but its wrong. Any ideas folks?

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

Re:Java Arrays of objects
Reply #1 on: March 27, 2006, 15:47:59 PM
lol what a gimp :)

Twas easy.

Code: [Select]

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


Dah cant believe I couldnt think of it. :D

0 Members and 1 Guest are viewing this topic.