The official Java programming Fourm

Anything that isn't Minecraft-related or doesn't go anywhere above goes here.

Post Permalink
by jasonderlo22 » 7/20/2012

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! :geek: So here we are just have fun and even more fun here :D :D :D :D :D :D
Level 27
Expert Modder
Posts: 43
Joined: 12/23/11

Post Permalink
by jasonderlo22 » 7/20/2012

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);
}
}
Level 27
Expert Modder
Posts: 43
Joined: 12/23/11

Post Permalink
by jordanzilla02 » 7/20/2012

c++ is easier
Level 1
New Explorer
Posts: 85
Joined: 6/13/12
Location: Las Vegas, Nevada
Says: Apply for my server
Minecraft: jordanzilla02
mc_server: ZillaCraft

Post Permalink
by jasonderlo22 » 7/21/2012

c++ may be but i like java Much Better!!!!!!!
Level 27
Expert Modder
Posts: 43
Joined: 12/23/11

Post Permalink
by BouncingBall » 7/21/2012

Calling it official doesn't make it official. There is a difference between a forum and a forum post.
User avatar
Level 10
Journeyman Blacksmith
Posts: 305
Joined: 7/20/12

Post Permalink
by jasonderlo22 » 7/21/2012

BouncingBall wrote:Calling it official doesn't make it official. There is a difference between a forum and a forum post.



WELL,I am sorry about that.Please just Enjoy the java and don't pick me up on everything!
Level 27
Expert Modder
Posts: 43
Joined: 12/23/11


Return to General Discussion