Currently, I am trying to figure out how to create a Java Applet where the text scrolls as though it were the terminal window. We also want to have the background be black(I figured how to do this part), and the text to be white(This is the harder part for me).
import javax.swing.*;
import java.applet.*;
import java.util.*;
import java.awt.*;
public class projectApplet extends JApplet
{
public class GameApplet extends JPanel
{
void GameAppletl()
{
}
public void paintComponent(Graphics g)
{
super.paintComponent(g);//calls super-class
Color black = new Color(0,0,0);//creates color Black
setBackground(black); // Sets the background to the new color
}
}
public void init()//Sets Applet window Size
{
setSize(500,500);
getContentPane().add(new DemoPanel());
}
}
Looking at tutorials at this website, this is what I have for the applet so far.
How do you make it scroll the text like terminal window, instead of using drawString("",0,0)?
How do you make it print out text from a seperate class? (eg. we have a story class that has all of the story text)
Is it possible to make the text colored, if so, How?
Please assume that I know little about applets, we have only been introcuced to them this late in the year. If you need the code for other classes to see how they work, please tell me.
This post has been edited by Riceraider: 15 May 2008 - 10:15 AM

New Topic/Question
Reply




MultiQuote




|