Hejka, chce zrobić grę i chcę, żeby obraz był na cały ekran bez widocznej ramy, ale coś mi to nie idzie...
Klasa odpowiedzialna za ramę wygląda następująco:
package com.game.engine;
import javax.swing.*;
import java.awt.*;
public class Frame {
private static final JFrame frame = new JFrame("Medieval Wizard");
private static GraphicsDevice graphicsDevice;
private GraphicsEnvironment graphicsEnvironment;
public void setFrame() {
graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
graphicsDevice = graphicsEnvironment.getDefaultScreenDevice();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setContentPane(new Engine(graphicsDevice.getDisplayMode().getWidth(), graphicsDevice.getDisplayMode().getHeight()));
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
setFullScreen();
}
private void setFullScreen() {
graphicsDevice.setFullScreenWindow(frame);
}
public static GraphicsDevice getGraphicsDevice() {
return graphicsDevice;
}
}
Ktoś wie co robię nie tak?
Rezultat mam taki: