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
3
votes
1 answer

ScalaFX. Label - How to bind IntegerProperty?

I have a simple form for example: object Main extends JFXApp { stage = new PrimaryStage() { title = "My Form" scene = new Scene { root = new Label { text <== ViewModel.intProp } } } } And a simple example…
Oleg
  • 899
  • 1
  • 8
  • 22
3
votes
1 answer

scalaFX standalone execute jar file

Good day! Help me, please. I startup this example sbt> run It's okey all play, after sbt> package Will build jar file, after double click messge: Error: A JNI error has occured, please check your installation and try again. Scala version: 2.12.4.…
Dima
  • 27
  • 4
3
votes
0 answers

Javafx/Scalafx i18n simple switch (using fxml)

I'm developing scalafx application (I mentioned javafx because what I'm facing is, basically, javafx problem - scalafx is just shell around it) and I want to switch i18n during the program execution at will. Here is my (working) solution for no-fxml…
3
votes
1 answer

ScalaFX How do I create a method to react to changes in a var (ObjectProperty)?

I am making a multiplayer game client with ScalaFX GUI and Akka remoting for networking. When my client receives game data it stores it inside Model.gameData. I need my GUI to respond to this variable change. I used gameData to create…
Dimitry
  • 41
  • 3
3
votes
1 answer

How to implement a scrollable, zoomable map in JavaFX/ScalaFX?

I am implementing a map as a computer game accessory; it should show the geography of the computer game with a few informative overlays. I wonder what's the best way to achieve this in JavaFX, or more precisely ScalaFX. Right now, I have a very…
Silly Freak
  • 4,061
  • 1
  • 36
  • 58
3
votes
1 answer

Scala instantiation of a class with curly braces

I am starting with Scala and with ScalaFX, I understand most of the code but I don't understand this code using for the examples in ScalaFx; where instantiate an anonymous class follow it by curly braces, How this works??? object ScalaFXHelloWorld…
legramira
  • 598
  • 6
  • 13
3
votes
1 answer

Type mismatch on TableView example

I got another weird error trying out the examples from the scalafx-repo. This time I copied the whole file. But I still got the following error: Error:(26, 11) type mismatch; found : scalafx.scene.control.TableColumn[hello.Person,String] …
3
votes
1 answer

Scala libraries for a GUI with vector graphics

If I wanted to create a "good old" desktop GUI program with some basic selectable vector graphics (arrows, colored boxes, text) to show mostly text and some diagrams (no need for 3D or particles, etc.) that then can be edited by the user, which…
fnl
  • 4,861
  • 4
  • 27
  • 32
3
votes
2 answers

Make ScalaFX scene draggable

I am actually working on an ScalaFX application without window decorations. What I want to do is making it draggable, so that a user can move it anyhow. I managed moving the stage by simply writing the coordinates of the dragging mouse into the…
smoes
  • 591
  • 2
  • 17
3
votes
3 answers

How do Iaunch a ScalaFX application from Scala?

I'm trying to launch the ScalaFX Hello World application from http://www.scalafx.org with the following code: package car.cadr object ApplicationStarter { def main(args: Array[String]) = …
My other car is a cadr
  • 1,429
  • 1
  • 13
  • 21
3
votes
2 answers

How to declare a property change listener in ScalaFX properly?

Using this code as an example I have written the following to track changes of a slider and put the result into the "speed: Int" variable: speedSlider.valueProperty.addListener(new ChangeListener[Number] { @Override def changed(o:…
Ivan
  • 63,011
  • 101
  • 250
  • 382
3
votes
1 answer

Strange behaviour with mouse click and hover on javafx2

I am trying to use javafx2 on scala with scalafx. I wrote a simple application and add a menu and a menu item. When i click the menu and hover on the menu item it some times not highlight the menu and as a result it cannot be clicked. In order to…
Iraklis
  • 810
  • 5
  • 14
3
votes
1 answer

JavaFX / ScalaFX - Change text color of disabled TextArea?

I have a GUI with some TextArea elements to display information. As the GUI shall react to keyevents I added a EventHandler to the scene element. Because I didn't want to add one EventHandler to each textarea I disabled them to prevent that they are…
Fabian
  • 547
  • 1
  • 4
  • 17
3
votes
2 answers

Compiling scalafx for Java 7u7 (that contains JavaFX 2.2) on OS X

The compilation instructions of scalafx says to do: export JAVAFX_HOME=/Path/To/javafx-sdk2.1.0-beta sbt clean compile package make-pom package-src However, with the new packaging of JavaFX as part of the Java JDK itself (i.e. 7u7 for OS X) there…
akauppi
  • 17,018
  • 15
  • 95
  • 120
2
votes
1 answer

Scala 3 with ScalaFX thread related problem

I have an application that has multiple screens and a process that needs to get UI info from some and update others. Tried many methods but the result always is always "not a Java FX thread". Without using some kind of thread the UI does not update…
Ian
  • 412
  • 1
  • 4
  • 18
1 2
3
14 15