Change the layout manager of the frame to use a GrigBagLayout:
JFrame f = new JFrame();
f.setLayout( new GridBagLayout() );
then add your component to the frame using the default constraints:
//f.getContentPane().add(BorderLayout.CENTER, graphComponent);
f.add(graphComponent, new GridBagConstraints());
To understand why this works read the section from the Swing tutorial on How to Use GridBagLayout, especially the section that explains how the weightx/weighty
constraints work.
Finally, the f.setVisible() method should be invoked as the last statement in your constructor, AFTER all components have been added to the frame and the frames child panels.