Questions tagged [scalafx]

ScalaFX is a Scala user interface (UI) domain-specific language (DSL) built on top of JavaFX. This means that every ScalaFX application is also a valid Scala application. By extension it supports full interoperability with Java and can run anywhere the Java Virtual Machine (JVM) and JavaFX are supported.

ScalaFX is a Scala user interface (UI) domain-specific language (DSL) built on top of JavaFX. This means that every ScalaFX application is also a valid Scala application. By extension it supports full interoperability with Java and can run anywhere the Java Virtual Machine (JVM) and JavaFX are supported.

214 questions
0
votes
0 answers

Accessing ScalaFX chart axis extreme values

I'm building a regression visualiser and can plot the original data and calculate the regression model. For fitting, I'd like to include predictions for the whole chart axis range available, not only the original data range. Creating the empty chart…
0
votes
1 answer

Is it possible to have the view implementation hidden in a Scala application?

My goal is to have an MVC pattern in a simulation application where the controller knows there is a view (and interacts with it using an interface) but doesn't know how it is implemented: object Controller extends App { View.initView() …
0
votes
1 answer

scalafx in scala project intellij (unresolved dependencies path:)

i was compiling my scalafx code in intellij in a sbt file and they kept showing me this error, please help i tried everything but its still not working [info] Updating [info] Resolved dependencies [warn] [warn] Note: Unresolved dependencies…
lamecoder
  • 1
  • 2
0
votes
1 answer

I can't get my scalaFX menubar to show up in my gui

I'm playing with ScalaFX because I want to make an encrypted file app but, like the title said, I'm running in to problems. I want to avoid using brackets as I think they are ugly. import scalafx.application.JFXApp import…
0
votes
1 answer

ScalaFX (or JavaFX) - Calling GUI from another main class multiple times

I am following on from a previous question: link I am writing a standalone visualization package for a simulation package The simulation package is written by one of our team in Scala What I want to do, is create a matplotlib like package for this…
finite_diffidence
  • 893
  • 2
  • 11
  • 20
0
votes
1 answer

What is the correct way to convert from a javafx ObjectProperty to as scalafx ObjectProperty

Say I have the following code: import scalafx.beans.property.ObjectProperty import scalafx.scene.image.Image def foo(property: ObjectProperty[Image]) = {...} Then somewhere else I have an image view who's imageProperty I want to pass to the…
user79074
  • 4,937
  • 5
  • 29
  • 57
0
votes
1 answer

ScalaFX how to close a secondary stage

How to close a secondary stage, which is utilized as an auxiliary window? So I have a primaryStage used as the UI platform and occasionally I need to open a secondary window which is pretty straight forward, but to close it in a method is not…
user10138499
0
votes
1 answer

ScalaFx Group wrapped nodes data extraction

Trying to extract Group wrapped node data seems really tricky. Any pointers getting data inside node objects (which by definition have no children) like in code below I would like to get Rectangle.userData inside Group(VBox(Rectangle))? def west():…
user10138499
0
votes
1 answer

ScalaFX PickResult with subclassed nodes

I have a simple scalafx app but I am struggling to get simple mouse interactions working. I have custom Canvas node class called Square : case class Square(val index: Int) extends Canvas I then have a custom GridPane that is filled with squares…
schmop
  • 1,440
  • 1
  • 12
  • 21
0
votes
1 answer

How to add a mp3 in scalafx gui scene?

I trying to add a mp3 in to my scala gui using scalafx, but i have trouble how to add in to the scene this is what i have, but it doesn't work... val gameStage = new PrimaryStage { title = "Game Graphics" scene = new Scene(windowWidth,…
Sam Lu
  • 13
  • 3
0
votes
1 answer

Unable to access ScalaFXML controller class members in another class

I have following code @sfxml class Charts(private val predicate_chart:ComboBox[String], private val measure_chart : ComboBox[String], private val chart_chart : ComboBox[String], private val chart_graph :…
0
votes
1 answer

ScalaFX type mismatch on event.getCode()

I'm getting this error in ScalaFx when trying to set an event handler for key presses: Type mismatch, expected: scalafx.scene.input.KeyCode, actual: javafx.scene.input.KeyCode I'm unsure as to why the actual type is coming out as a Java type, I…
0
votes
0 answers

ScalaFX Dialog onShown runs BEFORE the dialog is shown

According to the ScalaFX API, the dialog.onShown tasks run directly AFTER the dialog is shown. I have some task that takes time. I need to open a "LOADING" dialog for the user to see while the task runs. This is an illustration of my code: val…
H. Dayekh
  • 11
  • 1
0
votes
1 answer

How do you bind the ColorPicker value property to a ScalaFX ObjectProperty in ScalaFX?

I cannot seem to understand the proper way to bind the ColorPicker value property to an ObjectProperty in ScalaFX. This is what I have done so far: private val colorProp = new ObjectProperty[Color](this, "test", Color.White) // Create color…
0
votes
1 answer

ScalaFX TableView - simple example compiler error

I am just trying to get familiar with ScalaFX, and my Scala knowledge is also still in embryo phase. Can you please help me out, in the following simple problem? import scalafx.application.JFXApp import scalafx.application.JFXApp.PrimaryStage import…
bayerb
  • 649
  • 2
  • 9
  • 28