0
                System.out.print(toLn+toFn+toStr+toC+toSt+toZ+fromLn+fromFn+fromStr+fromC+fromSt+fromZ+beforeN+d+ship+bsize+msg+"\n");
                //add info to addOrder
                double test = manager.addOrder(toLn, toFn, toStr, toC, toSt, toZ, fromLn, fromFn, fromStr, fromC, fromSt, fromZ, beforeN, d, ship, bsize, msg);

                beforeN = false;


                totalField.setText(Double.toString(test));
            }
        }
    }

我遇到的问题是 totalfield.setText(Double.toString(test)); 带来的值 是一个值,比如说 52.0。它显示 52.0 但我想要它做的是在 TextField 中显示 $ 52.0。关于如何做的任何快速建议?}

4

1 回答 1

0

totalField.setText("$" + Double.toString(test));

于 2012-12-13T00:42:23.480 回答