Skip to content
Snippets Groups Projects
Commit 9ee13305 authored by Simon Wang's avatar Simon Wang
Browse files

Window resizing fix

parent 0e9555d7
No related branches found
No related tags found
No related merge requests found
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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment