Reputation: 113
I am finding it hard to convert my JPanel into a lwjgl fullscreen display? is there another way or a guide on what you need to change:
This is what i am currently calling it with:
public void TowerDefence() {
setLayout(new GridLayout(1, 1, 0, 0));
Window window = new Window(this);
add(window);
setVisible(true);
}
And this is what is called to initialize the JPanel:
public Window(Frame frame) {
frame.addMouseListener(new KeyHandler());
frame.addMouseMotionListener(new KeyHandler());
thread.start();
}
Do i need to change only inside this constructor? And what needs to be added in order for fullscreen to work?
Upvotes: 0
Views: 139
Reputation: 168825
See the lesson on the Full-Screen Exclusive Mode API in the tutorial.
Upvotes: 1