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>
__________________________________________________ _______
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
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....
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.