SQL

Friday, 22 January 2016

GUI 3 Java Layout Manager and Absolute Positioning

There are two approach to put button on a frame's content pane.

  • Using Layout Manager
  • Using Absolute Positioning

If you like to use absolute position then you must use 

setLayout(null);
setBounds(X screen, Y screen, Button Width, Button Height)

Absolute Positioning:






Layout Manager:

When you use Layout Manager like FlowLayout Manager then GUI objects are placed Top to Bottom ,from left to right. X and Y coordinates plus button size automatically created.





Post a Comment