1

The official Java programming Fourm

jasonderlo22 7/20/12 11:10 pm
160
7/21/2012 1:44 am
So if you like to code in java then this is the post for you! Speak about all java thing from Game programming to just fun or Simple Helpful programs.Post the source code show your ability of java programming just here! I will read this, Please subcribe to me if you like my posts.I will also be posting my java code cause i do program in java as well! So here we are just have fun and even more fun here
Posted by
jasonderlo22
Level 30 : Artisan Modder
17

  Have something to say?

JoinSign in

5

BouncingBall
07/21/2012 1:34 am
Level 53 : Grandmaster Blacksmith
Calling it official doesn't make it official. There is a difference between a forum and a forum post.
1
jasonderlo22
07/21/2012 1:44 am
Level 30 : Artisan Modder
WELL,I am sorry about that.Please just Enjoy the java and don't pick me up on everything!
1
jasonderlo22
07/21/2012 1:30 am
Level 30 : Artisan Modder
c++ may be but i like java Much Better!!!!!!!
1
jordanzilla02
07/20/2012 11:42 pm
Level 2 : Apprentice Explorer
c++ is easier
1
jasonderlo22
07/20/2012 11:19 pm
Level 30 : Artisan Modder
Here is my code:

*This game is not done yet and i am still making it!*

1:Screen class

import java.awt.*;
import javax.swing.JFrame;

public class Screen {

private GraphicsDevice vc;

public Screen(){
GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
vc = env.getDefaultScreenDevice();

}

public void setFullScreen(DisplayMode dm, JFrame window){
window.setUndecorated(true);
window.setResizable(false);
vc.setFullScreenWindow(window);

if(dm != null && vc.isDisplayChangeSupported()){
try{
vc.setDisplayMode(dm);
}catch(Exception ex){}
}


}

public Window getFullScreenWindow(){
return vc.getFullScreenWindow();
}

public void restoreScreen(){
Window w = vc.getFullScreenWindow();
if(w != null){
w.dispose();
}
vc.setFullScreenWindow(null);

}

}

2:Bucky
import javax.swing.JFrame;
import java.awt.*;


public class bucky extends JFrame {
public static void main(String[] args){

DisplayMode dm = new DisplayMode(800,600,16,DisplayMode.REFRESH_RATE_UNKNOWN);
bucky b = new bucky();
b.run(dm);

}
public void run(DisplayMode dm){
setBackground(Color.PINK);
setForeground(Color.WHITE);
setFont(new Font("Arial",Font.PLAIN, 24));

Screen s = new Screen();
try{

s.setFullScreen(dm, this);
try{
Thread.sleep(5000);
}catch(Exception ex){}

}finally{
s.restoreScreen();
}
}
public void paint(Graphics g){
if(g instanceof Graphics2D){
Graphics2D g2 = (Graphics2D)g;
g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
}
g.drawString("This is gonna be Awesome!", 200, 200);
}
}
1

Welcome