/Java_21_Panel_Demo_1

Program shows that how panels are displayed in the container. each panel can have different layouts and different gui components within them.

Primary LanguageJava

Java_21_Panel_Demo_1

Overview

1 - This program is showing the basics of a JPanel that we can use in this regard to have different parts on our Container.

2 - then we make an array of Buttons and we set its size to 5 as we want 5 buttons.

3 - then we set the layout of the 5 butttons to be a grid layout, this is considered in the panel! (we want to first make the buttons in a row (panel) then put them south side of the canvas(Container)).

4 - lasty, we give the panel a BorderLayout of it being on the south side of our container.