guiformat.java

来自「《A first book of java》by Gary J.Bronson 」· Java 代码 · 共 16 行

JAVA
16
字号
import java.text.*;
import javax.swing.*;
public class GuiFormat
{
  public static void main(String[] args)
  {
    DecimalFormat num = new DecimalFormat("$,###.00");
    
    JOptionPane.showMessageDialog(null,
      "The result is " + num.format(25625.648),
      "Output Display",
      JOptionPane.INFORMATION_MESSAGE);
    System.exit(0);
  }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?