I\'ve extended the JPanel class to draw a graph. The problem that I\'ve got is that I need a global graphics object in order to call it in multiple methods... As an example, her
How would I pass in the graphics object externally?
Don't. The graphics context is only valid during the invocation of paintComponent(). Instead, use the MVC pattern, discussed here, to update a model that notifies any listening view to render itself. JFreeChart is a complete example.