I want to draw a simple board made of Graphics2D rectangles but I also want to have one JButton under this board. I know the exact dimensions of this board in pixels and I was trying to deal with getContentPane()
method and BoxLayout, like this:
frame.getContentPane().add(board);
frame.getContentPane().add(Box.createRigidArea(new Dimension(bWidth, bHeight)));
frame.getContentPane().add(new JButton("Start"));
frame.pack();
But RigidArea isn't truly invisible and it overrides my drawings. Could you please give me some tips how to make it work properly? :( I wanted just one little button and it made me sit here for around 2 hours now...
Thanks!