Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
k2022
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
tie
ohj2
esimerkit
k2022
Commits
ee3d518f
Commit
ee3d518f
authored
3 years ago
by
Vesa Lappalainen
Browse files
Options
Downloads
Patches
Plain Diff
Jasenen nayttaminen
parent
d7b18c13
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
luennot/live14/src/fxKerho/KerhoGUIController.java
+23
-0
23 additions, 0 deletions
luennot/live14/src/fxKerho/KerhoGUIController.java
luennot/live14/src/fxKerho/KerhoGUIView.fxml
+1
-1
1 addition, 1 deletion
luennot/live14/src/fxKerho/KerhoGUIView.fxml
with
24 additions
and
1 deletion
luennot/live14/src/fxKerho/KerhoGUIController.java
+
23
−
0
View file @
ee3d518f
...
...
@@ -2,6 +2,7 @@ package fxKerho;
import
java.awt.Desktop
;
import
java.io.IOException
;
import
java.io.PrintStream
;
import
java.net.URI
;
import
java.net.URISyntaxException
;
import
java.net.URL
;
...
...
@@ -11,11 +12,15 @@ import fi.jyu.mit.fxgui.ComboBoxChooser;
import
fi.jyu.mit.fxgui.Dialogs
;
import
fi.jyu.mit.fxgui.ListChooser
;
import
fi.jyu.mit.fxgui.ModalController
;
import
fi.jyu.mit.fxgui.TextAreaOutputStream
;
import
javafx.application.Platform
;
import
javafx.fxml.FXML
;
import
javafx.fxml.Initializable
;
import
javafx.scene.control.Label
;
import
javafx.scene.control.ScrollPane
;
import
javafx.scene.control.TextArea
;
import
javafx.scene.control.TextField
;
import
javafx.scene.text.Font
;
import
kerho.Jasen
;
import
kerho.Kerho
;
import
kerho.SailoException
;
...
...
@@ -33,6 +38,7 @@ public class KerhoGUIController implements Initializable {
@FXML
private
ComboBoxChooser
<
String
>
cbKentat
;
@FXML
private
Label
labelVirhe
;
@FXML
private
ListChooser
<
Jasen
>
chooserJasenet
;
@FXML
private
ScrollPane
panelJasen
;
private
String
kerhonnimi
=
"kelmit"
;
...
...
@@ -120,10 +126,15 @@ public class KerhoGUIController implements Initializable {
// Tästä eteenpäin ei käyttöliittymään suoraan liittyvää koodia
private
Kerho
kerho
;
private
TextArea
areaJasen
=
new
TextArea
();
// TODO: poista lopuksi
private
void
alusta
()
{
panelJasen
.
setContent
(
areaJasen
);
areaJasen
.
setFont
(
new
Font
(
"Courier New"
,
12
));
panelJasen
.
setFitToHeight
(
true
);
chooserJasenet
.
clear
();
chooserJasenet
.
addSelectionListener
(
e
->
naytaJasen
());
}
...
...
@@ -201,6 +212,18 @@ public class KerhoGUIController implements Initializable {
}
}
private
void
naytaJasen
()
{
Jasen
jasenKohdalla
=
chooserJasenet
.
getSelectedObject
();
if
(
jasenKohdalla
==
null
)
return
;
areaJasen
.
setText
(
""
);
try
(
PrintStream
os
=
TextAreaOutputStream
.
getTextPrintStream
(
areaJasen
))
{
jasenKohdalla
.
tulosta
(
os
);
}
}
/**
* Astetaan käytettävä kerho
...
...
This diff is collapsed.
Click to expand it.
luennot/live14/src/fxKerho/KerhoGUIView.fxml
+
1
−
1
View file @
ee3d518f
...
...
@@ -107,7 +107,7 @@
<Label
text=
"Jäsenen tiedot"
BorderPane.alignment=
"CENTER"
/>
</top>
<center>
<ScrollPane
fitToWidth=
"true"
pannable=
"true"
BorderPane.alignment=
"CENTER"
>
<ScrollPane
fx:id=
"panelJasen"
fitToWidth=
"true"
pannable=
"true"
BorderPane.alignment=
"CENTER"
>
<content>
<GridPane
hgap=
"10.0"
>
<columnConstraints>
...
...
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