I’m trying to set the size of a button to a specific size of pixels with minimumSize, but it looks like it doesn’t work.
I even tried to subclass it and do it this way
class SizedButton(text0: String, width0: Int, height0: Int)
extends Button(text0) {
minimumSize = new Dimension(width0, height0)
// also tried preferredSize here ...
}
but that didn’t work either.
It’s a bit hard to tell what you’re really trying to do, but generally sizing depends a lot on the layout manager you are using. Anyway the following fixes the size of a button e.g.: