Adding components (JPanel)s with different layout managers
Is there any problem with adding different components to a GUI and using different layout managers?
For example, if I use NetBean's GUI builder to initially build an application, javax.swing.GroupLayout is used to layout all of the panels and buttons, etc. in the generated code.
Then, I would like to add an org.jfree.JFreeChart object using a org.jfree.chart.ChartPanel into one of my JPanels. (FYI, ChartPanel extends javax.swing.JPanel) The default layout manager for a ChartPanel is FlowLayout.
The code to add the ChartPanel is:
<br /> ChartPanel trngChart = demoChart();<br /> JPanel chartJPanel = getChartsJPanel();<br /> chartJPanel.add(trngChart);<br />
I haven't gotten this to show the chart yet. If I pop it up in its own window (I use a new JFrame for this) rather than using a JPanel in the existing GUI, then it works just fine.
So, I have started tinkering with the layout managers...no luck yet.