How can i use a string name as an onject name.please help!

hi it seems like an easy one but i can not find it anywhere.how can i use the name of a string as a name of an object such as the code(my problem is the code)...
public void oda(String name1){ 
String name2=name1+"s";
String name3=name1+"ss";
TextArea name1=new TextArea();
TextArea name2=new TextArea();
TextArea name3=new TextArea();
i think my problem is clear but to be sure..
how can i give a name to an object in my textarea which is already using as a string.
thank u .

it get very compilcated to change the name of the object you created. identity is something you don't want to mess with..you can do it by usin reflection, but it will slow down your application and (again) is quite complicated...
a simple solution (and more object-oriennted) is to create a Wrapper, Decorator, or Extends the class.
example
public class MyTextBox{
    private String name = null;
    private boolean value = false;
    private JTextArea txtArea = null;
    public MyTextBox(String name, boolean value){
        txtArea = new JTextArea();
        this.value = value;
        this.isOn = isOn;
    public String getComponentName(){  return name; }
    pubic boolean getComponentValue(){ return value; }
    public JTextArea getTextArea(){ return area; }
}

Similar Messages

Maybe you are looking for

  • Asset Scrapping - Calculating Depreciation for entire year

    Hi guys We want to scrap an asset without revenue using ABAVN. Asset Details: The asset will be completely depreciated by the end of this year (December) We have smoothing indicator on. We wish to post the retirement and close out the asset balances

  • I am trying to set up my iCloud on my iPod

    I am trying to set up my iCloud account on my iPod using my current Apple ID but it says that my Apple ID is valid but I have used all the free accounts on the device. Can anyone help me to set it up? I way to use my current Apple ID plus I have no i

  • Does java has problem storing floating point numbers?

    Hi just a quick question. I have been programming in java at least 4, 5 year by now and I feel rather comfortable with programming in java. However, just other day I hit problem with java which I was hoping someone on this forum can fill in for me. N

  • BI-Content Install Help Required Please....I am Stumped

    I've just installed NW 2004 SP1, successfully with ABAP+JAVA on one machine. Am presently applying support package stack 14. When I try to install the BI 3.53 Content add on I am having problems...:( The system does not seem to have BI-Cont installed

  • Is there a command on Windows to install the latest version of software?

    yum can install the latest version of software on Linux system, I am wondering whether there is a similar command on Windows platform?