try
{
if (frame == null)
{
//tc.getRemoteMBeanInvoker ().invoke(targetObjectName, actionName, params, signature);
dataset = new MBeanXYDataset();
JFreeChart chart = ChartFactory.createXYLineChart(
"JMX Attribute: " + attr, "count", attr, dataset,
PlotOrientation.VERTICAL,
true,
true,
false
);
UpdateThread update = new UpdateThread(dataset, tc);
Thread thread = new Thread(update);
thread.start();
frame = new ChartFrame("JMX Attribute: " + attr, chart);
frame.getChartPanel().setPreferredSize(new java.awt.Dimension(500, 270));
frame.pack();
}
else
{
dataset.clear();
}
frame.show();
frame.requestFocus();
}
catch (Exception displayed)
{
displayed.printStackTrace();
}