by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 24 16:58
    jpsacha commented #322
  • May 24 16:56
    jpsacha edited #322
  • May 24 16:53
    jpsacha labeled #322
  • May 23 17:28
    jpsacha closed #305
  • May 23 17:26

    jpsacha on master

    Discontinue support for Scala 2… (compare)

  • May 23 14:44
    jpsacha closed #56
  • May 23 14:44
    jpsacha commented #56
  • May 23 14:35
    jpsacha closed #138
  • May 23 14:35
    jpsacha commented #138
  • May 23 14:28
    rom1dep commented #324
  • May 23 14:16
    jpsacha closed #321
  • May 23 14:16
    jpsacha commented #321
  • May 23 13:50
    jpsacha commented #324
  • May 23 08:13
    rom1dep commented #324
  • May 23 05:01

    jpsacha on master

    WIP: Add type annotations for p… (compare)

  • May 23 01:41
    jpsacha milestoned #324
  • May 23 01:41
    jpsacha labeled #324
  • May 23 01:41
    jpsacha opened #324
  • May 13 14:42
    jpsacha milestoned #323
  • May 13 14:42
    jpsacha labeled #323
Rajmahendra
@rajmahendra
Just opened a issue regarding "Making ScalaFx as part of Typelevel project" scalafx/scalafx#250
Rajmahendra
@rajmahendra
@/all we need people who like to join Typelevel as part of scala fx please post in the issue scalafx/scalafx#250
Saurabh Rawat
@eklavya
TextFieldTableCell only allows editing a String field
I have a Double field
how do I make it work?
Saurabh Rawat
@eklavya
nm I see there is a converter function too
Rajmahendra
@rajmahendra
@/all We need your support to move ScalaFx into TypeLevel community... Please give a thumbs up for the issue , typelevel/general#46 More thumbs up we get more faster we can join :)
olivetechnologies
@olivetechnologies
hello
Josh Cough
@joshcough
Hello. Is this room active?
Grigory
@pomadchin
@joshcough yo; looks like no
Josh Cough
@joshcough
sad.
is scalafx active?
Grigory
@pomadchin
who knows :\
kinda like
but gitter chat is always silent
Rich
@Rich2
Well I'm certainly still using ScalaFx and I imagine it will be quite some time, if ever that Native can fully replace my JVM Gui use cases.
Thomas J. Clancy
@tjclancyhome
Hello
nafg
@nafg
@joshcough @pomadchin another option is to use Binding.scala, which has support for javafx
Robin Hilliard
@robinhilliard
Hi I was just looking into Scala and ScalaFX as a cross platform desktop UI but was surprised at how quiet the community is (I joined Gitter just to check this room). I was wondering, does ScalaFX expose all of JavaFX or only a subset? Should I interpret the quietness as "ScalaFX is great, but nobody does desktop apps in Scala/does desktop apps in JavaFX/does desktop apps at all"?
Grigory
@pomadchin
there are no commits into scala fx since oct 2017 not sure about hte status of the project

but from my experience GUI in java world is always a pain (:

but ScalaFX / JavaFX one of the best choices to do GUI in Scala / Java

Also not sure how much of the API was exposed, but i believe they are trying to port everything

Ghost
@ghost~563d4ed816b6c7089cb9c84a
Yeah, I'm really not sure how many active/in-production projects are actually using Scalafx; Really even JFX proper -- especially now that QT & Electron seems to be eating it's lunch.
The little I've played with Scalafx though, seems pretty nice/encompasing; So a bit sad.
Robin Hilliard
@robinhilliard
Thanks for that feedback Grigory/Joshua. I used to be very involved with Flex (I worked at Macromedia) and JFX seemed to leverage a lot of the same concepts. Reading around it seemed that another issue was that the newer Java versions were picking stuff up from Scala, making it less of a pain to go with JFX in Java.
nafg
@nafg
FWIW Binding.scala has a backend for jfx
Jared Engelkemier
@Jengel1

Hey everyone,

I'm still pretty new to ScalaFX but I love it so far. I'm having some trouble dynamically updating my ListView. I know the ListView constructor takes items:Seq[T] and I can pass in an Array[String] to the constructor and populate my ListView without errors. But when my application adds, modifies, or deletes a record from the Array, I'm having trouble updating the ListView. I know that ListView.items = v:ObservableBuffer[T]. But I keep getting a type mismatch error when I pass either the updated Array[String] or an ObservableBuffer[Array[String]]. Compiler wants an ObservableBuffer[Nothing]. I've searched the API, GitHub, and Stack Overflow and can't find a good solution. Any suggestions on dynamically updating my ListView? Thanks.

Romain DEP.
@rom1dep
hi there :)
jpsacha: hello!
Shovon Das
@shovoncse

How to run flash enabled webpage / that contains flash files (.swf) in JavaFX WebView?
As like browser says "Click to enable Adobe Flash Player".

When I run this link inside a WebView it does not ask to enable the flash and nothing shows inside.
http://lingkup.co.id/animasi/sirkulasi-air.html

Gonzalo Quero
@Thau

Hello, everyone! I'm having a bit of trouble using ScheduledService (bear in mind I'm a newbie in Scala, so I'm probably doing it terribly wrong). I'm trying to run a task every two ms, and for that, I'm doing this:

val svc = ScheduledService.apply(() => Task.apply(() => {
  println("Test")
}))

svc.period = Duration.apply(2)
svc.start()

But it doesn't seem to run or do anything. Can anyone guide me on what I'm doing wrong, please?

Romain DEP.
@rom1dep
@Thau
import javafx.embed.swing.JFXPanel
import scalafx.concurrent.{ScheduledService, Task}
import scalafx.util.Duration

object TinyMain extends App {
  new JFXPanel //Initializes the Toolkit

  val service = ScheduledService {
    Task {
      println("yo")
    }
  }

  service.period = new Duration(1000)
  service.start()
}
this WFM
Romain DEP.
@rom1dep
@jpsacha ping
BaghdadKh
@BaghdadKh
Hi , does scala-fx works with android and scala-js ?
Romain DEP.
@rom1dep
BaghdadKh: Hi! ScalaFX, as the name implies, is a Scala DSL for the JavaFX application framework. On android, the scala compat isn't terrific, due to android's only supporting old javas, maybe you will be able to use the fx-ports provided by gluonhq, and build a scalafx app on android using an ancient scala, but I doubt the experience will be great.
Gluon also is working on a separate JVM for android, which promises compat with newer javas (and I assume scalas), but I don't know where it's at.
JavaFX doesn't have javascript bindings, so I don't see how that would make sense to compile to JS and expect a JavaFX app in return, bit if you were to compile a JavaFX app for the web, you can have a look at jpro.one (never tried it)
Etturaz
@Etturaz
Hello. Very really newbie question: how do I use javafx themes such as bootstrapFx, gluon dark, &c. in ScalaFX?
jvr-ks
@jvr-ks

`
/*
// the file build.sbt:

scalaVersion := "2.12.9"

// https://mvnrepository.com/artifact/org.scalafx/scalafx
libraryDependencies += "org.scalafx" %% "scalafx" % "11-R16"

// https://mvnrepository.com/artifact/org.kordamp.bootstrapfx/bootstrapfx-core
libraryDependencies += "org.kordamp.bootstrapfx" % "bootstrapfx-core" % "0.2.4"

mainClass in (Compile,run) := Some("Bootstrapfx")

*/

// the file bootstrapfx.scala

import scalafx.Includes._
import scalafx.application.JFXApp
import scalafx.application.JFXApp.PrimaryStage
import scalafx.stage.Stage
import scalafx.scene.Scene
import scalafx.scene.layout.BorderPane
import scalafx.scene.control.Button

import org.kordamp.bootstrapfx.scene.layout._

object Bootstrapfx extends JFXApp {
stage = new PrimaryStage {
width = 800
height = 600

    scene = new Scene() {
        val button = new Button("Hello BootstrapFX")

        button.onAction = handle {
            stage.close()
        }
        button.getStyleClass().setAll("btn","btn-danger")
        root = new BorderPane() {
            center = button
        }
        stylesheets = List(getClass.getResource("org/kordamp/bootstrapfx/bootstrapfx.css").toExternalForm)
    }

}

stage.setTitle("BootstrapFX")

stage.show()

}

// to start: sbt run

`

jvr-ks
@jvr-ks
stage.show() is redundant
jvr-ks
@jvr-ks
does not run as scala-script
this runs as scala script, but not in the sbt console:
// this file bootstrapfx.scala

// jar file from https://mvnrepository.com/artifact/org.kordamp.bootstrapfx/bootstrapfx-core
// lib/bootstrapfx-core-0.2.4.jar

// jar file from https://mvnrepository.com/artifact/org.scalafx/scalafx
// lib/scalafx_2.12-12.0.2-R18.jar

// Java 8


// windows batchfile "run.bat" to run as scala-script:
/*
@rem add all *.jar in lib subdirectory to classpath

@echo off
set clp=.
for %%c in (lib/*.jar) do call :Setclasspath %%c
cmd /c scala -cp %clp% -savecompiled bootstrapfx.scala
exit /B %ERRORLEVEL%

:Setclasspath
set clp=%clp%;lib/%~1
exit /B 0

*/*/


import scalafx.Includes._
import scalafx.application.Platform
import scalafx.application.JFXApp
import scalafx.application.JFXApp.PrimaryStage
import scalafx.stage.Stage
import scalafx.scene.Scene
import scalafx.scene.layout.BorderPane
import scalafx.scene.control.Button

import java.util.concurrent
import org.kordamp.bootstrapfx.scene.layout._


val app = new JFXApp {
  def op = {
    stage = new PrimaryStage {
      width = 800
      height = 600

      scene = new Scene() {
        val button = new Button("Hello BootstrapFX")

        button.onAction = handle {
          stage.close()
          Platform.exit()
        }
        button.getStyleClass().setAll("btn", "btn-danger")
        root = new BorderPane() {
          center = button
        }
        stylesheets = List(getClass.getResource("org/kordamp/bootstrapfx/bootstrapfx.css").toExternalForm)
      }
    }
    stage.setTitle("BootstrapFX")
  }

  def onFXAndWait[R](op: => R): R = {
    if (Platform.isFxApplicationThread) {
      op
    } else {
      val callable = new concurrent.Callable[R] {
        override def call(): R = op
      }
      val future = new concurrent.FutureTask(callable)
      Platform.runLater(future)
      future.get()
    }
  }

  onFXAndWait[Unit](op)

  stage.show()
}

app.main(Array(""))
Spekular
@Spekular
Hi!
I'm getting a compilation error when I try to use Screen.getOutputScaleX ("not a member of scalafx.stage.Screen") on my desktop. However, on my laptop the code compiles fine. It looks to me like this function was introduced in Java 9, so my hunch is that for some reason my desktop is using JavaFX 8. I can't seem get sbt to build with a newer version though, and I can't even find where the old version would be installed to.

Here's my:
build.sbt (directly in the project folder)

calacOptions ++= Seq("-unchecked", "-deprecation", "-Xcheckinit", "-encoding", "utf8", "-feature")

// Fork a new JVM for 'run' and 'test:run', to avoid JavaFX double initialization problems
fork := true

//Allows command line version to take input
connectInput in run := true

resolvers += Resolver.sonatypeRepo("snapshots")

// Add dependency on ScalaFX library
libraryDependencies += "org.scalafx" %% "scalafx" % "12.0.2-R18"

// Determine OS version of JavaFX binaries
lazy val osName = System.getProperty("os.name") match {
  case n if n.startsWith("Linux")   => "linux"
  case n if n.startsWith("Mac")     => "mac"
  case n if n.startsWith("Windows") => "win"
  case _ => throw new Exception("Unknown platform!")
}

lazy val javaFXModules = Seq("base", "controls", "fxml", "graphics", "media", "swing", "web")
libraryDependencies ++= javaFXModules.map( m =>
  "org.openjfx" % s"javafx-$m" % "12.0.2" classifier osName
)

//Hopefully let assembly jars build?
assemblyMergeStrategy in assembly := {
 case PathList("META-INF", xs @ _*) => MergeStrategy.discard
 case x => MergeStrategy.first
}

libraryDependencies += "org.scala-lang.modules" %% "scala-xml" % "1.2.0"

build.properties (under "project" folder)

sbt.version=1.3.10

plugins.sbt (under "project" folder)

addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.10")
Spekular
@Spekular
I'm using sbt version 1.3.10, and the Scala version on my desktop is 2.12.7.400, but unless I'm mistaken sbt should grab a version that matches it's own?
Laptop has no standalone Scala install and is on sbt version 1.2.8
However, since the project is synced between the two sbt.version=1.3.10 should apply there as well.
Spekular
@Spekular
Fixed, there were some remnants of Java 1.8 that I had to delete to get it to use 1.12 (deleted the entire C:\Program Files (x86)\Common Data\Oracle\Java folder)
DavidGoodenough
@DavidGoodenough
Is there a way with fx-9+ to build all three os versions with sbt in one run, and name the results to include the os name?