Meaningless Drivel is fun!*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes add() method for components Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "add() method for components" Watch "add() method for components" New topic
Author

add() method for components

Angela Narain
Ranch Hand

Joined: Apr 14, 2001
Posts: 327
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

Joined: Mar 30, 2001
Posts: 23
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

Joined: Apr 13, 2001
Posts: 13
In Container class:
public Component add(string name,component)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: add() method for components
 
Similar Threads
Grid Layout
Adding listeners to Components
Null is not an instanceof Object
Interesting Ques SJCP Must See
object accessiblity question ?