Search code examples
java-melwuit

How to place a Button in the center of a row?


I want to place a Button in the center of a row of a Container , the Button is the only component of the Container. How to achieve that ?


Solution

  • Container c = new Container(new FlowLayout(Component.CENTER)); 
    Button b = new Button(); 
    c.addComponent(b);