76 lines
3.6 KiB
HTML
76 lines
3.6 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
|
<html>
|
|
<head>
|
|
<title>JavaFX_CalebFontenot.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}
|
|
.ST0 {color: #ffc66d}
|
|
.string {color: #6a8759}
|
|
.number {color: #6897bb}
|
|
.whitespace {color: #505050}
|
|
.ST1 {color: #9876aa; font-family: monospace; font-style: italic}
|
|
.comment {color: #808080}
|
|
.ST4 {color: #ffc66d; font-family: monospace; font-style: italic}
|
|
.ST2 {color: #808080; font-family: monospace; font-weight: bold}
|
|
.ST3 {color: #8a653b}
|
|
.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/JavaFX_CalebFontenot.java</td></tr></table>
|
|
<pre>
|
|
<span class="literal">package</span> javafx_calebfontenot;
|
|
<span class="literal">import</span> javafx.application.Application;
|
|
<span class="literal">import</span> javafx.event.ActionEvent;
|
|
<span class="literal">import</span> javafx.event.EventHandler;
|
|
<span class="literal">import</span> javafx.scene.Scene;
|
|
<span class="literal">import</span> javafx.scene.control.Button;
|
|
<span class="literal">import</span> javafx.scene.layout.StackPane;
|
|
<span class="literal">import</span> javafx.stage.Stage;
|
|
|
|
<span class="literal">public</span> <span class="literal">class</span> JavaFX_CalebFontenot <span class="literal">extends</span> Application {
|
|
|
|
@Override
|
|
<span class="literal">public</span> <span class="literal">void</span> <span class="ST0">start</span>(Stage primaryStage)
|
|
{
|
|
Button btn = <span class="literal">new</span> Button();
|
|
btn.setText(<span class="string">"</span><span class="string">Say 'Hello World'</span><span class="string">"</span>);
|
|
btn.setOnAction(<span class="literal">new</span> EventHandler<ActionEvent>() {
|
|
|
|
@Override
|
|
<span class="literal">public</span> <span class="literal">void</span> <span class="ST0">handle</span>(ActionEvent event)
|
|
{
|
|
System.<span class="ST1">out</span>.println(<span class="string">"</span><span class="string">Hello World!</span><span class="string">"</span>);
|
|
}
|
|
});
|
|
|
|
|
|
StackPane root = <span class="literal">new</span> StackPane();
|
|
root.getChildren().add(btn);
|
|
|
|
Scene scene = <span class="literal">new</span> Scene(root, <span class="number">3</span><span class="number">00</span>, <span class="number">2</span><span class="number">50</span>);
|
|
|
|
primaryStage.setTitle(<span class="string">"</span><span class="string">Hello World!</span><span class="string">"</span>);
|
|
primaryStage.setScene(scene);
|
|
primaryStage.show();
|
|
}
|
|
|
|
<span class="comment">/**</span>
|
|
<span class="comment"> * </span><span class="ST2">@param</span> <span class="ST3">args</span> <span class="comment">the</span> <span class="comment">command</span> <span class="comment">line</span> <span class="comment">arguments</span>
|
|
<span class="comment">*/</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>
|