Access an object by its name as string
From: Wiz (wiz_at_near.it)
Date: 12/22/03
- Next message: Christophe Vanfleteren: "Re: Access an object by its name as string"
- Previous message: Adam: "Re: Work/paint/thread mixing"
- Next in thread: Christophe Vanfleteren: "Re: Access an object by its name as string"
- Reply: Christophe Vanfleteren: "Re: Access an object by its name as string"
- Reply: Antti S. Brax: "Re: Access an object by its name as string"
- Reply: Vincent Vollers: "Re: Access an object by its name as string"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 22 Dec 2003 12:23:55 +0100
Hi there,
I have some JTextField objects, called jtf0, jtf1, jtf2, and so on.
How I can access their properties by their names known as string? For
instance:
for(int i=0; i<10; i++) {
function_to_get_a_reference("jtf" + i).setText("hello " + i);
}
Does a function like this exist? With other languages I'd use the eval()
function, but I couldn't fint it in Java.
Thanks in advance to everyone can help me.
Bye
Marco
ps: sorry for my bad english..
- Next message: Christophe Vanfleteren: "Re: Access an object by its name as string"
- Previous message: Adam: "Re: Work/paint/thread mixing"
- Next in thread: Christophe Vanfleteren: "Re: Access an object by its name as string"
- Reply: Christophe Vanfleteren: "Re: Access an object by its name as string"
- Reply: Antti S. Brax: "Re: Access an object by its name as string"
- Reply: Vincent Vollers: "Re: Access an object by its name as string"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]