Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I recently started using slick2D in my gaming programs and a problem I have is not having the ability to remove the border/titlebar. I usually do this to create my own cutom look/ interface but if I try:


It doesnt work.

How do you acheive this?

share|improve this question
Did you try setundecorated(true)?? – Savlon Mar 26 '13 at 2:41
sorry i meant to write true @Savlon but where do i put this? – Exikle Mar 26 '13 at 3:07
I believe this has to be set before the window is created. So you'll need to create a launcher or somehow relaunch the existing window. – Byte56 Mar 26 '13 at 4:14

Ok so here is a basic application that has the title bar removed

public static void main(String[] args){
    JFrame frame = new JFrame("Without Title Bar Frame");

Paste the above code into a java class

Also be sure to import

import javax.swing.JFrame;

You see how frame.setUndecorated(true); is straight after the instantiation of the frame? Place yours in the same place and you will have no issue at all :)

EDIT: here is what I found which may work.

But as it states in that post it isn't support yet.

share|improve this answer
this would work if i wasnt using slick2D but I am so it won't work because I'm not creating a JFrame – Exikle Mar 26 '13 at 20:19
Hmm I see... So you are using Display to create your window? You can't create a full screen app? Have the surrounding areas of your window black? I'm not sure if Display has a setUndecorated method.. You may have to look through the slick2D API – Savlon Mar 27 '13 at 1:33
i can create a full screen app (I just need to change false to true in this code : "app.setDisplayMode(FRAME_WIDTH, FRAME_HEIGHT, false);" – Exikle Mar 27 '13 at 3:34
I found something that may work... Check my answer again – Savlon Mar 27 '13 at 4:21
up vote 0 down vote accepted

Originally I was using

AppGameContainer app = new AppGameContainer(new Game());

to create my game. However I wanted to set the frame to be undecorated. So I searched around and found that if you changed

AppGameContainer app = new AppGameContainer(new WizardGame());


CanvasGameContainerapp = new CanvasGameContainer(new Game());

so that its now a canvas and then add it to a JFrame and set that JFrame to undecorated, you would get a undecorated slick2D program.


public static void main(String[] args) throws SlickException {
    JFrame frame = new JFrame();
    CanvasGameContainer app = new CanvasGameContainer(new Game());
    frame.setSize(500, 500);

The only problem that i have with it is that i have to click it once to render the images. If i don't it just has a black screen. This could be because of my other code but I don't think it should happen for anyone else.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.