Case of using a glass panel or laminated panel

I was always a little fuzzy in the difference between glass glass and laminated panel. Is glass glass essentially just the “topmost layer of the root panel” or does it behave differently? When would you use a laminated panel instead of a glass panel?

+4
source share
1 answer

These are two different things:

  • the tiered area is the destination of all the content that is added or displayed inside the JFrame . For example, every normal component like JLabels , JTextFields , JTable , etc. In addition, it forces the z-order of the elements that are added to it, so it can handle pop-up menus or drag and drop effects: this is because the pop-up menu is added to the multi-level panel with az exceeding the normal components, with the final effect to stay on top of others of things. See here for a better understanding of behavior.

  • The glass panel is an optional layer, which is hidden by default and remains on top of the layer anyway. Thus, basically everything that you draw on glass glass will always be visible: you can think of it as a transparent sheet that is applied at the top of a regular JFrame that you can use, you need special effects.

Both the laminated panel and the glass glass are placed on the root panel, which is the basis from which each frame is created.

+8
source

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


All Articles