I ran into this problem, I have
class FinalUI1 extends javax.swing.JFrame {
class PcapTool extends ApplicationFrame implements Runnable {
There is a main UI window, and new graphs are generated in a separate window whenever the user clicks a button.
Problem: I want to display graphs when the user clicks a button in the FinalUI1 class, but when I close any of the generated graphs, the entire user interface crashes, everything disappears. I want to save the main interface and close the specific chart that the user decided to close. It occurred to me that since the user interface is in the main thread, and I can create new charts in the new thread, if I do this and close one of the child threads, the main user interface should work. Could you help me with this.
Thank you very much.
Additional code:
public class PcapTool extends ApplicationFrame { public static String domainChoice, domainConcatenate="";; public static XYSeries series1; public static XYSeriesCollection dataset=null; public static XYSeries series2; public static PacketInfo resPacketObject; public static Hashtable<String, Object> DomainNameTable=new Hashtable<String, Object>(); public static String[] hasArray=new String[100]; public static JFreeChart chart; public static String customTitle = " "; public ArrayList<Double> dataNumberList=new ArrayList<Double>(); public static String[]dataUsage; public static String[]timeArrival,txRxTag; private static final long serialVersionUID = 1L; public PcapTool(final String title) throws InterruptedException { super(title); IntervalXYDataset dataset = createDataset(); JFreeChart chart = createChart(dataset); final ChartPanel chartPanel = new ChartPanel(chart); chartPanel.setPreferredSize(new java.awt.Dimension(2000,1000));
}
source share