public DemoPanel() { super(new BorderLayout()); lastValue = 100D; series = new TimeSeries( "Random Data", DynamicDataDemo1.class$org$jfree$data$time$Millisecond != null ? DynamicDataDemo1.class$org$jfree$data$time$Millisecond : (DynamicDataDemo1.class$org$jfree$data$time$Millisecond = DynamicDataDemo1.class$("org.jfree.data.time.Millisecond"))); TimeSeriesCollection timeseriescollection = new TimeSeriesCollection(series); ChartPanel chartpanel = new ChartPanel(createChart(timeseriescollection)); chartpanel.setPreferredSize(new Dimension(500, 270)); JPanel jpanel = new JPanel(); jpanel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); JButton jbutton = new JButton("Add New Data Item"); jbutton.setActionCommand("ADD_DATA"); jbutton.addActionListener(this); jpanel.add(jbutton); add(chartpanel); add(jpanel, "South"); }
public static void main(String args[]) { DynamicDataDemo1 dynamicdatademo1 = new DynamicDataDemo1("Dynamic Data Demo"); dynamicdatademo1.pack(); RefineryUtilities.centerFrameOnScreen(dynamicdatademo1); dynamicdatademo1.setVisible(true); }