Skip to content

Commit 1da6544

Browse files
committed
修改系统信息工具排版。
1 parent e0eaa91 commit 1da6544

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/main/java/com/xwintop/xJavaFxTool/services/javaFxTools/ShowSystemInfoService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ private static String printCpu(CentralProcessor processor) {
394394
long steal = ticks[TickType.STEAL.getIndex()] - prevTicks[TickType.STEAL.getIndex()];
395395
long totalCpu = user + nice + sys + idle + iowait + irq + softirq + steal;
396396

397-
stringBuffer.append(String.format("User: %.1f%% Nice: %.1f%% System: %.1f%% Idle: %.1f%% IOwait: %.1f%% IRQ: %.1f%% SoftIRQ: %.1f%% Steal: %.1f%%%n",
397+
stringBuffer.append(String.format("\nUser: %.1f%% Nice: %.1f%% System: %.1f%% Idle: %.1f%% IOwait: %.1f%% IRQ: %.1f%% SoftIRQ: %.1f%% Steal: %.1f%%%n",
398398
100d * user / totalCpu, 100d * nice / totalCpu, 100d * sys / totalCpu, 100d * idle / totalCpu,
399399
100d * iowait / totalCpu, 100d * irq / totalCpu, 100d * softirq / totalCpu, 100d * steal / totalCpu));
400400
stringBuffer.append(String.format("CPU load: %.1f%% (counting ticks)%n", processor.getSystemCpuLoadBetweenTicks() * 100));
@@ -433,9 +433,9 @@ private static String printProcesses(OperatingSystem os, GlobalMemory memory) {
433433
private static String printSensors(Sensors sensors) {
434434
StringBuffer stringBuffer = new StringBuffer();
435435
stringBuffer.append("\nSensors:");
436-
stringBuffer.append(String.format(" CPU Temperature: %.1f°C%n", sensors.getCpuTemperature()));
436+
stringBuffer.append(String.format("\n CPU Temperature: %.1f°C%n", sensors.getCpuTemperature()));
437437
// stringBuffer.append("\n Fan Speeds: " + Arrays.toString(sensors.getFanSpeeds()));
438-
stringBuffer.append(String.format(" CPU Voltage: %.1fV%n", sensors.getCpuVoltage()));
438+
stringBuffer.append(String.format("\n CPU Voltage: %.1fV%n", sensors.getCpuVoltage()));
439439
return stringBuffer.toString();
440440
}
441441

0 commit comments

Comments
 (0)