package mythread; public class CountOperate extends Thread{ public CountOperate(){ System.out.println("CountOperate---begin"); System.out.println("Thread.currentThread().getName()=" + Thread.currentThread().getName());//获取线程名 System.…
swing awt跑javafx报了这问题 Not on FX application thread; currentThread = AWT-EventQueue-0 解决方法 Platform.runLater(new Runnable() { @Override public void run() { //javaFX operations should go here } });…
前言:在阅读<Java多线程编程核心技术>过程中,对书中程序代码Thread.currentThread()与this的区别有点混淆,这里记录下来,加深印象与理解. 具体代码如下: public class MyThread09 extends Thread { public MyThread09() { System.out.println("MyThread09 Constructor begin"); System.out.println("Thread.c…