Skip to main content
Filter by
Sorted by
Tagged with
2 votes
2 answers
138 views

ScalaFX type mismatch witch JavaFX namespace

While compiling the MainStageDemo from scalafx.org I get this error message: None of the overloaded alternatives of method <== in trait Property with types (v: scalafx.beans.value....
Ukisha's user avatar
  • 21
0 votes
0 answers
27 views

Scalafx: UnsupportedClassVersionError [duplicate]

I'm trying to use Scalafx in project. Dependencies are: ThisBuild / scalaVersion := "2.12.1" libraryDependencies += "com.google.code.findbugs" % "jsr305" % "3....
Jelly's user avatar
  • 1,296
2 votes
1 answer
153 views

ScalaFX and Cats Effect

I am trying to integrate Cats Effect into a ScalaFX desktop application, and I am having trouble getting the tasks to execute. I would like to run a background thread/fiber to initialize the window ...
Jonathan Card's user avatar
0 votes
0 answers
46 views

ScalaFX can't find a css resource file

I am creating a GUI for my app, and I want to style it. To add css to a scene, I use the following code: val scene = new Scene(parent = root) { stylesheets.add(getClass.getResource("a....
va pupa's user avatar
0 votes
0 answers
31 views

ScalaFX When dragging the mouse too quickly on canvas, the drawn line appears as a series of dots rather than a continuous line

package com.doodlr.view import javafx.fxml.FXML import scalafx.scene.input.MouseEvent import scalafx.Includes.jfxCanvas2sfx import scalafx.scene.canvas.Canvas import scalafxml.core.macros.sfxml ...
user17359212's user avatar
0 votes
0 answers
40 views

How can I have a loading window appear whilst a process is running?

I have a ScalaFX application that I would like to call a python script upon the clicking of an imageview. This python script will then write to a text file that the ScalaFX application will read from ...
SendHelpPlease's user avatar
1 vote
1 answer
70 views

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 ...
hegash's user avatar
  • 863
0 votes
1 answer
171 views

How to draw a grid out of grid squares seamlessly in JavaFX

I'm been writing maze algorithms, and want to draw the mazes generated using JavaFX. To begin with, I'm attempting to draw a simple grid - but made up of smaller shapes so that I'll later be able to ...
user18898152's user avatar
0 votes
1 answer
75 views

I am very close to finish my to do list application but there is a slight error

This is a to-do list application that i made as a beginner. However, there is an error that says missing parameter type in this line of code: todoTable.selectionModel().selectedItem.onChange( (_, ...
hui yeen's user avatar
2 votes
0 answers
41 views

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's user avatar
  • 31
1 vote
1 answer
190 views

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 ...
Yeasmin's user avatar
  • 31
2 votes
1 answer
203 views

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"....
Ian's user avatar
  • 476
-1 votes
1 answer
61 views

How to fix this code? Enable the java parseDouble in scalafx program

I am a new learner of scala and I am coding a simple scalafx calculator and now I face a problem. I cannot find another suitable code to replace the parseDouble. I know the parseDouble is the member ...
kxaio1117's user avatar
0 votes
0 answers
166 views

ScalaFX | ListView | How do I select all item in listview using selectionModel()?

I want to come up with a messaging app. Right now, it works for 1 to 1 conversation. However, I am trying to come up with a button that broadcasts the message to everyone. I am thinking to use ...
Bryan Liew's user avatar
0 votes
1 answer
38 views

Unable to draw multiple instace of same Image with GraphicsContext

Hi guys this is my first question, so feel free to give constructive criticism. I am making a space shooter game with ScalaFX and I'm facing a problem where when I am drawing the bullet laser in my ...
Law Wen Jun's user avatar
1 vote
1 answer
61 views

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 ...
Adam Luchjenbroers's user avatar
0 votes
1 answer
458 views

Scala compile time error, missing parameter type

I am trying to get a dialogue to get numeric input using this code val dialog: TextInputDialog = new TextInputDialog{ initOwner(Main.stage) title = "Set Programme Counter" ...
Ian's user avatar
  • 476
4 votes
2 answers
1k views

jpackage on Windows: The system cannot find file, error 103

I am trying to package a ScalaFx app I built using jpackage and having trouble on windows (mac & linux work just fine). I am building a fat jar using sbt assembly and then using jpackage to create ...
benthecarman's user avatar
1 vote
1 answer
111 views

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 ...
Michael W.'s user avatar
0 votes
0 answers
28 views

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 ...
Gorgonzola45's user avatar
1 vote
1 answer
261 views

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 ...
Michael W.'s user avatar
2 votes
0 answers
75 views

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 ...
user avatar
0 votes
1 answer
71 views

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 ...
alexandross's user avatar
0 votes
1 answer
644 views

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 [...
lamecoder's user avatar
0 votes
1 answer
275 views

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....
Invalidstr ingError 007Strings's user avatar
0 votes
1 answer
352 views

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 ...
finite_diffidence's user avatar
4 votes
1 answer
235 views

ScalaFX - How to get the title of a Scene using a method

I am using ScalaFX and trying to learn how it works. As an exerpiment (not what I will do in production) I want a method that gets the title of a window. So here is my Graph.scala file: package ...
finite_diffidence's user avatar
3 votes
1 answer
279 views

How to dynamically add Nodes to VBox in ScalaFX

My ScalaFX app has a Button that adds a GridPane to a VBox. I tried directly updating the VBox children in Button.onAction but that causes the Button to become non-responsive after rendering the first ...
user1332148's user avatar
  • 1,346
3 votes
1 answer
245 views

Handle input events in stateless manner

Yesterday I`ve asked how may I handle keyboard input (with ScalaFX) in a functional manner. Thanks to @alfilercio help I came up with something like this: class InputHandler { private val goUp: Int ...
ayeo's user avatar
  • 482
3 votes
1 answer
997 views

How to change LineChart XAxis lower/upper bounds in ScalaFX?

I have a ScalaFX LineChart whose XAxis is time. The data is dynamic, being updated in an AnimationTimer. As time progresses the plot moves to the right but the plot always starts at 0, so the visible ...
user1332148's user avatar
  • 1,346
3 votes
1 answer
299 views

How to set the items in a ChoiceBox

I have a ChoiceBox that I want to set with an ObservableList. In JavaFX I might do: ObservableList genres = FXCollections.observableArrayList( "Chamber", "Country", "Cowbell", "Metal", "...
user79074's user avatar
  • 5,229
0 votes
1 answer
204 views

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 ...
user79074's user avatar
  • 5,229
0 votes
1 answer
113 views

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 ...
user avatar
1 vote
1 answer
136 views

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....
user avatar
0 votes
1 answer
96 views

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....
user avatar
0 votes
1 answer
85 views

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 ...
schmop's user avatar
  • 1,440
2 votes
1 answer
548 views

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 ...
user avatar
5 votes
1 answer
556 views

Make ScalaFx working on both JDK 8 and 11

To my dismay I have realized my open source ScalaFX application does not run with JDK 11. The application was developed with JDK 8. I have read about a JFX module and I can see there exist versions of ...
Suma's user avatar
  • 34.3k
2 votes
1 answer
2k views

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 ...
Hugo Barroca's user avatar
11 votes
3 answers
1k views

What's the magic behind ScalaFX to make OpenJDK 9+ actually work?

Environment: OpenJDK 64-Bit Server VM Zulu12.2+3-CA (build 12.0.1+12, mixed mode, sharing) Scala 2.12.7 Windows 10 Professional, X86_64 IntelliJ IDEA 2019.1.3 (Ultimate Edition) I checked out the ...
Hannes's user avatar
  • 5,232
2 votes
1 answer
230 views

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 ...
Keem's user avatar
  • 23
2 votes
1 answer
146 views

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 ...
Michael W.'s user avatar
-1 votes
1 answer
315 views

How do I run a basic ScalaFX application?

I'm trying to run a simple ScalaFX program that displays a window with nothing on it. I can run the program as a script file with the desired result, but the moment I add a main object to the ...
Colten Phillips's user avatar
0 votes
1 answer
299 views

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 ...
Sam Lu's user avatar
  • 13
0 votes
1 answer
99 views

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[...
Joshi Srikanth Rao's user avatar
4 votes
0 answers
576 views

How to efficiently plot continuous functions in ScalaFX/JavaFX

I'm working on a regression model visualizer and my current bottleneck has to do with plotting continuous functions. How the program works is that it loads data from a file containing (x, y) values, ...
Cartesian Bear's user avatar
3 votes
1 answer
137 views

Can't move TextFlow inside a new scene

In my ScalaFX project I want to create a separate help page for the user in which he/she can click a topic which causes instructions to appear next to the clickable topics. Problem is that when I ...
Cartesian Bear's user avatar
0 votes
1 answer
361 views

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 ...
Sean MacNamara's user avatar
3 votes
2 answers
1k views

Changing the size and symbol of scatter chart plot points in ScalaFX

I want to make a linear regression program which visualizes the data to user. I'm using EJML for calculations and ScalaFX for front end. Everything is going fine but when I plot the data using Scatter ...
Cartesian Bear's user avatar
1 vote
1 answer
418 views

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 ...
shubham's user avatar
  • 35

1
2 3 4 5