Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Insets purpose??  RSS feed

 
Barry Brashear
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the purpose of the GridBagContraints Insets class and how is it
used?

Thanks.
 
Paul Clapham
Sheriff
Posts: 22374
42
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, the documentation for the class says

"An Insets object is a representation of the borders of a container. It specifies the space that a container must leave at each of its edges. The space can be a border, a blank space, or a title."
 
Ken Blair
Ranch Hand
Posts: 1078
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Better yet is GridBagConstraints documentation on how it uses Insets:

This field specifies the external padding of the component, the minimum amount of space between the component and the edges of its display area.


Given GridBagConstraints g, any component added using g will have g.insets.top and g.insets.bottom added to it's preferred height and g.insets.left and g.insets.right added to it's preferred width when determining it's display area. It's display area in the case of a GridBagLayout is the size of it's cell. Note that other components in the same row or column may affect the cell's width or height as well.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!