Java Programmers, help!!!!

Discussion in 'QnA (read only)' started by cockyrudh_2020, Sep 20, 2004.

Thread Status:
Not open for further replies.
  1. cockyrudh_2020

    cockyrudh_2020 New Member

    Joined:
    Mar 7, 2004
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    hyderabad
    guyz,
    can someone please tellme how to print this on screen using java applets???


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

    i didnt gettit tho i tried :(
     
  2. demoninside

    demoninside New Member

    Joined:
    May 20, 2004
    Messages:
    389
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    dehradun
    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
     
  3. #/bin/sh

    #/bin/sh New Member

    Joined:
    Apr 20, 2004
    Messages:
    213
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    42.65 N 73.76 W
    Classwork?
     
  4. #/bin/sh

    #/bin/sh New Member

    Joined:
    Apr 20, 2004
    Messages:
    213
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    42.65 N 73.76 W
    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));
    }
    }
     
  5. demoninside

    demoninside New Member

    Joined:
    May 20, 2004
    Messages:
    389
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    dehradun
    oops din't read USING APPLET so told u in application consol m8!
     
  6. OP
    OP
    cockyrudh_2020

    cockyrudh_2020 New Member

    Joined:
    Mar 7, 2004
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    hyderabad
  7. ankitjain

    ankitjain New Member

    Joined:
    Sep 16, 2004
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Ahmedabad
    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.............
     
  8. OP
    OP
    cockyrudh_2020

    cockyrudh_2020 New Member

    Joined:
    Mar 7, 2004
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    hyderabad
    yaar i knew the code for a normal java progy, what i wanted was for an applet code..... which "bin" gave me, thanx m8
     
  9. #/bin/sh

    #/bin/sh New Member

    Joined:
    Apr 20, 2004
    Messages:
    213
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    42.65 N 73.76 W
    no problem, welcome.
     
Thread Status:
Not open for further replies.

Share This Page