java - BorderLayout correct syntax -


as far know syntax of add method

add(component , string);  

ex.

add(new button("north"), borderlayout.north); 

but saw syntax of add method in class , passses compilation proccess.

add(string , component); 

and below add method :

add("north", new button("north"));  

can explain me happened here , if going work , why ?

has shown in java doc, container class has 5 different add() methods overloads

in first example, borderlayout.north constant defining position of component in container.

in second example, "north" name give component.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -