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

ScalaFX/JavaFX Node.translateX/Y not obeyed when inside BorderPane

I am drawing various Rectangle nodes that I want to be able to drag around the screen. My code is currently this: stage = new Stage { scene = new Scene(1100, 700) { root = new BorderPane { center = new Group() { fill =…
bronxbomber92
  • 280
  • 2
  • 5
1
vote
1 answer

Where to store css style sheet for sbt ScalaFX project

Does anyone know where in an sbt directory structure ScalaFX looks for CSS style sheets? I've tried putting them in the same directory as my ScalaFX app main file, in a resources directory, directly in src, and pretty much everywhere else - yet…
hegash
  • 833
  • 1
  • 7
  • 16
1
vote
0 answers

How Can I Create two window in scalafx?

I want two windows in a single scene using scalafx with my GUI. Is there any specific method in scalafx by which I can create that?
Yeasmin
  • 21
  • 1
1
vote
1 answer

How to create two scenes in scalafx

I am new to creating GUI using scalafx. I am trying to create two scenes with the following code but getting some error import com.sun.glass.ui.Application import scalafx.event.ActionEvent import scalafx.event.EventHandler import…
Yeasmin
  • 21
  • 1
1
vote
1 answer

HBox not resizing in ScalaFX

I've got a simple UI consisting of an HBox with two elements (here, labels, but I've had the same issue with a TreeView. stage = new PrimaryStage { title = "Simple UI" scene = new Scene { content = new HBox() { children =…
Adam Luchjenbroers
  • 4,917
  • 2
  • 30
  • 35
1
vote
1 answer

scalaFX - Titledpane: how do I get the heigth of the content?

I created a TiteldPane in scalafx val titled: TitledPane = new TitledPane() and put some nodes in it for my GUI. Later I want to read out the heigth of the content of titled. In javaFX this would be done with: ((Region)…
Michael W.
  • 182
  • 1
  • 12
1
vote
1 answer

scalafx and TableView: how do I change slectionModel and focusModel?

I want to use a TableView in scalafx to have a nice table in my GUI where the user can see and input data. There are some nice methods in the classes TableViewSelectionModel and TableViewFocusModel that I would like to use, like for example…
Michael W.
  • 182
  • 1
  • 12
1
vote
1 answer

ScalaFx MouseEvent: java.lang.NoSuchFieldError: BACK

What can be the reason for getting this error in run-time (see title) while referring to ScalaFx class, instead if I switch to JavaFx class reference (workaround) things work as expected? With Scala 2.12 and ScalaFx 8.0.192-R14 things were working…
user10138499
1
vote
1 answer

How to convert ScalaFX root to image and then save it in local

I am creating a "line chart" using scalaFX as below and want to save the scene as an image in the local. I know there is one function in scalaFX - snapshot but I do not know how to use it. I could not find any examples anywhere.
shubham
  • 25
  • 7
1
vote
0 answers

ProgressBar framerate drops when Label draws on top

I'd not normally ask for help here, but I'm stumped - this bug is the strangest thing I've seen in a long time. https://gfycat.com/FluidFrigidEastsiberianlaika I've got a simple UI object called GhostProgressBar that extends ScalaFX.StackPane and…
user3702702
1
vote
0 answers

scalafx custom binding race condition

I'm trying to use Amazon Rekognition to draw boxes around detected text in an image. Here's a stripped-down JavaFX app that is supposed to do that: object TextRekognizeGui extends JFXApp { lazy val rekognition: Option[AmazonRekognition] = …
ILikeFood
  • 400
  • 2
  • 8
  • 22
1
vote
0 answers

How to update scene in scalafx?

I'm new in scalafx, and trying to do a little game. The idea is to draw rectangles. I get list with coordinates of rectangle and draw it. I have a client and when i create it i send graphicContext as an argument, and in client i response some list…
Ordec
  • 89
  • 1
  • 1
  • 9
1
vote
1 answer

How does one combine ScalaFXML with Gradle?

Let me set up my end goal first: I want to build a scala only gui application, that I can design with scene builder and later port with gluon to any platform I want to. I was able to find out, that one needs to use JavaFXPorts in Scala to make that…
SleightX
  • 43
  • 1
  • 9
1
vote
0 answers

ScalaFX: how to wrap text in a TableCell

I want to show a list of key and values in a TreeTableView, and some of the values are a bit longer text which I want to wrap around and show completely. I thought I use TextFieldTreeTableCell with wrapText and vgrow as follows: val valCol = new…
Norbert Preining
  • 237
  • 1
  • 11
1
vote
1 answer

Scala ScalaFX: how to deal with large set of changes of Observable*

I am using a ObservableMap for data modeling, and want to update the whole entry. Initially the ObservableMap is empty, and it is filled asynchronously with lots of elements. Now the problem is that an onChanged event is shot for each and every…
Norbert Preining
  • 237
  • 1
  • 11