Thanks a lot, I think the first Question solved now when I click on the button it pop up a graph, but I need it to get my data and plot according to it.
But for Question 2, I think I did not make it clear enough, I want the image behind the grid of my program, but not the graph...
About the grid of my program, here is it.
public void paint(Graphics g) {
g.setColor(Color.white);
//Here it draw the white background sheet of it, and I want to change this to an image.
g.fillRect(0, 0, getWidth(), getHeight());
g.setColor(Color.gray);
//Here it put in the gray grids.
if (fpPoints != null && fpPoints.length > 0) {
for (int i = 0; i < fpPoints.length; i++) {
g.drawLine(0, pix_grid * i, getWidth(), pix_grid * i);
}
for (int j = 0; j < fpPoints[0].length; j++) {
g.drawLine(pix_grid * j, 0, pix_grid * j, getHeight());
}
}
I don't know if this is clear enough, sorry that I am pretty new to java. I attached the whole thing I am working on here, please have a look.
Thanks a lot.