I've been trying to implement graphics in a GUI application I've made in Netbeans. I've done the layout (buttons, textboxes, etc.) using the GUI editor and it all works fine so far. Basically what I want to do is generate some graphics (lines and such) in the bottom half of my JFrame and leave the checkboxes, buttons, and such in the top half of my JFrame.
From the examples I've seen, the general approach is to create a class which extends JPanel and contains graphics code to create lines and other various shapes. I've been able to implement this independent of the GUI editor, but the application consists solely of the JPanel which occupies the entire JFrame. Different approaches I've used for doing this in the GUI editor have either generated the graphics but blocked out everything else in my JFrame (even for a tiny line) or not done anything at all.
Ideally I'd want to be able to place a JPanel of arbitrary size in an arbitrary location on my JFrame and create graphics that are contained within the panel. I'd also want the coordinates of the graphics I create to be referenced to the JPanel rather than the JFrame (so coordinate 0,0 is the top left of my JPanel regardless of where I decide to place it.)
Is there a straightforward means of doing this?
(example code would be greatly appreciated)