Sum in Acrobat doubles

At work I use Adobe Acrobat Professional 7.0 and I've created a form with several fields that I have used Calculate Sum.  It works fine except that the totals consistantly double.  I've used this in other fillable PDF's in the past with success and I don't know what I'm doing wrong.  Nothing else is adding in from other fields and it looks like a straight sum to me.  Any ideas?

If you have named your fields in a hierarchal manner, text.1, text.2, etc., then you either have to select the top level field name or the individual field names but not both.

Similar Messages

  • Having issue with a Sum/Average program

    The issue I get when I run the command is, let's say I enter 4 numbers, 5, 7, 9, 16 then enter a 0 to end the count, the avg it gives me is 8.0 instead of the 9.25 it should be. Any insight would be greatly appreciated.
    import java.util.Scanner;
    public class StephenVanoverSumAverage
        public static void main(String[] args)
              Scanner keyboard = new Scanner(System.in);
            double count = 0.0;      
            double sum = 0.0;   
              double num;
            System.out.println("Enter a number (Type 0 to quit): ");
              num = keyboard.nextInt();
            while ( num !=0 )
                   System.out.println("Enter a number (Type 0 to quit): ");
                   num = keyboard.nextInt();
                sum += num;
                count++;
            double average = sum / count;
            System.out.printf("Average is " + average);
    }

    Not quite, since the first number is discarded. The zero is included in the sum, but the first number entered is not. The count is incremented for the zero, true, but I think that is not the problem.
    Still, the code could be cleaner with respect to both when the count is incremented, and what numbers are included in the sum.
    {?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Acrobat X intermittently won't launch, multiple Acrobat.exe processes hanging in task manager

    Apologies if this is in the wrong community area - I was unsure where it belongs.
    This is an intermittent issue, but does happen several times a day.
    Regardless of what method is used to launch Acrobat (double-clicking a PDF, clicking the shortcut in the taskbar, selecting Acrobat from the start menu), often the application won't launch. Upon investigation, task manager shows multiple instances of Acrobat.exe, although the application is not running (see the image below). Ending all Acrobat.exe processes does allow Acrobat to launch.
    Any thoughts as to what might be causing this, as well as a more permanent fix? The workaround of constantly ending multiple processes is becoming cumbersome.
    We are running Acrobat X Pro in Windows 7. I also have several CC 2014 apps installed (as well as a couple of earlier versions required for plugin functionality).

    This happens all the time in my company with several installs of Acrobat.
    The only way to fix this for us is to end each process in Task Manager as you have pointed out.
    It is very time consuming in our workflow as we each operator deals with hundreds of PDFs daily, and has to do this End Process procedure several times a day.
    We have done several tests and nothing seems to stop this from happening.

  • Need help returning (not printing) avg GPA from array??

    Here's what I have so far. After returning the value then I gotta print the avg in a separate method. I also need to check the names of the first and last student using an "equals" method. Please someone help with whatever you can. Here's what I got:
    import java.util.Scanner;
    public class StudentLists {
    //Main method. Prompts user for the number of students.
       public static void main(String[] args) {
       Scanner in = new Scanner(System.in);
       System.out.print("Please enter the number of students in this class: ");
       int s = in.nextInt();
       Student[] students=new Student[s];
       FillStudents(s,students);
       printAll(students);
       public static void FillStudents(int s, Student[] students){
       for (int i=0; i<s; i++)
            Scanner inf = new Scanner(System.in);
            System.out.println("Please enter student's first name: ");
        String first = inf.nextLine();
        System.out.println("Please enter student's last name: ");
            String last=inf.nextLine();
            System.out.println("Please enter the number of credits completed: ");
            int c=inf.nextInt();
            System.out.println("Please enter student's GPA: ");
            Double g=inf.nextDouble();
            students[i] = new Student(first, last, c, g);
        public static void printAll(Student[] students) {
        System.out.println("Names      Credits  GPA");
           for(int i = 0; i < students.length; i++)
        System.out.println(students);
    public static Double getAvg(Student[] students, Double g){
    double sum=0.0;
    double avg=0.0;
    for(int i=0; i<students.length; i++){
    sum+=g;
    avg=sum/students.length;
    return avg;

    Oh no I wasn't giving any orders. I was saying I have been trying to edit what I have, but I can't figure out how to get the method right to do my average of the GPA from the loop. I don't know what to put in there. I was just asking if you would write it and then kind of explain what u did for me please.
    import java.util.Scanner;
    public class StudentLists {
    //Main method. Prompts user for the number of students.
       public static void main(String[] args) {
       Scanner in = new Scanner(System.in);
       System.out.print("Please enter the number of students in this class: ");
       int s = in.nextInt();
       Student[] students=new Student[s];
       FillStudents(s,students);
       printAll(students);
       public static void FillStudents(int s, Student[] students){
       for (int i=0; i<s; i++)
            Scanner inf = new Scanner(System.in);
            System.out.println("Please enter student's first name: ");
        String first = inf.nextLine();
        System.out.println("Please enter student's last name: ");
            String last=inf.nextLine();
            System.out.println("Please enter the number of credits completed: ");
            int c=inf.nextInt();
            System.out.println("Please enter student's GPA: ");
            Double g=inf.nextDouble();
            students[i] = new Student(first, last, c, g);
        public static void printAll(Student[] students) {
        System.out.println("Names      Credits  GPA");
           for(int i = 0; i < students.length; i++)
        System.out.println(students);
    public static Double getAvg(Student[] students){
    double sum=0.0;
    double avg=0.0;
    for(int i=0; i<students.length; i++){
    avg=sum/students.length;
    System.out.println(avg);
    return avg;

  • Date format of footer in pdf

    How to change the date format of footer from dd/mm/yyyy to Monday 09 August 2010 when we down load the report in pdf file

    Hi,
    Revenue is a sample column. You can pull any measure column used in the report.
    And put this formula in a separate new column. And in the narrative view use this column number.For Ex- if the number of the column in the criteria is 15, then mention @15 in the narrative view.
    NOTE-Rows to display in narrative view should be set to 1.
    And in the formula-CEILING(CAST(COUNT("F1 Revenue"."1-01 Revenue (Sum All)") as DOUBLE)/ 25)
    25 refers to the number of row count to display. You can define the number according to your requirement.
    Regards,
    MuRam

  • Read multiple files and save all into one output file(AGAIN)

    Hi, guys
    I need your help for reading data from multiple files and save the results into one output file. When files are selected from file chooser, my program read the data line by line , do some calculations and save the result into the output. I made an array to store input files and it seems to be working fine, but when it comes to SaveFile() function, issues NullPointException message.
    public class FileReduction1 extends JFrame implements ActionListener
       // GUI definition and layout
        /* ACTION PERFORMED */
        public void actionPerformed(ActionEvent event) {
            if (event.getActionCommand().equals("Open File")) getFileName();
        /* OPEN THE FILE */
        private void getFileName() {
            // Display file dialog so user can select file to open
         JFileChooser fileChooser = new JFileChooser();
         fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
            fileChooser.setMultiSelectionEnabled(true);
         int result = fileChooser.showOpenDialog(this);
         // If cancel button selected return
         if (result == JFileChooser.CANCEL_OPTION) return;
            if (result == JFileChooser.APPROVE_OPTION)
             files = fileChooser.getSelectedFiles();
                textArea.setText("");
                if(files.length>0)
                    filelist="";
                    System.out.println("files length"+files.length);
                    for(int i=0;i<files.length;i++)
                         System.out.println(files.getName());
    filelist+=files[i].getName()+" ,";
    if (checkFileName(files[i]) )
    openButton.setEnabled(true);
    readButton.setEnabled(true);
    textArea.append("file "+files[i].getName()+"is a proper file"+"\n");
    readFile(files[i]);
    textfield.setText(filelist);
    else{JOptionPane.showMessageDialog(this,"Please select file(s)",
                    "Error 5: ",JOptionPane.ERROR_MESSAGE); }
         // Obtain selected file
    /* READ FILE */
    private void readFile(File fileName_in) {
    // Disable read button
    readButton.setEnabled(false);
    // Dimension data structure
         getNumberOfLines(fileName_in);
         data = new String[numLines][4];
         // Read file
         readTheFile(fileName_in);
         // Rnable open button
         openButton.setEnabled(true);
    /* GET NUMBER OF LINES */
    /* Get number of lines in file and prepare data structure. */
    private void getNumberOfLines(File fileName_in) {
    int counter = 0;
         // Open the file
         openFile(fileName_in);
         // Loop through file incrementing counter
         try {
         String line = fileInput.readLine();
         while (line != null) {
         counter++;
              System.out.println("(" + counter + ") " + line);
    line = fileInput.readLine();
         numLines = counter;
    closeFile(fileName_in);
         catch(IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error reading File",
                   "Error 5: ",JOptionPane.ERROR_MESSAGE);
         closeFile(fileName_in);
         System.exit(1);
    /* READ FILE */
    private void readTheFile(File fileName_in)
    // Open the file
    //int row=0;
    int col=0;
    openFile(fileName_in);
    System.out.println("Read the file");
    // Loop through file incrementing counter
    try
    String line = fileInput.readLine();
    while (line != null)
    boolean containsDoubles = false;
    double temp;
    String[] lineParts = line.split("\t");
    try
    for (col=0;col<lineParts.length;col++)
    temp=Double.parseDouble(lineParts[col]);
    data[row][col] = lineParts[col];
    containsDoubles = true;
    System.out.print("data["+row+"]["+col+"]="+lineParts[col]+" ");
    } catch (Exception e) {row=0; col=0; temp=0.0;}
    if (containsDoubles){ row++;}
    System.out.println();
    line = fileInput.readLine();
    catch(IOException ioException)
    JOptionPane.showMessageDialog(this,"Error reading File", "Error 5: ",JOptionPane.ERROR_MESSAGE);
    closeFile(fileName_in);
    System.exit(1);
    //System.out.println("length"+data.length);
    closeFile(fileName_in);
    process(fileName_in);
    /* CHECK FILE NAME */
    /* Return flase if selected file is a directory, access is denied or is
    not a file name. */
    private boolean checkFileName(File fileName_in) {
         if (fileName_in.exists()) {
         if (fileName_in.canRead()) {
              if (fileName_in.isFile()) return(true);
              else JOptionPane.showMessageDialog(null,
                        "ERROR 3: File is a directory");
         else JOptionPane.showMessageDialog(null,
                        "ERROR 2: Access denied");
         else JOptionPane.showMessageDialog(null,
                        "ERROR 1: No such file!");
         // Return
         return(false);
    /* OPEN FILE */
    private void openFile(File fileName_in) {
         try {
         // Open file
         FileReader file = new FileReader(fileName_in);
         fileInput = new BufferedReader(file);
         catch(IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error Opening File",
                   "Error 4: ",JOptionPane.ERROR_MESSAGE);
         textArea.append("OPEN FILE\n---------\n");
         textArea.append(fileName_in.getPath());
         textArea.append("\n");
         //System.out.println("File opened successfully");
    /* CLOSE FILE */
    private void closeFile(File fileName_in) {
    if (fileInput != null) {
         try {
              fileInput.close();
         catch (IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error Opening File",
                   "Error 4: ",JOptionPane.ERROR_MESSAGE);
    System.out.println("File closed");
    private void process(File fileName_in) {
    //getNumberOfLines();
         //data = new String[numLines][3];
         // Read file
    double temp,temp1;
         //readTheFile();
    //System.out.println("row:"+row);
    //int number=data.length;
    //System.out.println(number);
    for (int i=0; i<row; i++)
    temp=Double.parseDouble(data[i][1]);
    sumx+=temp;
    temp1=Double.parseDouble(data[i][3]);
    sumy+=temp1;
    multixy+=(temp*temp1);
    square_x_sum+=(temp*temp);
    square_y_sum+=(temp1*temp1);
    //System.out.println("Sum(x)="+sumx);
    double tempup=(row*multixy)-(sumx*sumy);
    double tempdown=(row*square_x_sum)-(sumx*sumx);
    slope=tempup/tempdown;
    double tempbup=sumy-(slope*sumx);
    intb=tempbup/row;
    double tempside=(row*square_y_sum)-(sumy*sumy);
    double cordown=Math.sqrt(tempdown*tempside);
    corr=tempup/cordown;
    r_sqrt=corr*corr;
         textArea.append("Data for file"+ fileName_in.getName()+" have been processed successfully.");
         textArea.append("\n");
         textArea.append("Please enter output file name including extension.");
    System.out.println("number"+row);
    System.out.println("slope(m)="+slope);
    System.out.println("intecept b="+intb);
    System.out.println("correlation="+corr);
    System.out.println("correlation="+r_sqrt);
    saveFile();
    private void saveFile()
    textArea.append("SAVE FILE\n---------\n");
    if (openFile1())
         try {
              outputToFile();
    catch (IOException ioException) {
              JOptionPane.showMessageDialog(this,"Error Writing to File",
                   "Error",JOptionPane.ERROR_MESSAGE);
    private boolean openFile1 ()
         // search for the file path
    StringBuffer stringpath;
    title=textfield1.getText().trim();
    int temp=fileName_in.getName().length();
    int temp_path=fileName_in.getPath().length();
    int startd=(temp_path-temp);
    stringpath=new StringBuffer(fileName_in.getPath());
    stringpath.delete(startd, temp_path+1);
    //System.out.println("file-path="+temp_path);
    //System.out.println("length-file="+temp);
    path=stringpath.toString();
    fileName_out = new File(path, title);
    //System.out.println(file_out.getName());
    if (fileName_out==null || fileName_out.getName().equals(""))
         JOptionPane.showMessageDialog(this,"Invalid File name",
                   "Invalid File name",JOptionPane.ERROR_MESSAGE);
         return(false);
         else
    try
    boolean created = fileName_out.createNewFile();
    if(created)
    fileOutput = new PrintWriter(new FileWriter(fileName_out));
    fileOutput.println("File Name"+"\t"+"Slope(m)"+"\t"+"y-intercept(b)"+"\t"+"Coefficient(r)"+"\t"+"Correlation(R-Squared)");
    return(true);
    else
    fileOutput = new PrintWriter(new FileWriter(fileName_out,true));
    return(true);
    catch (IOException exc)
    JOptionPane.showMessageDialog(this,"Please enter the file name","Error",JOptionPane.ERROR_MESSAGE);
    return(false);
    private void outputToFile() throws IOException
    // Initial output
         textArea.append("File name = " + fileName_out + "\n");
         // Test if data exists
         if (data != null)
         fileOutput.println(fileName_in.getName() +"\t"+ slope+"\t"+intb+"\t"+corr+"\t"+r_sqrt);
    textArea.append("File output complete\n\n");
         else
    textArea.append("No data\n\n");
         // End by closing file
    initialcomp();
         fileOutput.close();
    private void initialcomp()
    slope=0.0;
    intb=0.0;
    corr=0.0;
    r_sqrt=0.0;
    sumx=0.0; sumy=0.0; multixy=0.0; square_x_sum=0.0; square_y_sum=0.0;
    for(int i=0;i<data.length;i++)
    for(int j=0;j<data[i].length;j++)
    data[i][j]=null;
    /* MAIN METHOD */
    public static void main(String[] args) throws IOException
         // Create instance of class FileChooser
         FileReduction1 newFile = new FileReduction1("File Reduction Program");
         // Make window vissible
         newFile.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         newFile.setSize(500,400);
    newFile.setVisible(true);
    Sorry about the long lines.
    As you can see, all input files saved in array called files, however when OpenFile1() function is called, it take input (fileName_in) as a single file not an array. I'm assuming this causes the exception.
    When there's muptiple inputs, program should take each file from getFileName() to outputToFile() sequentially.
    Does anybody have an idea to solve this?
    Thanks a lot!!

    you naming convention is confussing. you should follows Java naming convention..you have a getXXX but decalred the return type as "void"...get usully means to return something...
    your code is doing too much..and hard to follows..
    1. get the selected files
    for each selected file
    process the file and return the result
    write out the result.
    /** close the precious resource */
    public void closeResource(Reader in){
        if (in != null){
            try{ in.close(); }
            catch (Exception e){}
    /** get the total number of line in a file */
    public int getLineCount(File file) throws IOException{
        BufferedReader in = null;
        int lineCount = 0;
        try{
            in = new BufferedReader(new FileReader(file));
            while ((in.readLine() != null)
                lineCount++;
            return lineCount;
        finally{ closeResource (in);  }
    /** read the file */
    public void processFile(File inFile, File outFile) throws IOException{
        BufferedReader in = null;
        StringBuffer result = new StringBuffer();
        try{
            in = new BufferedReader(new FileReader(inFile));
            String line = null;
            while ((in.readLine() != null){
                .. do something with the line
                result.append(....);
            writeToFile(outFile, result.toString());
        finally{ closeResource (in);  }
    public void writeToFile(File outFile, String result) throws IOException{
        PrintWriter out = null;
        try{
            out = new PrintWriter(new FileWriter(outFile, true));  // true for appending to the end of the file
            out.println(result);
        finally{  if (out != null){ try{ out.close(); } catch (Exception e){} }  }
    }

  • Creating a PDF from a database

    Hi all I hope somebody could help here as I have been around
    and around trying to work this out
    Problem: PDF creation from a database
    I have a database which has all the text information to
    create a PDF.
    All images are from the web and are not stored locally web
    serve on a server
    Goal:
    To create a viewable PDF on the fly from the database when a
    user clicks on a link.
    bring in the picture and relevant information then insert a
    header and footer
    Dose anybody have any php scripts that could achieve the
    final result effort less
    when writing this it just popped into my head , could I call
    a web page into the PDF
    if so how

    No that won`t work. AlivePDF uses its own method of embedding fonts (if I remmeber correct you can only use ttf not otf font formats). AlivePDF is not exactly well documented or much used. Its technics are a little "arcane". It was created by the same Guy whose brainchild was Stage3D so you can imagine how complex it is for us mere mortals. A good start is this little blog .
    I also can see why Adobe (who is his boss) isn`t exactly highly motivated to make AlivePDF too much of a Acrobat Double ;-)

  • I am getting this error when I am trying to execute cal program compile error expected function or variable

    Option Explicit
    Dim Oper1 As Double, Oper2 As Double, Result As Double
    Dim operator As String
    Dim Cleardisp As Boolean
    Private Sub clearBttn_Click()
    Text1.Text = ""
    End Sub
    Private Sub digits_Click(Index As Integer)
    Text1.Text = Text1.Text & Index
    End Sub
    Private Sub Division_Click()
    Oper1 = Val(Text1.Text)
    operator = "/"
    Text1.Text = ""
    Equals.Enabled = True
    End Sub
    Private Sub dotBttn_Click()
    If Cleardisp = True Then
    Text1.Text = ""
    Cleardisp = False
    End If
    If InStr(Text1.Text, ".") Then
    Exit Sub
    Else
    Text1.Text = Text1.Text + "."
    End If
    End Sub
    Private Sub Equals_Click()
    On Error GoTo Errormsg
    Oper2 = Val(Text1.Text)
    If operator = "+" Then Result = Sum(Oper1, Oper2)
    If operator = "-" Then Result = Diff(Oper1, Oper2)
    If operator = "*" Then Result = Product(Oper1, Oper2)
    If operator = "/" Then Result = Div(Oper1, Oper2)
    Text1.Text = Result
    Cleardisp = True
    Equals.Enabled = False
    Exit Sub
    Errormsg:
    MsgBox "The Operation Result In The Error:" & Err.Description
    Text1.Text = "ERROR"
    Cleardisp = True
    End Sub
    Private Sub Form_Load()
    Equals.Enabled = False
    End Sub
    Private Sub Minus_Click()
    Oper1 = Val(Text1.Text)
    operator = "-"
    Text1.Text = ""
    Equals.Enabled = True
    End Sub
    Private Sub Multiply_Click()
    Oper1 = Val(Text1.Text)
    operator = "*"
    Text1.Text = ""
    Equals.Enabled = True
    End Sub
    Private Sub Plus_Click()
    Oper1 = Val(Text1.Text)
    operator = "+"
    Text1.Text = ""
    Equals.Enabled = True
    End Sub
    Private Sub Sum(x As Double, y As Double)
    Sum = x + y
    End Sub
    Private Sub Product(x As Double, y As Double)
    Product = x * y
    End Sub
    Private Sub Diff(x As Double, y As Double)
    Diff = x - y
    End Sub
    Private Sub Div(x As Double, y As Double)
    Div = x / y
    End Sub

    hi
    you havnt assign event handler for button e.g.
    Private Sub Plus_Click() handles Plus.Click
    Oper1 = Val(Text1.Text)
    operator = "+"
    Text1.Text = ""
    Equals.Enabled = True
    End Sub
    Private Sub Minus_Click() handles Minus.Click
    Oper1 = Val(Text1.Text)
    operator = "-"
    Text1.Text = ""
    Equals.Enabled = True
    End Sub
    Private Sub Multiply_Click() handles Multiply.Click
    Oper1 = Val(Text1.Text)
    operator = "*"
    Text1.Text = ""
    Equals.Enabled = True
    End Sub
    Shridhar J Joshi Thanks a lot

  • Missing method body or declare abstract...

    Hi There,
    Im working on an assignment that works with the math class and performs a bunch of mathematical functions. Im trying to declare the different fields in the math class and I keep getting error messages!!
    This is what I have right now
    public class Math
        // Returns the absolute value of a double value.
        double abs(double a);
        // Returns the absolute value of a int value.
        int abs(int a);
        //Returns the greater of two double values.
        double max(double a, double b);
        //Returns the greater of two int values.
        int max(int a, int b);
        // Returns the lesser of two double values.
        double min(double a, double b);
        // Returns the lesser of two double values.
        int min( int a, int b);
        // Returns the value of the first argument raised to the power of
        // the second argument.
        double pow(double a, double b);
        // Returns the remainder of division of two integers.
        int remainder(int a, int b);
        // Returns the closest long to the argument.
        long round(double a);
        // Returns the sum of all the elements in an array of doubles.
        double sum(double [] doubleArr);
        // Returns the sum of all the elements in an array of ints.
        int sum(int [] intArr);
        // Storage for the list of integers used for the int sum method.
        private int [] intArray = {5, 10, 15, 20};
        // Storage for the list of doubles to be used double sum method.
        private double [] doubleArray = {5.25, 10.00, 14.50, 21.90};
        }When I try and compile it tells me that Im missing method body or declare abstract.
    I originally had this
       // Returns the absolute value of a double value.
        double abs;
        // Returns the absolute value of a int value.
        int abs;
        //Returns the greater of two double values.
        double max;
        //Returns the greater of two int values.
        int max;
        // Returns the lesser of two double values.
        double min;
        // Returns the lesser of two double values.
        int min;
        // Returns the value of the first argument raised to the power of
        // the second argument.
        double pow;
        // Returns the remainder of division of two integers.
        int remainder;
        // Returns the closest long to the argument.
        long round;
        // Returns the sum of all the elements in an array of doubles.
        double sum(double [] doubleArr);
        // Returns the sum of all the elements in an array of ints.
        int sum(int [] intArr);
        // Storage for the list of integers used for the int sum method.
        private int [] intArray = {5, 10, 15, 20};
        // Storage for the list of doubles to be used double sum method.
        private double [] doubleArray = {5.25, 10.00, 14.50, 21.90};When i tried doing this it told me that I had already declared the field previously when it got the the field with the same name and thats why I added the bit in brackets.....
    Im so lost... can anybody hep????

    hi,
    here is your code...
    modified by correcting my bad habit...
    he..he...
    public class Math
        // Returns the absolute value of a double value.
        double abs(double a){return 0.0;}
        // Returns the absolute value of a int value.
        int abs(int a){return 0;}
        //Returns the greater of two double values.
        double max(double a, double b){return 0.0;}
        //Returns the greater of two int values.
        int max(int a, int b){return 0;}
        // Returns the lesser of two double values.
        double min(double a, double b){return 0.0;}
        // Returns the lesser of two double values.
        int min( int a, int b){return 0;}
        // Returns the value of the first argument raised to the power of
        // the second argument.
        double pow(double a, double b){return 0.0;}
        // Returns the remainder of division of two integers.
        int remainder(int a, int b){return 0;}
        // Returns the closest long to the argument.
        long round(double a){return 0.0;}
        // Returns the sum of all the elements in an array of doubles.
        double sum(double [] doubleArr){return 0.0;}
        // Returns the sum of all the elements in an array of ints.
        int sum(int [] intArr){return 0;}
        // Storage for the list of integers used for the int sum method.
        private int [] intArray = {5, 10, 15, 20};
        // Storage for the list of doubles to be used double sum method.
        private double [] doubleArray = {5.25, 10.00, 14.50, 21.90};
        }if you want to extend Math class to any other class.. then make all the methods abstract
    dhaval.
    Edited by: Dhaval.Yoganandi on 1 Mar, 2008 3:48 PM

  • Trouble filling out a form?

    I've been trying to fill out forms for school on adobe reader x.
    The form has last name then first name, etc.
    Well, when I type my last name into the box, it also puts it into the first name box.
    And when I erase my last name from the first name box, it also erases it from the last name box.
    I've tried everything I can think of and it's really beginning to get aggravating.

    Assuming the document doesn't have security restrictions that would prevent it, you can use the Select Object tool (left-pointing black arrow) in Acrobat, double-click either of the fields, and rename it so it is unique in the form.

  • Why won't my number enter in the other box

    I am writing a program for class. I have to be able to input a number in a box and then have it display in the box next to it. It also has to add the numbers everytime I put a number in the first box. I am able to get the enter button to change colors. Not sure how to get it to add and display the numbers. Also the first box has to default back to 00.0 when I click enter. Hope this is clear. Here is the code.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class FinalProject extends JFrame implements ActionListener
         public static final int WIDTH = 550;
         public static final int HEIGHT = 100;
         private JTextField myNumberOut1;
         private JTextField myNumberIn1;
         private double sum=0;
         public FinalProject()
              super("Eric Luce's Final Project");
              setSize(WIDTH, HEIGHT);
    /** Setting Labels 1-3 for Stations
              JLabel myLabel1 = new JLabel ("Station Austin:");
              JLabel myLabel2 = new JLabel ("Station Amherst:");
              JLabel myLabel3 = new JLabel ("Station LaCrosse:");
    /** Setting Buttons 1-3 for Adding NumberIn
              JButton myButton1 = new JButton ("Enter");
              myButton1.addActionListener(this);
              myButton1.setBackground(Color.RED);
              JButton myButton2 = new JButton ("Enter");
              myButton2.addActionListener(this);
              myButton2.setBackground(Color.WHITE);
              JButton myButton3 = new JButton ("Enter");
              myButton3.addActionListener(this);
              myButton3.setBackground(Color.BLUE);
    /** Setting Labels 4-6 for Rain Fall totals
              JLabel myLabel4 = new JLabel ("Total Rainfall:");
              JLabel myLabel5 = new JLabel ("Total Rainfall:");
              JLabel myLabel6 = new JLabel ("Total Rainfall:");
    /** Setting Text fields for NumberIn
              JTextField myNumberIn1 = new JTextField ("0.0", 10);
              JTextField myNumberIn2 = new JTextField ("0.0",10);
              JTextField myNumberIn3 = new JTextField ("0.0", 10);
    /** Setting Text fields for NumbersOut
              JTextField myNumberOut1 = new JTextField ();
              JTextField myNumberOut2 = new JTextField ();
              JTextField myNumberOut3 = new JTextField ();
    /**  Adding contents to frame line 1
              getContentPane().add(myLabel1);
              getContentPane().add(myNumberIn1);
              getContentPane().add(myButton1);
              getContentPane().add(myLabel4);
              getContentPane().add(myNumberOut1);
    /** Adding contents to frame line 2
              getContentPane().add(myLabel2);
              getContentPane().add(myNumberIn2);
              getContentPane().add(myButton2);
              getContentPane().add(myLabel5);
              getContentPane().add(myNumberOut2);
    /** Adding contents to frame line 3
              getContentPane().add(myLabel3);
              getContentPane().add(myNumberIn3);
              getContentPane().add(myButton3);
              getContentPane().add(myLabel6);
              getContentPane().add(myNumberOut3);
              Container contentPane = getContentPane();
              contentPane.setBackground(Color.LIGHT_GRAY);
              contentPane.setLayout(new GridLayout(3, 5));
              this.addWindowListener (new WindowAdapter()     {
                   public void windowClosing(WindowEvent e)     {
         public static void main (String[] args)     {
              FinalProject mainFrame = new FinalProject();
              mainFrame.setVisible(true);
               public void actionPerformed(ActionEvent e){
                   Container contentPane = getContentPane();
                   if (e.getActionCommand().equals ("ENTER"));
                   contentPane.setBackground(Color.RED);
    /**                    sum = sum + myNumberIn1();
                        myNumberIn1.setText(Double.toString(sum));
                  myNumberOut1.setText(Double.toString(sum));
                   private static double stringToDouble(String stringObject)
                   return Double.parseDouble(stringObject.trim());
    }

    I still cannot seem to get the boxes on the right to
    accept the numbers I am putting in on the left. What
    can I do to correct this? Please help. Thank you.You should put some code into your ActionListener to call setText on the boxes on the right. At present you don't have any, except something that is commented out.
    Here's a couple of other problems, too:if (e.getActionCommand().equals ("ENTER"));First of all, that if-condition will never be true because none of your buttons have "ENTER" as their text. Several of them have "Enter" but that isn't the same thing. Even if you got the case right, this would still be a problem because you wouldn't know which button had been pressed. And finally, even if the if-condition is true, nothing will happen because you have a semi-colon at the end of it, which says "do nothing".
    If you must have a single ActionListener for all those buttons, and it needs to distinguish which button was pressed, then code like this:if (e.getSource() == myButton2)will do that. However you would have to change your code to make myButton2 (etc.) instance variables of the class and not just local variables in the constructor, as they are now.

  • Help with GUI program

    Writing a program that uses menu options of ADD, SUBTRACT, MULTIPLY, and DIVIDE.
    The user enters a number in a field labeled "Number 1" then enters a number in a field labeled "Number 2". The final field is labeled "Result"
    Each of the menu options has an ActionEvent.
    I'm having trouble with how to get the fields for Number 1 and Number 2 to display in the Result field when the user selects one of the menu options.
    Here is the code with an ActionEvent started for "Add" but not finished since I neeed some advice from this point on....
    Please disregard the other menu options, at this point I am just working on the math portion...
    Cheers!
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Brown7 extends JFrame implements ActionListener
    public static final int WIDTH = 400;
    public static final int HEIGHT = 200;
    private JTextField inputField, inputsecondField, resultField;
    private double sum = 0;
    private double difference = 0;
    private double product = 0;
    private double quotient = 0;
    public Brown7()
    setSize (WIDTH, HEIGHT);
    addWindowListener(new WindowDestroyer());
    setTitle ("Menu Demo");
    Container contentPane = getContentPane();
    contentPane.setLayout(new BorderLayout());
    JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new FlowLayout());
    JButton sumbutton = new JButton("Add");
    sumbutton.addActionListener(this);
    buttonPanel.add(sumbutton);
    JButton subbutton = new JButton("Subtraction");
    subbutton.addActionListener(this);
    buttonPanel.add(subbutton);
    JButton multbutton = new JButton("Multiply");
    multbutton.addActionListener(this);
    buttonPanel.add(multbutton);
    JButton divbutton = new JButton("Divide");
    divbutton.addActionListener(this);
    buttonPanel.add(divbutton);
    contentPane.add(buttonPanel, BorderLayout.SOUTH);
    JPanel infoPanel = new JPanel();
    infoPanel.setLayout(new FlowLayout());
    JLabel nameLabel = new JLabel("Number 1");
    infoPanel.add(nameLabel);
    inputField = new JTextField("", 3);
    infoPanel.add(inputField);
    JLabel secondnameLabel = new JLabel("Number 2");
    infoPanel.add(secondnameLabel);
    inputsecondField = new JTextField("", 3);
    infoPanel.add(inputsecondField);
    JLabel resultLabel = new JLabel("Result");
    infoPanel.add(resultLabel);
    resultField = new JTextField("", 5);
    infoPanel.add(resultField);
    contentPane.add(infoPanel);
    JMenuBar mBar = new JMenuBar();
    setJMenuBar(mBar);
    JMenu operationsMenu = new JMenu("Operations");
    mBar.add(operationsMenu);
    JMenuItem o;
    o = new JMenuItem("Add");
    o.addActionListener(this);
    operationsMenu.add(o);
    o = new JMenuItem("Subtract");
    o.addActionListener(this);
    operationsMenu.add(o);
    o = new JMenuItem("Multiply");
    o.addActionListener(this);
    operationsMenu.add(o);
    o = new JMenuItem("Divide");
    o.addActionListener(this);
    operationsMenu.add(o);
    JMenu viewMenu = new JMenu("View");
    mBar.add(viewMenu);
    JMenuItem v;
    v = new JMenuItem("Metal");
    v.addActionListener(this);
    viewMenu.add(v);
    v = new JMenuItem("Motif");
    v.addActionListener(this);
    viewMenu.add(v);
    v = new JMenuItem("Windows");
    v.addActionListener(this);
    viewMenu.add(v);
    JMenu exitMenu = new JMenu("Exit");
    mBar.add(exitMenu);
    JMenuItem e;
    e = new JMenuItem("Close");
    e.addActionListener(this);
    exitMenu.add(e);
    public void actionPerformed(ActionEvent e)
    if (e.getActionCommand().equals("Close"))
    System.exit(0);
    else if (e.getActionCommand().equals("Add"))
    else
    System.out.println("Error in Brown7 interface.");
    public static void main(String[] args)
    Brown7 gui = new Brown7();
    gui.setVisible(true);

    You can use a JOptionPane for the textfield input. Here I used a DocumentFilter (new in JDK1.4). It allows only specified characters to be entered and beeps for illegal characters. If you still want a message dialog you can add it in the document filter class with (or in place of) the Toolkit..beep call.
    I also changed the variable result to a double and added a NumberFormat to allow formatting to only one decimal place for fractions (as a result of division) in resultField.
    I gave a choice of YES_NO vs. YES_NO_CANCEL options in the exit dialog.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.text.NumberFormat;    // new
    import javax.swing.text.*;        // new
    public class BrownTest extends JFrame implements ActionListener
        public static final int WIDTH = 400;
        public static final int HEIGHT = 200;
        private JTextField inputField, inputsecondField, resultField;
        private double sum = 0;
        private double difference = 0;
        private double product = 0;
        private double quotient = 0;
        NumberFormat nf;
        JFrame frame = this;
        public BrownTest()
            nf = NumberFormat.getInstance();
            nf.setMaximumFractionDigits(1);
            setSize (WIDTH, HEIGHT);
            setDefaultCloseOperation(EXIT_ON_CLOSE);
            setTitle ("Menu Demo");
            Container contentPane = getContentPane();
            contentPane.setLayout(new BorderLayout());
            JPanel buttonPanel = new JPanel();
            buttonPanel.setLayout(new FlowLayout());
            JButton sumbutton = new JButton("Add");
            sumbutton.addActionListener(this);
            buttonPanel.add(sumbutton);
            JButton subbutton = new JButton("Subtract");
            subbutton.addActionListener(this);
            buttonPanel.add(subbutton);
            JButton multbutton = new JButton("Multiply");
            multbutton.addActionListener(this);
            buttonPanel.add(multbutton);
            JButton divbutton = new JButton("Divide");
            divbutton.addActionListener(this);
            buttonPanel.add(divbutton);
            contentPane.add(buttonPanel, BorderLayout.SOUTH);
            JPanel infoPanel = new JPanel();
            infoPanel.setLayout(new FlowLayout());
            JLabel nameLabel = new JLabel("Number 1");
            infoPanel.add(nameLabel);
            inputField = new JTextField("", 3);
            infoPanel.add(inputField);
            JLabel secondnameLabel = new JLabel("Number 2");
            infoPanel.add(secondnameLabel);
            inputsecondField = new JTextField("", 3);
            infoPanel.add(inputsecondField);
            JLabel resultLabel = new JLabel("Result");
            infoPanel.add(resultLabel);
            resultField = new JTextField("", 5);
            infoPanel.add(resultField);
            // set document filter on textfield documents
            String integerDomain = "-.0123456789";
            FieldNumberFilter filter = new FieldNumberFilter(integerDomain);
            AbstractDocument doc = (AbstractDocument)inputField.getDocument();
            doc.setDocumentFilter(filter);
            doc = (AbstractDocument)inputsecondField.getDocument();
            doc.setDocumentFilter(filter);
            doc = (AbstractDocument)resultField.getDocument();
            doc.setDocumentFilter(filter);
            contentPane.add(infoPanel);
            JMenuBar mBar = new JMenuBar();
            setJMenuBar(mBar);
            JMenu operationsMenu = new JMenu("Operations");
            mBar.add(operationsMenu);
            JMenuItem o;
            o = new JMenuItem("Add");
            o.addActionListener(this);
            operationsMenu.add(o);
            o = new JMenuItem("Subtract");
            o.addActionListener(this);
            operationsMenu.add(o);
            o = new JMenuItem("Multiply");
            o.addActionListener(this);
            operationsMenu.add(o);
            o = new JMenuItem("Divide");
            o.addActionListener(this);
            operationsMenu.add(o);
            JMenu viewMenu = new JMenu("View");
            mBar.add(viewMenu);
            ViewMenuListener viewMenuListener = new ViewMenuListener();
            JMenuItem v;
            v = new JMenuItem("Metal");
            v.addActionListener(viewMenuListener);
            viewMenu.add(v);
            v = new JMenuItem("Motif");
            v.addActionListener(viewMenuListener);
            viewMenu.add(v);
            v = new JMenuItem("Windows");
            v.addActionListener(viewMenuListener);
            viewMenu.add(v);
            JMenu exitMenu = new JMenu("Exit");
            mBar.add(exitMenu);
            JMenuItem e;
            e = new JMenuItem("Close");
            e.addActionListener(this);
            exitMenu.add(e);
         * Listener for the Operations and Close menu items
        public void actionPerformed(ActionEvent e)
            String ac = e.getActionCommand();
            if (ac.equals("Close"))
                String message = "Are you sure you want to exit this program?";
                int returnVal = JOptionPane.showConfirmDialog(frame,
                                                              message,
                                                              "Exit Dialog",
                // either this */                             JOptionPane.YES_NO_OPTION,
                /* or this */                                 JOptionPane.YES_NO_CANCEL_OPTION,
                                                              JOptionPane.QUESTION_MESSAGE);
                if(returnVal == JOptionPane.CANCEL_OPTION ||
                   returnVal == JOptionPane.CLOSED_OPTION)
                    return;
                if(returnVal == JOptionPane.YES_OPTION)
                    System.exit(0);
                if(returnVal == JOptionPane.NO_OPTION);
                    frame.dispose();
            // read entered data
            String one = inputField.getText();
            String two = inputsecondField.getText();
            // if no entry, return
            if(one.equals("") || two.equals(""))
                return;
            // attempt to parse data
            double first, second;
            try
                first  = Double.parseDouble(one);
                second = Double.parseDouble(two);
            catch(NumberFormatException nfe)
                System.out.println(nfe.getMessage());
                return;
            // now we have good data, do calculations
            double result = 0;
            if (ac.equals("Add"))
                result = first + second;
            else if(ac.equals("Subtract"))
                result = first - second;
            else if(ac.equals("Multiply"))
                result = first * second;
            else if(ac.equals("Divide"))
                result = first / second;
            else
                System.out.println("Error in Brown7 interface.");
            resultField.setText(nf.format(result));
         * Listener for the View menu items
        private class ViewMenuListener implements ActionListener
            UIManager.LookAndFeelInfo[] info = UIManager.getInstalledLookAndFeels();
            public void actionPerformed(ActionEvent e)
                JMenuItem item = (JMenuItem)e.getSource();
                String ac = item.getActionCommand();
                String name = null;
                for(int i = 0; i < info.length; i++)
                    if(info.getName().indexOf(ac) != -1)
    name = info[i].getClassName();
    if(name == null)
    return;
    try
    UIManager.setLookAndFeel(name);
    catch(ClassNotFoundException cnfe)
    System.out.println(cnfe.getMessage());
    catch(InstantiationException ie)
    System.out.println(ie.getMessage());
    catch(IllegalAccessException iae)
    System.out.println(iae.getMessage());
    catch(UnsupportedLookAndFeelException ulafe)
    System.out.println(ulafe.getMessage());
    SwingUtilities.updateComponentTreeUI(BrownTest.this);
    public static void main(String[] args)
    BrownTest gui = new BrownTest();
    gui.setVisible(true);
    * Document filter for input validation in textfields
    class FieldNumberFilter extends DocumentFilter
    String allowables;
    public FieldNumberFilter(String legalCharacters) {
    allowables = legalCharacters;
    public void insertString(DocumentFilter.FilterBypass fb,
    int offset,
    String str,
    AttributeSet attr) throws BadLocationException {
    replace(fb, offset, 0, str, attr);
    public void replace(DocumentFilter.FilterBypass fb,
    int offset,
    int length,
    String str,
    AttributeSet attrs) throws BadLocationException {
    char[] source = str.toCharArray();
    char[] result = new char[source.length];
    int j = 0;
    for(int i = 0; i < result.length; i++)
    if(allowables.indexOf(source[i]) != -1)
    result[j++] = source[i];
    else
    Toolkit.getDefaultToolkit().beep();
    fb.replace(offset, length, new String(result, 0, j), attrs);

  • How can I uninstall old versions of Adobe Illustrator?

    How can I uninstall old versions of Adobe Illustrator?

    This is for uninstalling CS2, but you might find it helpful. EDITED: but watch out, since I don't know if trashing any of these will remove currently needed Illustrator files, if you have a later version.
    To uninstall Adobe Creative Suite in Mac OS 1 -- Double-click Activity Monitor.app in Applications/Utilities, select AHCRemind, and click Quit Process.
    2 -- If you intend to install the product on a different computer, transfer the activation. (See “To transfer the product activation” on page 1.)
    3 -- If you want to uninstall Adobe Acrobat, double-click the uninstaller in Applications/Adobe Acrobat 7.0 Professional, and follow the on-screen instructions.
    4 -- If you want to uninstall Version Cue 2, double-click the uninstaller in Applications/Adobe VersionCue CS2, and follow the on-screen instructions.
    Note: If the Version Cue uninstaller fails, see the alternative procecure, “To remove Version Cue manually” on page 4.
    5 -- From the Applications folder, drag the following items, if present, to the trash: Note: After you drag the items to the trash in steps 5-8, you must empty the trash before you can reinstall
    Adobe Creative Suite 2 on the same computer. • Adobe Acrobat 7.0 Professional • Adobe VersionCue CS2 • Adobe Bridge
    • Adobe GoLive CS2 • Adobe Illustrator CS2 • Adobe InDesign CS2 • Adobe Photoshop CS2 • AdobeHelpCenter.app
    6 -- From the Utilities folder, drag the following items, if present, to the trash: • Adobe Utilities • Adobe Updater.app
    7 -- From the Library folder, drag the following items, if present, to the trash: • Application Support/Adobe/AdobeHelpData • Application Support/Adobe/Assistance • Application Support/Adobe/StartupScripts/Workflow Automation Scripts
    • Preferences/Adobe/Workflow • Preferences/com.adobe.ActivationUtility.plist • Preferences/com.adobe.GoLive.plist • Preferences/Adobe Save For Web GL 8.0 Prefs
    8 -- From the Users/[user name] folder, drag the following items, if present, to the trash: • Library/Preferences Panes/Opera Preferences
    • Library/Caches/Opera Cache
    • Documents/AdobeStockPhotos
    To remove Version Cue manually (Mac OS only, not recommended)
    If you’ve accidentally removed parts of the Version Cue installation manually or if the uninstaller fails, you have to remove the remaining installed Version Cue components manually.
    1 -- From the Library/PreferencePanes folder, drag the Version Cue CS2.prefPane folder to the trash. 2 -- From the Library/Preferences folder, drag the com.adobe.versioncueCS2.plist file to the trash. 3 -- From the Library/StartupItems folder, drag the AdobeVersionCueCS2 folder to the trash. 4 -- From the Applications folder, drag the Adobe Version Cue CS2 folder to the trash.
    5 -- From [user home]/Library/Preferences/Adobe, drag the Workflow folder to the trash. 6 -- (Optional) From the [user home]/Documents folder, drag the Version Cue folder to the trash.

  • How to use javascript in visual jsf

    I have a web project and I am using visual jsf in netbeans. My problem is I cannot with javasciprt.
    When I clicked to a button I want to make some check with javascipt and then run server side java code. With jsp I used to add onclick javascipt and if it is ok, I just submit to servlet and run the java code in servlet. How can I do this with visual jsf

    If you are trying to display total number of pages in a report, Add the below formula in the column of the report and hide that column in the report.
    FX = sum(count(1))/25
    You can then reference the column in the narrative view like this: "Total pages in the report are @5" and out put may be "Total Pages in the report are 30".
    Or
    You can also use something like the below:
    To calculate them use fi:
    CEILING(CAST(RCOUNT("FactColumn In the Report (Sum All)") as DOUBLE)/ 25) for the page number
    CEILING(CAST(COUNT("FactColumn In the Report (Sum All)") as DOUBLE)/ 25) for the total pages
    Put the above formula in the column and reference it in the narrative view like I mentioned in the previous example.
    If you are report view is pivot, then please refer to this link: http://oraclebizint.wordpress.com/2008/01/17/oracle-bi-101332-pagination-in-pivot-tables/
    Hope this helps.
    Thanks,
    -Amith.

  • Problems with query settings

    My model never saves changes of the query settings 'Maximum rows' and 'Suppress sum'. Every time I reopen my model the settings have the initial values '500' and ' '. For me it seems to be a bug.

    Thanks for reporting this issue. It has been fixed and you will be able to see this fix in the next service pack.
    Since, this issue is related to obsolete parameters, I believe, not having the fix immediately should not affect the operatability of your Visual Composer installation. In the meantime, you may employ a workaround as described below:
    To change the values of maxrows and suppress sum fields:
    1. double click on the query infoactor on the story board
    2. on the side pane, you should see the properties of the query, the properties including maxrows and supress sum.
    3. Make any change in the "Name" property. The save button should turn active.
    4. Now make necessary changes in the values of maxrows and suppress sum.
    5. Save.

Maybe you are looking for

  • Text Direction in XML Publisher

    I saw an earlier post from the summer of '06 about printing text vertically and I am wondering if anyone has figured it out. It's not static so I couldn't take the advice of creating an image of it and pasting it in. It's a barcode on a traveler that

  • In Apple mail, the attachment symbol does not appear in the list of sent items

    In Apple mail, the attachment symbol does not appear in the list of sent items. So you cannot sort sent emails based on whether or not they have an attachment. Is there a way to fix this?

  • Mail crashes with reference to syncservices

    I have had recurring problems with Mail crashing. I've scoured the boards and found nothing that's helped me resolve it (trashing plist, building new accounts, removing to-dos from iCal....). I'm just shy of an archive-and-install...sigh. The problem

  • How to use LIKE operator with PreparedStatement

    Hi, I need to execute a query with the LIKE operator, but using a PreparedStatement. Can I do this, and if so what must my SQL look like with the wildcard characters '%' or '_'? normal PS example: conn.prepareStatement("select * from mytable where na

  • BOM and Production Order: Multiple Inputs to Multiple Outputs

    Dear All, My client's industry required BOM and Production Order must be Multiple Inputs to Multiple Outputs. We propose to create customization program to work on it but client do not want any customizations. Any suggestions? SAP B1 8.81 PL13 Thank