Question for those familiar with MigLayout
Sorry, I could not come up with a more suitable name for the question ...
I am trying to create a layout that will look like this:
+---------+---------+ | btn1 | btn2 | +---------+---------+ | | | btn3 | | | +-------------------+
when changing the window size, the btn1 and btn2 components should fill the x axis (half of each), and the btn3 component should fill both the x axis and all available space along the y axis.
how would you achieve this?
here is the code to start:
public static void main(String[] args) { JFrame window = new JFrame(); window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Container cp = window.getContentPane(); cp.setLayout(new MigLayout("")); cp.add(new JButton("btn1"), ""); cp.add(new JButton("btn2"), ""); cp.add(new JButton("btn3"), ""); window.pack(); window.setVisible(true); }
java swing miglayout
pstanton
source share