Applet question: Changing integers to special string
code:
import javax.swing.*;
import java.awt.Graphics;
public class L5a1 extends JApplet{
int num1,
count;
public void init()
{
String one;
one = JOptionPane.showInputDialog ( "Enter first number, 1-30 please:" );
//converts string to integer
num1 = Integer.parseInt(one);
}
public void paint ( Graphics g )
{
String output = "";
if (num1 > 30 || num1 < 0 )
{
g.drawString("The number does not meet specs!", 10, 10);
}
for (int count = 0; count < num1; count++)
{
g.drawString("*", count, 10);
output += "*";
}
}
}
I need to write an applet that reads five numbers (each between 1 and 30). For each number read, I need todraw a line containing that number of adjacent asterisks. If it reads the number seven, it should print *******.
this is what i have now, but im not sure why the spacing of the astericks are so small, they are bunching up...
please help thanks