11package com .xwintop .xJavaFxTool .controller .javaFxTools ;
22
3+ import cn .hutool .core .thread .ThreadUtil ;
34import com .xwintop .xJavaFxTool .services .javaFxTools .ShowSystemInfoService ;
45import com .xwintop .xJavaFxTool .view .javaFxTools .ShowSystemInfoView ;
5-
6- import java .net .URL ;
7- import java .util .ResourceBundle ;
8-
96import javafx .beans .value .ChangeListener ;
107import javafx .beans .value .ObservableValue ;
118import javafx .event .Event ;
1411import lombok .Setter ;
1512import lombok .extern .log4j .Log4j ;
1613
17- /**
14+ import java .net .URL ;
15+ import java .util .ResourceBundle ;
16+
17+ /**
1818 * @ClassName: ShowSystemInfoController
1919 * @Description: 显示系统信息
2020 * @author: xufeng
21- * @date: 2017/11/28 22:16
21+ * @date: 2017/11/28 22:16
2222 */
2323@ Getter
2424@ Setter
@@ -39,16 +39,21 @@ private void initView() {
3939 showSystemInfoService .showOverviewCpuLineChart ();
4040 showSystemInfoService .showOverviewMemoryLineChart ();
4141 showSystemInfoService .showOverviewDiskLineChart ();
42- showSystemInfoService .showOverviewNetLineChart ();
42+ // showSystemInfoService.showOverviewNetLineChart();
4343// showSystemInfoService.showDiskInfo();
44- showSystemInfoService .showVmInfo ();
44+ ThreadUtil .execute (() -> {
45+ showSystemInfoService .showSystemInfo ();
46+ });
47+ ThreadUtil .execute (() -> {
48+ showSystemInfoService .showVmInfo ();
49+ });
4550 }
4651
4752 private void initEvent () {
4853 mainTabPane .getSelectionModel ().selectedItemProperty ().addListener (new ChangeListener <Tab >() {
4954 @ Override
5055 public void changed (ObservableValue <? extends Tab > observable , Tab oldValue , Tab newValue ) {
51- if (newValue == diskTab ){
56+ if (newValue == diskTab ) {
5257 System .out .println (newValue .getText ());
5358 showSystemInfoService .showDiskInfo ();
5459 }
@@ -59,10 +64,10 @@ public void changed(ObservableValue<? extends Tab> observable, Tab oldValue, Tab
5964 private void initService () {
6065 }
6166
62- /**
67+ /**
6368 * 父控件被移除前调用
6469 */
65- public void onCloseRequest (Event event ){
70+ public void onCloseRequest (Event event ) {
6671 System .out .println ("移除所以线程" );
6772 showSystemInfoService .stopTimerList ();
6873 }
0 commit comments