ACCTG 1 Lecture Notes - Lecture 11: Fat Client, Layout Manager, Javafx

12 views10 pages
6 Sep 2020
School
Department
Course
Professor

Document Summary

Flow layout: by default, a jpanel uses a flow layout, a flow layout simply arranges its components from left to right and starts a new row when there is no room in the current row. Border layout: another commonly used layout manager is the border layout, the border layout groups components into 5 areas (center, north, south, west, It is the default layout manager for a frame, but you can also use it in a panel: panel. setlayout(new borderlayout()): now the panel is controlled by a border layout, not the flow layout. When adding a component, you specify the position like this: panel. add(component, borderlayout. north); If not desirable, you need to place each component inside a panel: to create a grid layout, you supply the number of rows and columns in the constructor, then add the components row by row, left to right. Jpanel buttonpanel = new jpanel(); buttonpanel. setlayout(new gridlayout(4, 3)); buttonpanel. add(button7); buttonpanel. add(button8); buttonpanel. add(button9); buttonpanel. add(button4);

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents