0

I am making project on JFrame and adding JPanel on JFrame. When I am using paintcomponents function it is throwing NullPointerException. What can I do?

    @Override
    public void paintComponents(Graphics g) {
        // TODO Auto-generated method stub

        super.paintComponents(g);
        if(OSC==null)
        {
            createOSC();
        }

        g.drawImage(OSC, 0, 0, null);

        if(dragging&&SHAPE_TOOLS.contains(currentTool))
        {
            g.setColor(currentColor);
            putCurrentShape(g);
        }

    }
Parth Solanki
  • 3,268
  • 2
  • 22
  • 41
  • 5
    Possible duplicate of [What is a NullPointerException, and how do I fix it?](http://stackoverflow.com/questions/218384/what-is-a-nullpointerexception-and-how-do-i-fix-it) – resueman Sep 21 '16 at 13:30
  • Can you add the full stack trace ? – Pignic Oct 13 '16 at 17:15

0 Answers0