Java Programmers, help!!!!

Status
Not open for further replies.
guyz,
can someone please tellme how to print this on screen using java applets???


*
* *
* * *
* * * *
* * * * *

i didnt gettit tho i tried :(
 

demoninside

In the zone
hey firstly it should be in Q&A
but for ur ans
use {for} loop for this
just use println("*") & then (" ")
and if u want program
PM me
 

#/bin/sh

Journeyman
import java.awt.Color;
import java.awt.Container;
import java.awt.Graphics;

import javax.swing.JApplet;

/**
* @author #/bin/sh

*/
public class StarApplet extends JApplet
{
public void init()
{
Container content = getContentPane();
content.setBackground(Color.white);
}
public void paint(Graphics g)
{
String stars[] = {"*", "**", "***", "****", "*****"};
for(int i=0; i<5; i++)
g.drawString(stars, 50, 50+(i*10));
}
}
 

ankitjain

Right off the assembly line
cockyrudh_2020 said:
guyz,
can someone please tellme how to print this on screen using java applets???


*
* *
* * *
* * * *
* * * * *

i didnt gettit tho i tried :(

Man!!!!!!! :twisted:

This simple program!!!! First think on problem.
U need to put '*' then '**', so....................
need two loops.................
one for File lines.................
second for columns............... iterate this for one more time than current line index.

OK...........
Be happy.................

Expecting a single click on ads of my website........... to make my earninngs.............
 
Status
Not open for further replies.
Top Bottom