ASDV-Java/Semester 2/Assignments/JavaFX_CalebFontenot/Printed HTMLs/ShowRectangle.html

70 lines
4.4 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>ShowRectangle.java</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style type="text/css">
<!--
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
table {color: #888888; background-color: #313335; font-family: monospace}
.ST2 {color: #ffc66d}
.number {color: #6897bb}
.comment {color: #808080}
.whitespace {color: #505050}
.ST3 {color: #9876aa; font-family: monospace; font-style: italic}
.ST4 {color: #ffc66d; font-family: monospace; font-style: italic}
.ST1 {color: #808080; font-family: monospace; font-weight: bold}
.ST0 {color: #287bde}
.literal {color: #cc7832}
.ST5 {font-family: monospace; font-style: italic}
-->
</style>
</head>
<body>
<table width="100%"><tr><td align="center">/home/caleb/ASDV-Java/Semester 2/Assignments/JavaFX_CalebFontenot/src/javafx_calebfontenot/ShowRectangle.java</td></tr></table>
<pre>
<span class="comment">/*</span>
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
<span class="comment"> */</span>
<span class="literal">package</span> javafx_calebfontenot;
<span class="literal">import</span> javafx.application.Application;
<span class="literal">import</span> <span class="literal">static</span> javafx.application.Application.launch;
<span class="literal">import</span> javafx.scene.Scene;
<span class="literal">import</span> javafx.scene.layout.Pane;
<span class="literal">import</span> javafx.scene.paint.Color;
<span class="literal">import</span> javafx.scene.shape.Rectangle;
<span class="literal">import</span> javafx.stage.Stage;
<span class="comment">/**</span>
<span class="comment"> *</span>
<span class="comment"> * </span><span class="ST1">@author</span> <span class="comment">caleb</span>
<span class="comment">*/</span>
<span class="literal">public</span> <span class="literal">class</span> ShowRectangle <span class="literal">extends</span> Application {
@Override
<span class="literal">public</span> <span class="literal">void</span> <span class="ST2">start</span>(Stage primaryStage)
{
Pane pane = <span class="literal">new</span> Pane(); <span class="comment">// Create a pane object</span>
Scene scene = <span class="literal">new</span> Scene(pane, <span class="number">3</span><span class="number">00</span>, <span class="number">2</span><span class="number">00</span>); <span class="comment">// Create a scene object</span>
primaryStage.setScene(scene); <span class="comment">// Set the stage scene to the scene object</span>
primaryStage.show(); <span class="comment">// Make the window display on the screen</span>
Rectangle r = <span class="literal">new</span> Rectangle(<span class="number">3</span><span class="number">0</span>, <span class="number">3</span><span class="number">0</span>, <span class="number">8</span><span class="number">8</span>, <span class="number">4</span><span class="number">4</span>); <span class="comment">// Crate a rectangle object with these dimentions.</span>
r.setX(<span class="number">3</span><span class="number">0</span>);
r.setY(<span class="number">3</span><span class="number">0</span>);
r.setStroke(Color.<span class="ST3">BLUE</span>); <span class="comment">// Set the rectangle outline to Blue</span>
r.setFill(Color.<span class="ST3">RED</span>); <span class="comment">// Set the interior of the rectangle to Red</span>
pane.getChildren().add(r); <span class="comment">// Add the circle object to the pane</span>
}
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST4">main</span>(String[] args)
{
<span class="ST5">launch</span>(args);
}
}
</pre></body>
</html>