Difference between revisions of "Java Roguelike Tutorial Lesson One Code"

From RogueBasin
Jump to navigation Jump to search
(code page for the tutorial)
 
 
(One intermediate revision by one other user not shown)
Line 4: Line 4:


HelloDungeon.java
HelloDungeon.java


<div style="padding: 5px; border: solid 1px #C0C0C0; background-color: #F0F0F0"><syntaxhighlight lang="java">
<div style="padding: 5px; border: solid 1px #C0C0C0; background-color: #F0F0F0"><syntaxhighlight lang="java">
Line 32: Line 31:


</syntaxhighlight></div>
</syntaxhighlight></div>
[[Category:Developing]]

Latest revision as of 00:50, 11 October 2012

This is part of the code for a series of tutorials; the main page can be found here.

HelloDungeon.java

import net.slashie.libjcsi.wswing.WSwingConsoleInterface;
import net.slashie.libjcsi.ConsoleSystemInterface;
import net.slashie.libjcsi.CSIColor;
import java.util.Properties;

public class HelloDungeon{
	
	public static void main(String[] args){
		Properties text = new Properties();
		text.setProperty("fontSize","20");
		text.setProperty("font", "Courier");
		ConsoleSystemInterface csi = null;
		try{
			csi = new WSwingConsoleInterface("My little Java Roguelike - Programming is fun", text);
		}
		catch (ExceptionInInitializerError eiie) {
			System.out.println("*** Error: Swing Console Box cannot be initialized. Exiting...");
			eiie.printStackTrace();
			System.exit(-1);
		}
		csi.print(0,0, "Welcome to the Dungeons of Doom!", CSIColor.WHITE);
	}
}