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
2
votes
0 answers

ScalaFX TreeItem CellFactory implementation for mouse events

I am trying to implement a ScalaFX TreeView representing a directory structure, with some TreeItem elements in the tree structure able to capture a MouseClicked event so that I can do further operations (subsequently show the contents of that…
user10138499
2
votes
1 answer

ScalaFx children hierarchy and casting / instance reference

I'm wandering if this is the optimal way of doing it with ScalaFx: A GUI is composed of bunch of nodes, to which I suck content from a SQL-DB. Main Pane is a FlowPane populated with few hundred elements. Each element is composed of four level…
user10138499
2
votes
1 answer

SBT won't compile HelloWorld ScalaFX example, complains about javafx missing from the classpath

I am new to Scala, and have never used a build tool before, and I am having some trouble getting the HelloWorld example on the scalafx quickstart page to compile. I previously tried to use the scala IDE 4.7.0 Release to run the code, by creating a…
2
votes
1 answer

Trying to get user's latest mouse click in scalafx

I'm trying to get user's latest mouse click in order to display the right table. However, I can't find any way to implement this idea. How do i get user's latest mouse click by using mouseEvent function? I tried using if else statements but it…
Keem
  • 23
  • 4
2
votes
1 answer

How can I write a save GUI-Aktor for Scalafx?

Basically I want an Aktor to change a scalafx-GUI safely. I've read many posts describing this, but there where sometimes contradictory and some years old, so some of them might be outdated. I have a working example code and I basically want to know…
Michael W.
  • 182
  • 1
  • 12
2
votes
1 answer

ScalaFX canvas poor performance when drawing image with animation timer

I plan to make a rhythm game by using ScalaFX with canvas, When I try to run the code, I found that it consumes a lot of GPU, and sometimes the frame rate drop at 30 fps, even I only draw one image on the canvas without drawing any animated note,…
jiale ko
  • 139
  • 1
  • 13
2
votes
1 answer

How do I use the scalafx KeyCodeCombination.match function?

Here is what I thought would work based on javafx examples I've seen, but I'm getting an error on the (ctlA.match(ke)) pointing to "match" and saying "identifier expected but 'match' found." Any links to scalafx examples that have complex KeyEvent…
Babu
  • 58
  • 5
2
votes
1 answer

How can I update TableView in ScalaFX?

I have a table view. When I update the properties of one row, I can not see the modifications? For example: implicit class PersonView(p:Person) { val fname = new ObjectProperty(this, "fname",p.name) } and in my table view lazy val tableLines =…
Rom
  • 67
  • 1
  • 2
  • 12
2
votes
1 answer

Scalafx. Start the Alert by Timer

I have a main window with some information. I can't start the Alert by timer. I need to show alert every 10 seconds(with working main window) and by the alert's button change the Label's text in the main window. I have this code, but it's not…
2
votes
1 answer

ScalaFX. Live binding

I have a simple UI window with just one Text node, witch shows current time and binded to the model: import model.Clock import scalafx.application.JFXApp import scalafx.application.JFXApp.PrimaryStage import…
Oleg
  • 899
  • 1
  • 8
  • 22
2
votes
1 answer

Removing listeners from property in ScalaFX

I'm struggling with removing an event listener from Property in ScalaFX. Simplified example import scalafx.Includes._ object ListenerApp { val prop = DoubleProperty(0) val listener = (source, oldValue, newVal) => { println("Listener…
ZbyszekKr
  • 512
  • 4
  • 15
2
votes
2 answers

JavaFX/ScalaFX & Clipboard: Cannot copy files?

Copying files does not work: def toClipboard(selectedLinesOnly: Boolean = false): Unit = { val clipboard = Clipboard.systemClipboard val content = new ClipboardContent val items: Iterable[FileRecord] = selectedLinesOnly match { …
ideaboxer
  • 3,863
  • 8
  • 43
  • 62
2
votes
1 answer

Simple ScalaFx TableView example not compiling

I took a TableView code from a simple ScalaFx example (simplified from ScalaFx Custom cells): import scalafx.application.JFXApp import scalafx.beans.property.StringProperty import scalafx.collections.ObservableBuffer import…
Suma
  • 33,181
  • 16
  • 123
  • 191
2
votes
1 answer

how to create an updateable tableview cell in Scala

I have created a tableview with their components inside it, assigned cellValueFactory and have set the properties editable to true. Somewhere in my code, I have the following : ... tableID.selectionModel().selectedItem.onChange( …
atjua
  • 541
  • 1
  • 9
  • 18
2
votes
0 answers

ScalaFX 8 drag and drop node into another node

I need to drag a rectangle node into another one. ScalaFX should be based on JavaFX so this should work similarly, right? Since there is not much ScalaFX documentation, I tried to find some JavaFX examples and I have read quite a lot of them, but…
Klinki
  • 1,399
  • 3
  • 15
  • 33