I was originally using setSize but this resulted in the on screen content being slightly bigger than the screen due to java borders and title room. So I used setpreferredSize and now the screen size is slightly too big. leaving a space around the right and bottom sides of my content.
In my JFrame:
add(new Board());
setTitle("Rougebot");
setDefaultCloseOperation(EXIT_ON_CLOSE);
//setSize(600, 800);
//getContentPane().setPreferredSize(new Dimension(600,800));
pack();
setLocationRelativeTo(null);
setVisible(true);
setResizable(false);
In my Board (JPanel)
setPreferredSize(new Dimension(600,800));