java - helppppppp

Discussion in 'Software' started by e_f_w_a, Oct 16, 2004.

  1. e_f_w_a

    e_f_w_a Private E-2

    let's say i add some component like this
    add(new JTextArea(16,50));

    how can i refer to it (with setText method for example)?
     
  2. QuickSilver

    QuickSilver Corporal

    hmmm my Java is a little rusty but if you did it like this:

    JTextArea textBox1 = new JTextArea(16,50);
    add(textBox1);

    Then for using methods on that object you can just use
    textBox1 etc.

    Not sure about the syntax of my code but do you get the idea?

    Hope that helps anyway...
     
  3. e_f_w_a

    e_f_w_a Private E-2

    it's not what i'm looking for...
    i don't want to name the component . how can i use him without name definition?
     
  4. QuickSilver

    QuickSilver Corporal

    hmmm in that case I am confused... if you do not name the object how can you hope to invoke methods on it?
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds