Ejemplo n.º 1
0
 public E3Min() {
   numForm = NumberFormat.getNumberInstance(Locale.US);
   numForm.setMaximumFractionDigits(12);
   numForm.setMinimumFractionDigits(12);
   String s =
       "Example demonstrating the use of class MinAsy by fitting a Gaussian to small sample"
           + " and determining the asymmetric errors of parameters by MinAsy";
   df = new DatanFrame(getClass().getName(), s);
   AuxJInputGroup ig = new AuxJInputGroup("Enter number N of events (>= 2, <= 10000)", "");
   JLabel errorLabel = new JLabel();
   ni[0] = new AuxJNumberInput("N", "number of events", errorLabel);
   ig.add(ni[0]);
   ni[0].setProperties("N", true);
   ni[0].setMinimum(2);
   ni[0].setMaximum(10000);
   ni[0].setNumberInTextField(10);
   df.add(ig);
   df.add(errorLabel);
   JButton goButton = new JButton("Go");
   GoButtonListener gl = new GoButtonListener();
   goButton.addActionListener(gl);
   df.add(goButton);
   df.repaint();
 }
 private static Object formatBigDecimal(Object number, Locale locale) {
   NumberFormat nf = NumberFormat.getNumberInstance(locale);
   nf.setMinimumFractionDigits(2);
   return nf.format(number);
 }