Weekly Question Series - JavaFX interface is not responding, Maven compilation automatically ignores rt packages

My blog post URL: https://www.peretang.com/weekly-problem-session-week-31/


foreword

Open a new series to record weekly problems

 

JavaFX interface not responding

When you bind an event in JavaFX that takes a while to run, the JavaFX interface is unresponsive while the event is running.

After consulting Oracle's official documentation, we learned that JavaFX is a single-threaded program, and its approximate process is "interface-user operation-stored in the queue according to the order-get events from the queue-execute specific event operations-modify the interface".

Oracle also gave a solution. JavaFX has prepared the javafx.concurrent package for us to provide concurrency support. Using the Task class in javafx.concurrent, we can run the logic in the background and bind it with the interface controls. Live Update.

refer to

JavaFX Concurrency

 

Maven compilation automatically ignores the rt package

In this week's work, a class in the rt package that comes with JDK is used in a method. After testing with Junit, there is no problem. I plan to package and publish it with maven, but it prompts that the class does not exist. After consulting the information

--"Packages like sun are not included in the Java platform's standard"

Solution:

Add in configuration in maven-compiler-plugin plugin in Maven

<fork>true</fork>
<compilerArgument>-XDignore.symbol.file</compilerArgument>

So that the javac compiler allows to compile some special classes in rt

refer to

Maven can't compile class which depends on rt.jar

 

Keep outstanding.

Pere Tang. 2pm on Aug 8, 2017

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327038814&siteId=291194637