private JButton addButton(String text,Container container,float alignment){
  JButton button=new JButton(text);
  button.setAlignmentX(alignment);
  container.add(button);
  return button;
}

private JButton addButton ( String text , Container container , float alignment ) { JButton button = new JButton ( text ) ; button . setAlignmentX ( alignment ) ; container . add ( button ) ; return button ; }
adds a preconfigured jbutton to the specified container using the specified alignment constraint . does not modify the button ' s border .
