cpu and memory form added

This commit is contained in:
RememBerBer 2021-11-17 13:53:37 +08:00
parent ec4afe8a57
commit 3a2f091e22
1 changed files with 7 additions and 3 deletions

View File

@ -60,13 +60,17 @@ public class MemoryForm {
memoryForm = getInstance(); memoryForm = getInstance();
initUi(); initUi();
initPhysicalMemoryInfo();
Timer timer = new Timer(UiConsts.REFRESH_FAST, e -> { Timer timer = new Timer(UiConsts.REFRESH_FAST, e -> {
initInfo(); initMemoryProgressInfo();
memoryForm.getPhysicalMemoryInfoTextPane().setText(updateMemoryText());
}); });
timer.start(); timer.start();
} }
private static void initPhysicalMemoryInfo() {
memoryForm.getPhysicalMemoryInfoTextPane().setText(updateMemoryText());
}
private static void initUi() { private static void initUi() {
MemoryForm memoryForm = getInstance(); MemoryForm memoryForm = getInstance();
JPanel mainPanel = memoryForm.getMainPanel(); JPanel mainPanel = memoryForm.getMainPanel();
@ -82,7 +86,7 @@ public class MemoryForm {
} }
private static void initInfo() { private static void initMemoryProgressInfo() {
GlobalMemory memory = App.si.getHardware().getMemory(); GlobalMemory memory = App.si.getHardware().getMemory();
// global memory // global memory