i think this is kind of what ur looking for , though its a jtextfield i think most of the essential stuff can transfer over



add(getJTextField0(), //the constrains and stuff);

//the method...