Skip to content
Snippets Groups Projects
Commit fc58fdce authored by Guransh Khurana's avatar Guransh Khurana
Browse files

contains the first iteration of the GUI text window to be displayed when a note is opened

parent 69146923
No related branches found
No related tags found
1 merge request!10Added basic GUI to console application
Pipeline #84190 passed
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="KotlinJpsPluginSettings"> <component name="KotlinJpsPluginSettings">
<option name="version" value="1.6.20" /> <option name="version" value="1.6.21" />
</component> </component>
</project> </project>
\ No newline at end of file
...@@ -5,15 +5,8 @@ ...@@ -5,15 +5,8 @@
plugins { plugins {
// Support convention plugins written in Groovy. Convention plugins are build scripts in 'src/main' that automatically become available as plugins in the main build. // Support convention plugins written in Groovy. Convention plugins are build scripts in 'src/main' that automatically become available as plugins in the main build.
id 'groovy-gradle-plugin' id 'groovy-gradle-plugin'
id 'application'
id 'org.jetbrains.kotlin.jvm' version '1.6.20'
id 'org.openjfx.javafxplugin' version '0.0.13'
} }
javafx {
version = '18.0.2'
modules = ['javafx.controls', 'javafx.graphics']
}
repositories { repositories {
// Use the plugin portal to apply community plugins in convention plugins. // Use the plugin portal to apply community plugins in convention plugins.
......
...@@ -4,6 +4,14 @@ ...@@ -4,6 +4,14 @@
plugins { plugins {
id 'notes.multi.kotlin-library-conventions' id 'notes.multi.kotlin-library-conventions'
id 'application'
id 'org.jetbrains.kotlin.jvm'
id 'org.openjfx.javafxplugin' version '0.0.13'
}
javafx {
version = '18.0.2'
modules = ['javafx.controls', 'javafx.graphics']
} }
dependencies { dependencies {
......
package notes.multi.utilities
import javafx.application.Application
import javafx.stage.Stage
import javafx.scene.Scene
import javafx.scene.control.ScrollPane
import javafx.scene.control.TextArea
import javafx.scene.layout.VBox
class TextWindow(val note: Note): Application() {
override fun init() {
super.init()
}
override fun start(stage: Stage?) {
stage?.setTitle(note.title)
val textarea = TextArea()
textarea.setText(note.text.toString())
textarea.setWrapText(true)
val scroll = ScrollPane()
scroll.content = textarea
stage?.scene = Scene(VBox(scroll), 300.0, 300.0)
stage?.show()
}
}
\ No newline at end of file
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