This is my own custom layout manager that I created for Java. This Layout Manager is called MatthewLayout. The class named MatthewLayout is the layout manager I created. You use this layout manager to specify x, y, width and heights of components such as jbutton and jlabel. Example code is in main() function in MatthewLayout class. To use MatthewLayout layout manager you create a XYWidthHeight object for each component to add to the layout manager. For eg) To add a JButton object to a layout manager: you do this code: panel.add(new JButton("Hello World"), new XYWidthHeight(0,0,1,1)); Remember example code for to use Layout Manager is in MatthewLayout class. This example code is in main() function in MatthewLayout class. To create MatthewLayout object you need to specify value "true" in constructor. For eg) panel.setLayout(new MatthewLayout(true));
Features
- A grid layout manager