if the panel is a JPanel, and it is not a null layout,
you should be using
panel.setPreferredSize(new Dimension( , ));
if your panel is the only component added to the frame, it should resize
along with the frame (actually, it can't do anything else), but it sounds like
you must have other components added to the frame. If so, if you can add the
panel to the frame at BorderLayout.CENTER, it should increase/decrease along
with the frame (without any additional code)