What is the difference between TabPanel and TabLayoutPanel in GWT

What is the difference between TabPanel and TabLayoutPanel in GWT? I can’t find the answer on Google and it’s hard to understand how to read documents

+4
source share
2 answers

TabLayoutPanel is a layout panel: it is the size of the external input, it must be given explicit measurements, and they will be notified when they are changed ( RequiresResize ), and it will resize its children in the same way and notify them when this happens ( ProvidesResize )

TabPanel not; it has a size from the smallest of them: it will resize depending on the size of the widget on the selected tab.

+11
source

Addition to what Thomas says

There are two types of panels in GWT for arranging widgets on the screen: Panels (for example: TabPanel) and Layout Panels (for example: TabLayoutPanel)

Panels or panels without layout

These panels (TabPanel, DockPanel, Horizontal panel, Vertical panel, AbsolutePanel ...) allow you to explicitly display widgets. It will display widgets as imagined (subject to the correct imagination;)). Its child widgets do not automatically resize when the browser is resized.

Breadboard panels

These panels (TabLayoutPanel, DockLayoutPanel, ScrollPanel, FlexTable, SplitLayoutPanel ...) allow you to explicitly display widgets, but also change the size of the child widget when resizing the browser, because each of them implements RequiresResize and / or providesResize , provided that you maintain a hierarchy of panels layout throughout and provide the size of panels and widgets as a percentage.

Sources: GWT Documents and Personal Experience

+10
source

Source: https://habr.com/ru/post/1468980/


All Articles