Hi i have a program with a JFrame and it has two jpanels on it, one containing the buttons needed and the other which is going to be used for plotting graphs, but when i try to plot an x, y graph on the plotting jpanel it does not show up. any idea of what i can do, thank you for any help that can be given.

This is the code for making the graph

    public void paintComponents(Graphics g)

     g.setFont(new Font("Courier New", Font.BOLD,16));
      g.drawLine(200,200,200,350); // x-axis
      g.drawLine(0,350,1400,350);// y-axis
7 Years
Discussion Span
Last Post by powerson65

Hi JamesCherrill have tried to change the paintComponents to paintComponent but it gave me errors as it cannot find the method.
I think that i need to make a class or method for the jpanel in question were i would like to draw than override it, as the two jpanels are visible on the same jframe. Thanks a lot for the help.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.