Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

add() method for components

 
Angela Narain
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suppose "bt" is an instance of a class that extends Frame.
We set BorderLayout manager.
Now is it possible to a button in the following manner :
Button b = new Button("ok");
bt.add("North", b );
I donot know in which class we have this type of overloaded add method ?
 
g krishnan
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
it is the method of container,
public void add(Component comp,
Object constraints)
Object constraints refers the North, South etc, check with API
 
jayu jadhav
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Container class:
public Component add(string name,component)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic