Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CS346
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
Container 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
Simon Wang
CS346
Commits
9ee13305
Commit
9ee13305
authored
2 years ago
by
Simon Wang
Browse files
Options
Downloads
Patches
Plain Diff
Window resizing fix
parent
0e9555d7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
application/src/main/kotlin/net/codebot/application/Main.kt
+15
-10
15 additions, 10 deletions
application/src/main/kotlin/net/codebot/application/Main.kt
with
15 additions
and
10 deletions
application/src/main/kotlin/net/codebot/application/Main.kt
+
15
−
10
View file @
9ee13305
package
net.codebot.application
import
javafx.application.Application
import
javafx.geometry.Insets
import
javafx.scene.Scene
import
javafx.scene.control.*
import
javafx.scene.layout.BorderPane
import
javafx.scene.layout.HBox
import
javafx.scene.layout.StackPane
import
javafx.scene.layout.VBox
import
javafx.scene.layout.*
import
javafx.scene.paint.Color
import
javafx.scene.text.Font
import
javafx.scene.text.Text
import
javafx.stage.Stage
import
net.codebot.shared.SysInfo
class
Main
:
Application
()
{
override
fun
start
(
stage
:
Stage
)
{
// code for toolbar
val
toolbar
=
ToolBar
(
Button
(
"New"
),
Button
(
"Open"
),
Button
(
"Save"
)
)
// code for center area
val
text
=
TextArea
()
text
.
isWrapText
=
true
text
.
text
=
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, "
+
...
...
@@ -30,14 +31,22 @@ class Main : Application() {
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, "
+
"Lorem ipsum dolor sit amet, consectetur adipiscing elit."
text
.
font
=
Font
(
"Helvetica"
,
12.0
)
text
.
prefColumnCount
=
200
val
center
=
HBox
(
text
)
center
.
minWidth
=
400.0
// code for status bar (bottom pane)
val
label
=
Label
(
"Test for Status Bar"
)
val
status
=
HBox
(
label
)
// code for left pane
val
left
=
VBox
(
Text
(
"Left Pane"
))
// code for right pane
val
right
=
VBox
(
Text
(
"Right Pane"
))
right
.
prefWidth
=
750.0
right
.
setStyle
(
"-fx-background-color: #FFA500;"
)
right
.
setBackground
(
Background
(
BackgroundFill
(
Color
.
ORANGE
,
CornerRadii
.
EMPTY
,
Insets
.
EMPTY
)))
val
border
=
BorderPane
()
border
.
top
=
toolbar
...
...
@@ -45,11 +54,7 @@ class Main : Application() {
border
.
bottom
=
status
border
.
left
=
left
border
.
right
=
right
/** stage.scene = Scene(
BorderPane(Label("Hello ${SysInfo.userName}")),
250.0,
150.0)
**/
val
scene
=
Scene
(
border
)
stage
.
isResizable
=
true
stage
.
width
=
750.0
...
...
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