package src; import javax.swing.JFrame; import java.awt.Graphics; public class GameApplet extends JFrame { public static GameApplet client; public GameApplet() { setTitle("GameApplet - Alpha 1.0.0"); setSize(1000, 1000); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setResizable(false); setVisible(true); } public static void createTiles(int X, int Y, int Height, int Width) { client.paint(null, X, Y, Height, Width); } public void paint(Graphics g, int X, int Y, int Height, int Width) { g.drawRect(X, Y, Height, Width); } public static void main(String[] args) { createTiles(100, 100, 300, 300); } } I understand the nullpointerexception means I have a null value but don't understand where