Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Display HTMl code in JAVA terminal...

  1. #1
    Junior Member
    Join Date
    Nov 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Display HTMl code in JAVA terminal...

    Hi, i just got an assignment under my JAVA programming leesons; and im kinda stuck, i dont know how to start ewen :S:S

    So this is the case:
    We got a html file which has a table; and in that table there is a Pyramid out of certain colours.. and I need to make a Java programe that displays the HTML code insted of the "pyramid of stars " so i got kinda lost how to do it; and now i would like some assistance/help about how to do this, becouse i dont know how to go on... :/

    here is the html code my JAVA programe has to display/print out.:

    __________________________________________________ ____________________
    <!DOCTYPE HTML SYSTEM>

    <html>

    <head>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

    <title>Piramida</title>

    <style type="text/css">

    .skupno { width: 50px; height: 50px; }

    .ozadje { background-color: white; }

    .barva1 { background-color: red; }

    .barva2 { background-color: lime; }

    .barva3 { background-color: blue; }

    </style>

    </head>

    <body>

    <table style="background-color: black">

    <tr>

    <td class="skupno ozadje">
    </td>

    <td class="skupno ozadje">
    </td>

    <td class="skupno barva1">
    </td>

    <td class="skupno ozadje">
    </td>

    <td class="skupno ozadje">
    </td>

    </tr>

    <tr>

    <td class="skupno ozadje">
    </td>

    <td class="skupno barva1">

    </td>

    <td class="skupno barva2"></td>

    <td class="skupno barva3"></td>

    <td class="skupno ozadje"></td>

    </tr>

    <tr>

    <td class="skupno barva1"></td>

    <td class="skupno
    <td class="skupno barva3"></td>

    <td class="skupno barva1"></td>

    <td class="skupno barva2"></td>

    </tr>

    </table>

    </body>

    </html>
    __________________________________________________ _______


  2. #2
    Senile Half-Wit Freaky Chris's Avatar
    Join Date
    Mar 2009
    Posts
    834
    My Mood
    Cynical
    Thanks
    7
    Thanked 105 Times in 90 Posts

    Default Re: Display HTMl code in JAVA terminal...

    Hi alkirk,

    What have yuo tried so far? What results do you get? What results do you expect? How do they Differ?
    An SSCE would be useful too.

    Chris

  3. #3
    Junior Member
    Join Date
    Nov 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Display HTMl code in JAVA terminal...

    Well, i havent realy started yet, becouse i dont know how to begin...the result has to be that when i execute the Pyramide.java programe it displays the html code i wrote in the previous post; and then i can copy the code to notepad and save it sa html and it works as a site that displays a pyramide with colours... open the html to see how it should looklike;
    i got this for an assignment...sadly i dont know what to do:S

    i was told it is based on the pyramid:
    *
    ***
    *****

    hope you, or anyone here can help me with this....

  4. #4
    Think of me.... Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Pakistan
    Posts
    1,136
    My Mood
    Grumpy
    Thanks
    20
    Thanked 82 Times in 78 Posts
    Blog Entries
    1

    Default Re: Display HTMl code in JAVA terminal...

    1. You must study File Handling. (Reading and Writing specifically)
    2. You want to print pyramid in java or html?
    3. If you want to write a program in java that will create a pyramid in html, you must have to look at JSP/Servlets.

Similar Threads

  1. output to a specific location in html code
    By aketr in forum What's Wrong With My Code?
    Replies: 1
    Last Post: July 15th, 2011, 11:44 AM
  2. [SOLVED] Stopping java in terminal
    By Scotty in forum Java Theory & Questions
    Replies: 1
    Last Post: May 7th, 2011, 06:53 PM
  3. Need some help with OSX Java (Terminal)
    By mkoop in forum What's Wrong With My Code?
    Replies: 5
    Last Post: January 14th, 2011, 12:23 PM
  4. why does this code read an html file uncontinuously
    By nasi in forum What's Wrong With My Code?
    Replies: 4
    Last Post: March 25th, 2010, 09:09 PM
  5. Implementing HTML tags in Java Source Code
    By bookface in forum Java Theory & Questions
    Replies: 4
    Last Post: March 19th, 2010, 09:29 PM