I plan on writing an app that will graph polynomial expressions. My question is, what should I draw the graph on? Should I just use the regular frame and use DrawLine(), or is there something like a bitmap, or canvas thing I should use?
Printable View
I plan on writing an app that will graph polynomial expressions. My question is, what should I draw the graph on? Should I just use the regular frame and use DrawLine(), or is there something like a bitmap, or canvas thing I should use?
I think you should definitely use an offscreen BufferedImage and blit that to the screen on drawing.
I've seen a graph library that doesn't - at 30000 plotted points, every movement of the window is about 4 seconds delayed.
OK, thanks CB.
I created the bufferedImage in a seperate class that extended JPanel(Called ImagePlotter)...I did this in the "driver" class trying to create an instance of it, and adding it to the container, but it's not showing up.
ImagePlotter ip = new ImagePlotter();
Container pane = getContentPane();
pane.add(ip);
is this how I was suppose to do this?
I just went with painting the component since the bufferedImage wouldn't work..But I have one more question: If I have the cartisian coordiante plane drawn, would it be possible to only repaint one line graphed on it, instead of everything in the paintComponent method?