I am trying to prevent a JPanle to get so small that it cuts off it subcomponents, is there anyway to enforce this? After reading this I tried (in jython):
frame= JFrame('example', size=(200,200))
pan = JPanel()
pan.add(JLabel('beer'))
pan.add(JButton('get one', actionPerformed=printer))
pan.setMinimumSize(panel.getPreferredSize())
frame.add(pan)
frame.visible = True
however the panel can still be shrunk so far that it cuts off its components (in a JFrame or here), even if I apply the minimum size to the frame. How does one prevent this? ( I assume the preferred size I am getting si not what I want since with the default layout manager it seems to be the size of the largest subcomponent, but if I change it to e.g. GridBagLayout
it seems to get smaller 9apply minsize to frame and try)