如何创建与scala BoxPanel一起使用的水平或垂直支柱和胶水?

Dan*_*itz 4 swing scala

在Java中,类java.swing.Box包含用于创建水平和垂直支柱和粘合的方法.使用BoxLayout时,Struts和glue对于space元素非常有用.

Box.createHorizontalStrut(10)
Box.createVerticalStrut(10)

Box.createHorizontalGlue()
Box.createVerticalGlue()
Run Code Online (Sandbox Code Playgroud)

我在哪里可以找到scala中的相应方法?

Dan*_*itz 5

我在scala Swing伴侣对象中找到了方法:

import swing.Swing

Swing.HStrut(10)
Swing.VStrut(10)

Swing.HGlue
Swing.VGlue
Run Code Online (Sandbox Code Playgroud)