Cant get fonts working

Hello all.
I cant get fonts to work at all in my project. Here is the code:

Initializing fonts:


AWTtitleFont = new Font("Arial", Font.PLAIN, 12);
AWTfont = new Font("Arial", Font.PLAIN, 9);
            
titleFont = new TrueTypeFont(AWTtitleFont, false);
font = new TrueTypeFont(AWTfont, false);

Trying to use fonts:


        //Draw title
        g.setFont(titleFont);
        g.setColor(Color.red);
        g.drawString("A God's Machine", 31, 31);
        titleFont.drawString(31, 31, "A God's Machine");

Neither g.drawString or titleFont.drawString work. The error returned is:


java.lang.RuntimeException: No OpenGL context found in the current thread.
	at org.lwjgl.opengl.GLContext.getCapabilities(GLContext.java:124)
	at org.lwjgl.opengl.GL11.glGetError(GL11.java:1299)
	at org.newdawn.slick.opengl.renderer.ImmediateModeOGLRenderer.glGetError(ImmediateModeOGLRenderer.java:384)
	at org.newdawn.slick.opengl.GLUtils.checkGLContext(GLUtils.java:17)
	at org.newdawn.slick.TrueTypeFont.<init>(TrueTypeFont.java:92)
	at org.newdawn.slick.TrueTypeFont.<init>(TrueTypeFont.java:112)
	at GameState.MenuState.<init>(MenuState.java:49)
	at GameState.GameStateManager.loadState(GameStateManager.java:41)
	at GameState.GameStateManager.<init>(GameStateManager.java:36)
	at Main.MainGame.main(MainGame.java:62)

Thanks for the help. If it makes any difference, I am running Linux.

Looking at the stacktrace, don’t construct the TrueTypeFont objects in the MenuState constructor. Construct them in init().

Also you shouldn’t need to have a GameStateManager class, just use slick’s StateBasedGame class.

Thanks for the quick response.
Im using my own game state manager because I already have a game that Im transferring over to Slick, and it uses one I made.
As for your fix, it did the job of getting rid of the error, but its still not drawing. Do I need to do something with color?