Hi, I am trying to plot a graph and graph should display when JButton is clicked. To create data set, I am taking some value through JTextField and then created a chart and plotted it. I've got a problems: the chart doesn't refresh/update when I change the text field value.
You appear to have landed in the wrong location. Never mind, I can move you somewhere more appropriate.
I presume you have tested that the actionPerformed method is actually being called? Put a print statement in it and you will get a printout: something like "Action Performed" would work nicely.
Why are you adding a new chart object? Why do you not have a method in the chart object which takes the new values and then repaints it?
Which layouts are you applying to what? Are you using BorderLayout.CENTER on a Component with a grid bag layout?
Your button logic seems sound....I ran the code w/o all the chart stuff to verify that "a" does change when I edit the text area and press the button. Have you inspected the dataset that's being created? I'd put in some print statements near the return of the method that creates the dataset to see exactly what's getting built into the chart data.