import java.awt.DisplayMode;
import java.awt.Graphics2D;
import java.awt.Image;
import javax.swing.ImageIcon;
public class mainclass {
private Graphics2D g;
private static final DisplayMode modes1[] = {
new DisplayMode(800,600,32,0),
new DisplayMode(800,600,24,0),
new DisplayMode(800,600,16,0),
new DisplayMode(640,480,32,0),
new DisplayMode(640,480,24,0),
new DisplayMode(640,480,16,0)};
public static void main(String[] args) throws InterruptedException{
DisplayMode dm = new DisplayMode(800, 600, 16, DisplayMode.REFRESH_RATE_UNKNOWN);
mainclass p = new mainclass();
p.run();
}
public Image getImage(){
Image ball = new ImageIcon(getClass().getResource("scena2.png")).getImage();
return ball;
}
public Image getBg(){
Image bg = new ImageIcon(getClass().getResource("background.png")).getImage();
return bg;
}
public void run() throws InterruptedException{
Screen s = new Screen();
try{
DisplayMode dm = s.findFirstCompatibleMode(modes1);
s.setFullScreen(dm);
draw(g);
Thread.sleep(2000);
}finally{
s.restoreScreen();
}
}
public void draw(Graphics2D g){
g.drawImage(getBg(), 0,0, null);
g.drawImage(getImage(), 30,90, null);
}
}