Itβs a little difficult to tell what you are actually trying to do, but usually the size depends on the layout manager you are using. In any case, the following corrections are the button size, for example:
import swing._ import java.awt.Dimension val s = new Dimension(100, 100) val f = new Frame { contents = new FlowPanel { contents += new Button("huhu") { minimumSize = s maximumSize = s preferredSize = s } } } f.pack f.visible = true
user500592
source share