gpt4 book ai didi

java - 我正在尝试在java中格式化字符串

转载 作者:行者123 更新时间:2023-12-01 16:25:20 26 4
gpt4 key购买 nike

iam 试图在 java 中形成像这样的字符串

        String ss = String.format("%-20s %s", "itime1", " IQD\n");
String bb = String.format("%-20s %s", "itw", " IQD\n");

String NN = ss + bb;

System.out.println(NN);

JOptionPane.showMessageDialog(rootPane, NN);

日志中的输出是:-

itime1                IQD
itw IQD

但是在 JOptionPane 中是:-

itime1           IQD
itw IQD

我需要输出相同!

有什么帮助吗?

最佳答案

修复了阿拉伯语字体。 .setFont(new Font("简体阿拉伯语固定", Font.PLAIN, 15));

关于java - 我正在尝试在java中格式化字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62160034/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com