public class colorString
{
public static void main( String[] args )
{
new colorString();
}
public colorString( )
{
kFrame f = new kFrame();
f.setSize( 400, 400 );
f.setVisible( true );
}
private static class kFrame extends JFrame
{
@Override
public void paint(Graphics g)
{
super.paint( g );
Graphics2D g2d = (Graphics2D)g;
g2d.setColor( new Color(255, 0, 0) );
g2d.drawString("red red red red red", 100, 100 );
}
}
}