且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将控制台输出重定向到 GUI

更新时间:2023-12-05 12:50:52

您需要在新线程中调用 startMeUp,因为您的控制台程序正在阻塞事件调度线程.像这样:

You need to invoke startMeUp in a new thread, because your console program is blocking the event dispatch thread. Like this:

new Thread () {
  @Override public void run () {
    GreenhouseControls.startMeUp();
  }
}.start();

而不仅仅是

GreenhouseControls.startMeUp();