Alberto acepsut
Alberto acepsut

Reputation: 2022

Swing Components and Containment Hierarchy

enter image description here

I would like to replicate this kind of plot as Swing component, and my question is: what is (or what could be) the hierarchy used in this picture?

It seems there are

JPanels (where rectangles, lines and text are displayed) within nested JSplitPanes within JInternalFrames within a JTabbedPane, all in the top container JFrame.

Is this correct or I am missing something?

Thanks

Upvotes: 1

Views: 1234

Answers (1)

chubbsondubs
chubbsondubs

Reputation: 38751

Look at getting JFreeChart and integrate that for all of the charting. As for stacking the graphs you could use a simple JPanel with a BoxLayout, or my favorite TableLayout. Then vertically stack the graphs. If you want to scroll graphs independently you can wrap those charts in JScrollPane and add that to the root JPanel.

Trickier is if you want to scroll those graphs with one scrollbar you'd need to put each graph in a JPanel that wraps itself around the longest graph (child), then wrap that in the JScrollPane. Then add that wrapping panel to the root JPanel.

http://www.jfree.org/jfreechart/

Upvotes: 2

Related Questions