Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
the hurlers
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Herman Andersen Dyrkorn
the hurlers
Commits
9396209e
Commit
9396209e
authored
4 years ago
by
Anders Langlie
Browse files
Options
Downloads
Plain Diff
Merge branch '7-display-list-w-thought-constructor' into 'master'
Resolve "Display List /w thought constructor" Closes
#7
See merge request
!10
parents
9f7d5e5b
39e3abc4
No related branches found
Branches containing commit
No related tags found
1 merge request
!10
Resolve "Display List /w thought constructor"
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/sample/Main.java
+19
-1
19 additions, 1 deletion
src/sample/Main.java
src/sample/Thought.java
+6
-3
6 additions, 3 deletions
src/sample/Thought.java
src/sample/ThoughtManager.java
+7
-13
7 additions, 13 deletions
src/sample/ThoughtManager.java
src/sample/sample.fxml
+5
-5
5 additions, 5 deletions
src/sample/sample.fxml
with
37 additions
and
22 deletions
src/sample/Main.java
+
19
−
1
View file @
9396209e
...
...
@@ -2,19 +2,37 @@ package sample;
import
javafx.application.Application
;
import
javafx.fxml.FXMLLoader
;
import
javafx.scene.Node
;
import
javafx.scene.Parent
;
import
javafx.scene.Scene
;
import
javafx.scene.control.Button
;
import
javafx.scene.control.ScrollPane
;
import
javafx.scene.control.TextArea
;
import
javafx.scene.control.TextField
;
import
javafx.scene.text.Text
;
import
javafx.stage.Stage
;
import
java.net.ContentHandlerFactory
;
public
class
Main
extends
Application
{
@Override
public
void
start
(
Stage
primaryStage
)
throws
Exception
{
Parent
root
=
FXMLLoader
.
load
(
getClass
().
getResource
(
"sample.fxml"
));
primaryStage
.
setTitle
(
"Hurl your thoughts"
);
primaryStage
.
setScene
(
new
Scene
(
root
,
700
,
498
));
Scene
sceneMain
=
new
Scene
(
root
,
700
,
498
);
primaryStage
.
setScene
(
sceneMain
);
//get access to the text field:
ScrollPane
scrollyPlane
=
(
ScrollPane
)
sceneMain
.
lookup
(
"#scrollyboi"
);
Node
content
=
scrollyPlane
.
getContent
();
Text
ta
=
(
Text
)
content
.
lookup
(
"#thoughtId"
);
ta
.
setText
(
"testing"
);
ThoughtManager
tm
=
new
ThoughtManager
();
tm
.
makeList
();
primaryStage
.
show
();
}
...
...
This diff is collapsed.
Click to expand it.
src/sample/Thought.java
+
6
−
3
View file @
9396209e
package
sample
;
public
class
Thought
{
p
ublic
String
thoughtText
;
p
rivate
String
thoughtText
;
public
Thought
(
String
txt
){
thoughtText
=
txt
;
this
.
thoughtText
=
txt
;
}
public
String
getThought
()
{
return
this
.
thoughtText
;
}
}
This diff is collapsed.
Click to expand it.
src/sample/ThoughtManager.java
+
7
−
13
View file @
9396209e
package
sample
;
import
java.util.
List
;
import
java.util.
*
;
public
class
ThoughtManager
{
public
List
<
Thought
>
thoughts
;
private
List
<
Thought
>
thoughts
=
new
ArrayList
<>();
public
void
makeList
()
{
Thought
t
=
new
Thought
();
t
.
thoughtText
=
"yeet"
;
Thought
t2
=
new
Thought
();
t2
.
thoughtText
=
"yeet1"
;
Thought
t3
=
new
Thought
();
t3
.
thoughtText
=
"yeet2"
;
Thought
t4
=
new
Thought
();
t4
.
thoughtText
=
"yeet3"
;
Thought
t5
=
new
Thought
();
t5
.
thoughtText
=
"yeet4"
;
Thought
t
=
new
Thought
(
"yeet1"
);
Thought
t2
=
new
Thought
(
"yeet12"
);
Thought
t3
=
new
Thought
(
"yeet3"
);
Thought
t4
=
new
Thought
(
"yeet4"
);
Thought
t5
=
new
Thought
(
"yeet5"
);
this
.
thoughts
.
add
(
t
);
this
.
thoughts
.
add
(
t2
);
this
.
thoughts
.
add
(
t3
);
...
...
This diff is collapsed.
Click to expand it.
src/sample/sample.fxml
+
5
−
5
View file @
9396209e
...
...
@@ -8,12 +8,12 @@
<AnchorPane
maxHeight=
"-Infinity"
maxWidth=
"-Infinity"
minHeight=
"-Infinity"
minWidth=
"-Infinity"
prefHeight=
"498.0"
prefWidth=
"700.0"
xmlns=
"http://javafx.com/javafx/11.0.1"
fx:controller=
"sample.Controller"
xmlns:fx=
"http://javafx.com/fxml/1"
>
<children>
<Button
id=
"submitButton"
layoutX=
"100.0"
layoutY=
"423.0"
mnemonicParsing=
"false"
onAction=
"#handleSubmit"
prefHeight=
"35.0"
prefWidth=
"129.0"
text=
"Submit thought"
/>
<TextArea
id=
"textBox"
fx:id=
"textArea"
layoutX=
"59.0"
layoutY=
"299.0"
prefHeight=
"106.0"
prefWidth=
"307.0"
promptText=
"Write your thought here..."
/>
<Text
layoutX=
"65.0"
layoutY=
"31.0"
strokeType=
"OUTSIDE"
strokeWidth=
"0.0"
text=
"Your thoughts"
/>
<ScrollPane
layoutX=
"1.0"
layoutY=
"40.0"
prefHeight=
"258.0"
prefWidth=
"700.0"
>
<Button
id=
"submitButton"
layoutX=
"100.0"
layoutY=
"423.0"
mnemonicParsing=
"false"
prefHeight=
"35.0"
prefWidth=
"129.0"
text=
"Submit thought"
/>
<TextArea
id=
"textBox"
layoutX=
"59.0"
layoutY=
"299.0"
prefHeight=
"106.0"
prefWidth=
"307.0"
promptText=
"Write your thought here..."
/>
<Text
id=
"thoughtField"
layoutX=
"65.0"
layoutY=
"31.0"
strokeType=
"OUTSIDE"
strokeWidth=
"0.0"
text=
"Your thoughts"
/>
<ScrollPane
id=
"scrollyboi"
layoutX=
"1.0"
layoutY=
"40.0"
prefHeight=
"258.0"
prefWidth=
"700.0"
>
<content>
<Text
id=
"thoughtId"
strokeType=
"OUTSIDE"
strokeWidth=
"0.0"
text=
"Text"
wrappingWidth=
"33.22460746765137"
/>
<Text
id=
"thoughtId"
strokeType=
"OUTSIDE"
strokeWidth=
"
2
0.0"
wrappingWidth=
"33.22460746765137"
text=
"Text"
/>
</content>
</ScrollPane>
</children>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment