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
Post a Comment