Article View: borland.public.jbuilder.java.language
Article #16316MouseEvent inside a for loop
From: Priscilla Wong
Date: Wed, 10 Mar 1999 00:00
Date: Wed, 10 Mar 1999 00:00
15 lines
1153 bytes
1153 bytes
Hello. I am now using Java to write a File manager. I use listRoots( ) to list out all the roots of the system and then use for-loop to create label for each root. Also each label is related to a root name, i.e. A:/, C:/, etc. Afterwards, i add the mouseListener to the label inside the for-loop. But i have a problem that i can't display the roots name when i click on a label. e.g. label[i] is related to rootsName[i], i want to display rootsName[i](which is a string) when i click on label[i]. The complier said that i use non-final variable. Could anyone tell me how can i do? I am glad to hearing to any advices. regards, Priscilla
Technical Details
Message-ID:
<36E56C8F.4B648640@hotmail.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,e555f84abd2f0bf9,start X-Google-Attributes: gidf74b3,public From: Priscilla Wong <prwong@hotmail.com> Subject: MouseEvent inside a for loop Date: 1999/03/10 Message-ID: <36E56C8F.4B648640@hotmail.com> X-Deja-AN: 453071810 Content-Transfer-Encoding: 7bit Organization: Another Netscape Collabra Server User Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language