Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Generated Object

A javax.swing.border.EmptyBorder, a border whose margins are not painted with anything.

Value Argument

Either an Integer or an array of four Integers. 

A single integer is expanded to an array of four integers of the same value.

An array of four integers is used to generate the top, left, bottom, and right margins, respectively.

If a value argument is used then the top:, left:, bottom:, and right: attributes cannot be used. 


If any of top:, left:, bottom:, or right: are specified the all of them must be specified.

  • top <int> the top margin of the border
  • left <int> the left margin of the border
  • bottom <int> the bottom margin of the border
  • right <int> the right margin of the border
  • parent <boolean> Whether or not this border is to be added to the parent JComponent


emptyBorder() is a leaf node, no child content is allowed.


Code Block

panel {
    emptyBorder([6,6,3,3], parent:true)

emptyBorder(top:5, left:15, bottom:15, right:5) 


Do work:

Code Block
border: BorderFactory.createEmptyBorder(0,3,0,3)
border: emptyBorder([0,3,0,3])
border: emptyBorder(top:0,left:3,bottom:0,right:3)

Does not work:

Code Block
border: emptyBorder(0,3,0,3)
border: emptyBorder(top:3)