Total Inventory Line Problem...Help Please

I am creating a Inventory Program for my Java class. I have gotten all of the program to pull to the GUI I created but one. For some reason my total inventory calculation will not pull to the GUI. Can anyone help me find the problem within my code. Here is both the main program and my buttonframe. If the other two parts are needed just let me know. It will all compile, just the label were the total inventory goes is still at zero it will not put the number in the box. I will be forever grateful for any help or tips in fixing the problem. Thanks
// Inventory4.java
// Program will track total inventory items in stock.
import java.io.*;
import javax.swing.JFrame;
public class Inventory4 {
     // shared BufferedReader for keyboard input
     private static BufferedReader stdin = new BufferedReader( new InputStreamReader( System.in ) );
     // shared BufferedReader for keyboard input
     private static int totalCount = 5;
          /** Create a new instance of Main */
          public Inventory4() {
               double unitPrice; // Unit price of each item
               double quantityStock; // Number of items in stock
               double inventoryValue; // Place holder for calculated inventory value
               double totalInventory; // Place holder for calculated total inventory value
               int itemNumber; // Item Number
               String itemName = ""; // Name of each item
          //Main Method begins execution of program
          public static void main(String[] args)throws IOException {
               // Declare an array of classes
               SubItem myItem[];
               // Declare number of arrays
               myItem = new SubItem[5];
               // Declare an array of my item classes
               // Create a new instance of the class Item
               myItem = new SubItem[5];
               // Create an instance of my item classes
               myItem[0] = new SubItem(1.79,24,4,1,"Breads");
               myItem[1] = new SubItem(3.49,15,3,2,"Dairy");
               myItem[2] = new SubItem(6.49,20,9,3,"Meats");
               myItem[3] = new SubItem(0.25,31,12,4,"Can Goods");
               myItem[4] = new SubItem(2.59,37,7,5,"Produce");
               // Call print method
               printArray(myItem);
               // Call sort array
               myItem = sortArray(myItem);
               System.out.println(" Inventory List Sorted by Items \n\n");
               printArray(myItem);
          // Call the GUI constructor and pass array and totalcount
               ItemButton itemButton = new ItemButton(myItem,totalCount); // Make ItemButton
               itemButton.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
               itemButton.setSize( 350,390 ); // Window size
               itemButton.setVisible( true ); // display window
     } // End Main Method
                              /// Start PrintArray Method ///
          private static SubItem[] printArray(SubItem[] myItem) {
               double totalInventory = 0;
               double restockingFee = 0;
          // Start Loop
     for (int i = 0; i<5;++i) {
          System.out.println("\n The Item Number is " + i + myItem.getItemNumber() );
          System.out.println("\n Item Name is " + myItem[i].getItemName() );
          System.out.println("\n Quantity in Stock is " + myItem[i].getQuantityStock() );
          System.out.println("\n Inventory Write-off is " + myItem[i].getInventoryWriteoffs() );
          System.out.println("\n Inventory Value is $" + myItem[i].computeinventoryValue());
          totalInventory = totalInventory + myItem[i].computeinventoryValue();
          restockingFee = totalInventory + myItem[i].computeRestockingFee();
     } // End For Loop
          System.out.println("\n Total Value of all inventory is " + totalInventory);
          System.out.println("\n Total Value of all inventory with restock fee $" + restockingFee);
          return myItem;
} // End PrintArray Method
                              /*** Bubble Sort Algorithm ***/
          private static SubItem[] sortArray(SubItem[] myItem) {
               // Create temporary place holder
               SubItem temp = new SubItem();
               // Counters for Sort are I and J
          int i, j;
               int array_size = 5;
          for (i = (array_size - 1); i >= 0; i--) {
               for (j = 1; j <= i; j++) {
                    if (myItem[j-1].getItemName().compareTo(myItem[j].getItemName()) > 1) {
                    temp = myItem[j-1];
                         myItem[j-1] = myItem[j];
                              myItem[j] = temp;
                              } // End if
          } // End inner for loop
     } // End outer for loop
     return myItem;
} // End Method
} // End Class
// ItemButton.java
// This will create GUI buttons.
// Display the Items.
     import java.awt.FlowLayout;
     import java.awt.event.ActionListener;
     import java.awt.event.ActionEvent;
     import javax.swing.JFrame;
     import javax.swing.JButton;
     import javax.swing.JLabel;
     import javax.swing.JTextField;
     import javax.swing.Icon;
     import javax.swing.ImageIcon;
     import javax.swing.JOptionPane;
     import javax.swing.SwingConstants;
public class ItemButton extends JFrame {
     private JButton nextJButton; // text button
     private JButton prevJButton; // icon button
     private JLabel lblItemName; // text field with set size
     private JTextField txtItemName; // text field constructed with text
     private JTextField textField3; // text field with text and size
     private JLabel lblItemNumber; // text field with set size
     private JTextField txtItemNumber; // text field constructed with text
     private JLabel lblUnitPrice; // text field with set size
     private JTextField txtUnitPrice; // text field constructed with text
     private JLabel lblQuantityStock; // text field with set size
     private JTextField txtQuantityStock; // text field constructed with text
     private JLabel lblInventoryWriteoffs; // text field with set size
     private JTextField txtInventoryWriteoffs; // text field constructed with text
     private JLabel lblcomputeRestockingFee; // text field with set size
     private JTextField txtcomputeRestockingFee; // text field constructed with text
     private JLabel lblcomputeinventoryValue; // text field with set size
     private JTextField txtcomputeinventoryValue; // text field constructed with text
private JLabel lblcomputetotalInventory; // text field with set size
private JTextField txtcomputetotalInventory; // text field constructed with text
// Class variable of the SubItem array I passed
SubItem[] arraySubItem;
private int currentArrayCounter;
private int arrayCount;
// ItemButton adds JButtons to JFrame
public ItemButton(SubItem[] myItem, int totalArrayCount) {
          super ( "Inventory" );
          arraySubItem = myItem;
// Setting variable totalArrayCount
// to class arrayCounter
     arrayCount = totalArrayCount;
     currentArrayCounter = 0;
// Current array position 0
     setLayout( new FlowLayout() ); // set frame layout
// Load the next and previous icons
     Icon iconNext = new ImageIcon( getClass().getResource( "" ) );
     Icon iconPrev = new ImageIcon( getClass().getResource( "" ) );
// Construct textfield with default text and 15 columns
     lblItemName = new JLabel( "Item Name ");
     add( lblItemName ); // textField3 to JFrame
     txtItemName = new JTextField( "", 15 );
     add( txtItemName ); // add textField3 to JFrame
     lblItemNumber = new JLabel( "Item Number ");
     add( lblItemNumber ); // textField3 to JFrame
txtItemNumber = new JTextField( "", 15 );
     add( txtItemNumber ); // add textField3 to JFrame
     lblUnitPrice = new JLabel( "Unit Price ");
     add( lblUnitPrice ); // textField3 to JFrame
txtUnitPrice = new JTextField( "", 15 );
     add( txtUnitPrice ); // add textField3 to JFrame
     lblQuantityStock = new JLabel( "Quantity Stock " );
     add( lblQuantityStock ); // textField3 to JFrame
     txtQuantityStock = new JTextField( "", 15 );
     add( txtQuantityStock ); // add textField3 to JFrame
     lblInventoryWriteoffs = new JLabel( "Inventory Write-Offs " );
     add( lblInventoryWriteoffs ); // textField3 to JFrame
     txtInventoryWriteoffs = new JTextField( "", 15 );
     add( txtInventoryWriteoffs ); // add textField3 to JFrame
     lblcomputeRestockingFee = new JLabel( "Restocking Fee ");
     add( lblcomputeRestockingFee ); // textField3 to JFrame
     txtcomputeRestockingFee = new JTextField( "", 15 );
     add( txtcomputeRestockingFee ); // add textField3 to JFrame
     lblcomputeinventoryValue = new JLabel( "Inventory Value " );
     add( lblcomputeinventoryValue ); // textField3 to JFrame
     txtcomputeinventoryValue = new JTextField( "", 15 );
     add( txtcomputeinventoryValue ); // add textField3 to JFrame
     lblcomputetotalInventory = new JLabel( "Total Inventory ");
     add( lblcomputetotalInventory ); // textField3 to JFrame
     txtcomputetotalInventory = new JTextField( "", 15 );
     add( txtcomputetotalInventory ); // add textField3 to JFrame
// Create the buttons
     nextJButton = new JButton( "Next" ); // button with Next
     prevJButton = new JButton( "Previous"); // button with Prev
     add(prevJButton);
     add(nextJButton); // add plainJButton to JFrame
// Create new ButtonHandler for button event handling
     ButtonHandler handler = new ButtonHandler();
     nextJButton.addActionListener( handler );
     prevJButton.addActionListener( handler );
// SetTextFields to set the text fields
     setTextFields();
} // End ButtonFrame constructor
// inner class for button event handling
     private class ButtonHandler implements ActionListener
          // handle button event
          public void actionPerformed( ActionEvent event )
               // Which button was pressed
               if (event.getActionCommand()== "prevJButton") {
                    currentArrayCounter++;
               else {
                    currentArrayCounter++;
               setTextFields();
          } // End Method ActionPerformed
     } // End Private inner class ButtonHandler
     private void setTextFields()
          // Check to see if the end of array was past
          if (currentArrayCounter == arrayCount)
               currentArrayCounter = 0;
          // Check to see if the first was past
          if (currentArrayCounter < 0)
               currentArrayCounter = arrayCount;
          txtItemName.setText(arraySubItem[currentArrayCounter].getItemName());
          txtItemNumber.setText(arraySubItem[currentArrayCounter].getItemNumber()+"");
          txtUnitPrice.setText(arraySubItem[currentArrayCounter].getUnitPrice()+"");
          txtQuantityStock.setText(arraySubItem[currentArrayCounter].getQuantityStock()+"");
          txtInventoryWriteoffs.setText(arraySubItem[currentArrayCounter].getInventoryWriteoffs()+"");
          txtcomputeRestockingFee.setText(arraySubItem[currentArrayCounter].computeRestockingFee()+"");
          txtcomputeinventoryValue.setText(arraySubItem[currentArrayCounter].computeinventoryValue()+"");
          txtcomputetotalInventory.setText(arraySubItem[currentArrayCounter].computetotalInventory()+"");
} // End class ItemButton

I am sorry guys,
When I run the program all labels are in place and data appears where it is suppose to be...but the total inventory line. The label for the total inventory is there, but where the data is suppose to be all it will put there is 0.0. It will not put in the dollar amount. I know the problem is with the GUI, because before I started with the buttonFrame and it was compiled it would give me me the dollar amount for the Total Inventory. Here is the rest of the code.
// Item.java
// Program Starts Item Class
public class Item {
     private double unitPrice;
     private double quantityStock;
     private int inventoryWriteoffs;
     private double inventoryValue;
     private double totalInventory;
     private int itemNumber;
     private String itemName;
     /** Create a new instance of Item Name */
     public Item(double UnitPrice,double QuantityStock,int InventoryWriteoffs,int ItemNumber,String ItemName) {
          itemName = ItemName;
          itemNumber = itemNumber;
          unitPrice = UnitPrice;
          quantityStock = QuantityStock;
          inventoryWriteoffs = InventoryWriteoffs;
     } public Item() {  }
     // Set for Name
     public void setItemName(String ItemName) {
          itemName = ItemName;
     // Set for Item Number
     public void setItemNumber(int ItemNumber) {
          itemNumber = ItemNumber;
     // Set for Unit Price
     public void setUnitPrice(double UnitPrice) {
          unitPrice = UnitPrice;
     // Set for Quanity Stock
     public void setQuantityStock(double QuantityStock) {
          quantityStock = QuantityStock;
     // Set for Inventory Write-Offs
     public void setInventoryWriteoffs(int InventoryWriteoffs) {
          inventoryWriteoffs = InventoryWriteoffs;
     // Get for Name
     public String getItemName() {
          return itemName;
     // Get for Item Number
     public int getItemNumber() {
          return itemNumber;
     // Get for Unit Price
     public double getUnitPrice() {
          return unitPrice;
     // Get for Quantity Stock
     public double getQuantityStock() {
          return quantityStock;
     // Get for Inventory Write-offs
     public int getInventoryWriteoffs() {
          return inventoryWriteoffs;
     // Compute Inventory Value Method
     public double computeinventoryValue() {
          return quantityStock * unitPrice;
     // Compute Total Inventory Method
     public double computetotalInventory() {
          return totalInventory = totalInventory + inventoryValue;
     public String toString() {
          return (itemName);
// SubItem.java
// Sub class to main program
public class SubItem extends Item {
     private int inventoryWriteoffs;
     private double restockingFee = .05;
     public SubItem(double UnitPrice,double QuantityStock,int InventoryWriteoffs,int ItemNumber,String ItemName) {
          setUnitPrice(UnitPrice);
          setQuantityStock(QuantityStock);
          setItemNumber(ItemNumber);
          setItemName(ItemName);
          inventoryWriteoffs = InventoryWriteoffs;
     // Empty
     public SubItem() {
     // Set for Inventory Write-offs
          public void setInventoryWriteoffs(int InventoryWriteoffs) {
               inventoryWriteoffs = InventoryWriteoffs;
     // Get for Inventory Write-offs
          public int getInventoryWriteoffs() {
               return inventoryWriteoffs;
     // Method to compute Restocking Fee
          public double computeRestockingFee() {
               return ((getUnitPrice() * getQuantityStock()) * restockingFee);
Thanks again for any help.

Similar Messages

  • Possible line problems - Help Please?

    Good Morning,
    Been having a lot of problems with slow speeds and the Hub disconnecting recently. I suspect this is to do with the phone line as my setup has not changed since previous issues I had with internal wiring which I fixed with help from people on here...
    Anyway, my Hub is connected directly into the test socket and my stats are as below. This doesn't seem right. My noise margin seems very low and the number of errors and events seem rather high. My IP profile has been higher in the past and stable until a few weeks ago.
    I realise the connection is not 'stable' as it's been less than three to five days - I'm struggling to keep a connection for 24 to 48 hours at the moment without a reset so this is good for now!
    Any help from Mods or others much appreciated. Not much I can do at this end.
    Thanks,
    Dan.
    ADSL Line Status
    Connection Information
    Line state: Connectedppp0_0
    Connection time: 2 days, 08:27:20
    Downstream: 2.188 Mbps
    Upstream: 448 Kbps
    ADSL Settings
    VPI/VCI: 0/38
    Type: PPPoA
    Modulation: G.992.1 Annex A
    Latency type: Interleaved
    Noise margin (Down/Up): 2.5 dB / 20.0 dB
    Line attenuation (Down/Up): 61.8 dB / 31.5 dB
    Output power (Down/Up): 17.7 dBm / 12.3 dBm
    FEC Events (Down/Up): 178731265 / 1208
    CRC Events (Down/Up): 288943 / 1108
    Loss of Framing (Local/Remote): 0 / 0
    Loss of Signal (Local/Remote): 0 / 0
    Loss of Power (Local/Remote): 0 / 0
    HEC Events (Down/Up): 418976 / 3497
    Error Seconds (Local/Remote): 38442 / 1298
    Download speed achieved during the test was - 1.6 Mbps
     For your connection, the acceptable range of speeds is 0.4 Mbps-2 Mbps.
     Additional Information:
     Your DSL Connection Rate :2.24 Mbps(DOWN-STREAM), 0.45 Mbps(UP-STREAM)
     IP Profile for your line is - 1.75 Mbps

    as you are in the test socket already are you using a new filter?  tried changing the modem rj11 cable?  do you use a phone extension cable to connect to test socket?
    check this post for other ideas  uk sales 08007830056
    http://community.bt.com/t5/BB-in-Home/Poor-Broadba​nd-speed/m-p/14217#M8397
    If you like a post, or want to say thanks for a helpful answer, please click on the Ratings star on the left-hand side of the post.
    If someone answers your question correctly please let other members know by clicking on ’Mark as Accepted Solution’.

  • Re: Possible line problems - Help Please?

    I have a ver similar complaint, my broadband has regularly been downloading at around 5-6mb which is good for our area, about 2weeks ago it started dropping out and now whe connected I'm lucky to get 0.5mb, we also had a lot of noise on the line.
    Bt came and checked the line and whilst they did find a problem with their equipment which they sorted they said the main cause of the crackle must be an internal short, which is not BT's Responsibility, which I completely understand.
    However I pulled all the internal connections off the BT DP and did a quiet line test, which was fine, but even if I connect the HomeHub straight in to the BT socket, with no internal connections connected, I still get the same poor speed and unreliable connection whether wired straight to the computer of via wifi, I can't use iPlayer, any video streaming, and it's near impossible to work from home. Good job I opted to pay extra for unlimited downloads at 0.5mb I'm sure that was a smart move!
    E-mailed BT who said they've done various tests and they asked me to reply, but the next line said don't reply to this e-mail address genius! a brilliant bit of customer service, ask for a reply then not tell you how to reply.
    Anyway, Could the HomeHub have packed up? It seems to be the only piece of the puzzle left.
    James

    A little more info following the responses...
    I'm around 400m (metres) from the exchange in terms of a straight line, obviously the cable could be longer although I live on a road with many houses, not out in the sticks so I would suggest that the cable shouldn't be that much longer.
    I am not using any extension leads, the router is 1 metre from the test socket and my computer is hard wired in the same room also into the router all internal wiring for phones is now disconnected and I am using the BT DP test socket.
    This is slightly by the by as I have previously had 5+ MB at this address and I have not changed service provider, added any services or anything.
    We moved in 9 months ago, house is 20y/old so it's not a new estate or anything, we've had BT broadband from day one, good speed 5-6mb when tested on occasions, and able to stream iPlayer on my Humax box/iPad and desktop, as well as YouTube etc... i.e all the stuff you expect to be able to do with broadband.
    Nothing has changed but about 2 weeks ago the broadband just flopped, it now drops out regularly, the wireless devices including iPad are constantly loosing the signal, the hub is in the same location nothing's change, which is why I can't believe this is a fault at my end.
    Any further suggestions greatly appreciated!
    Thanks in advance.
    James

  • Counting lines problem. Please help!!

    Hi all,
    I just have a small problem i cannot resolve, here it is: I read through a file and i like to count the lines of the file there is before a special word.
    E.g
    My file contains:
    "hi
    how are you
    my name is john
    and i live
    britain"
    I'd like to count how much lines there are in the file before the word LIVE ==> result would be 4.
    I proceed with StreamTokenizer, but i don't knor how to specify the word. Here is my code:
         try {FileReader fr = new FileReader("test2.dat");
                   BufferedReader br = new BufferedReader(fr);
                   StreamTokenizer stk = new StreamTokenizer(br);
                   do {
                   n = stk.nextToken();
                   li = stk.lineno();
                   if (n == stk.TT_NUMBER) {
                        n = stk.nextToken();
                   if (n == stk.TT_EOL) {
                        li++;
                        n = stk.nextToken();
                   if (n == stk.TT_WORD) {
                        String str = stk.sval;
                        if ("entier".equals(str)) {
                             System.out.println(li);
                        else {
                             n = stk.nextToken();
                   while (??????????????);
    I want here to specify the word "entier" but how to do this??
    Thanks very much for your precious help....

A: Counting lines problem. Please help!!

Use LineNumberReader, which counts lines for you. Here's a complete program in 16 lines:
import java.io.*;
public class test4 {
  public static void main(String[] argv) {
    if (argv.length < 2) { System.err.println("no arg"); System.exit(0); }
    try {
      LineNumberReader in = new LineNumberReader(new FileReader(argv[1]));
      String line;
      while((line = in.readLine()) != null)
        if (line.indexOf(argv[0]) != -1)
          System.out.println("Found match at line " + in.getLineNumber());
    } catch (IOException e) {
      e.printStackTrace();
}If you want case insensitivity, you can make both lines lower-case before searching. Or you can use regular expressions.

Use LineNumberReader, which counts lines for you. Here's a complete program in 16 lines:
import java.io.*;
public class test4 {
  public static void main(String[] argv) {
    if (argv.length < 2) { System.err.println("no arg"); System.exit(0); }
    try {
      LineNumberReader in = new LineNumberReader(new FileReader(argv[1]));
      String line;
      while((line = in.readLine()) != null)
        if (line.indexOf(argv[0]) != -1)
          System.out.println("Found match at line " + in.getLineNumber());
    } catch (IOException e) {
      e.printStackTrace();
}If you want case insensitivity, you can make both lines lower-case before searching. Or you can use regular expressions.

  • I have a black window that keeps coming up and telling me the various tasks that I am handeling. It came after opening a power point and now I cannot make it disappear. It frames all windows and programs that I open with a black line. Help please...

    I have a black window that keeps coming up and telling me the various tasks that I am handeling. It came after opening a power point and now I cannot make it disappear. It frames all windows and programs that I open with a black line. Help please...

    Go to System Preferences - Accessibility - Voiceover - turn off Voiceover. The shortcut is command-F5, so possibly you pressed that accidentally.
    Matt

  • Multiselect problem Help please!!

    Hi all,
    I am currently using Application Express 3.1.2.00.02 I have developed an online questionnaire with a multiselect list for one of the questions. The problem i am having is that i need each choice to be totaled up separately on the report generated.
    My table of answers looks like this:
    Column name e.g. (Question 9)
    Answer "Dog" "Cat" "Mouse" "Snake" (underneath column name Question 9 depending on what is selected).
    The reporting page would look like below:
    *(Column Question 9)* Count
    Dog 1
    Mouse 1
    Snake 1
    and for the question you could have another respondent who chooses similar of items on the multiselect, so their answer looks like this:
    Answer
    "Question 9" Dog
    "Question 9" Snake
    This would then start a new row on the reporting page like below which is not what i want:
    *(Column Question 9)* Count
    Dog 1
    Mouse 1
    Snake 1
    Dog: Snake 1
    But the report should look like this:
    *(Column Question 9)* Count
    Dog 2
    Mouse 1
    Snake 2
    The current SQLquery i am using is below:
    select "QUESTION 9",
    count(*) c
    from "P1 DQUESTIONNAIRE"
    group by "QUESTION 9"
    Thanks for your help and suggestions,
    'S'

    How to make sure your forum post will never be answered:
    1) Make sure your subject line is completely meaningless (i.e. HELP PLEASE!) and describes no part of your actual problem
    2) State that you are having "a few problems" but make sure to offer no details whatsoever what those problems are or what the symptoms are.
    3) Post large volumes of code instead of distilling the problem down to a compact snippet
    4) For extra points, make the code hard to read by refusing to make use of the "code" tag.

  • SQL INSERT problem - help please

    Hello,
    I'm having a problem with INSERT statement.
    There is a "ShowFinal.jsp" page, which is a list of candidates who selected from the second
    interview. The user picked some candidates from the list and conduct the 3rd interview. After
    he check suitable candidates(who are selected from the 3rd interview) from the list , enter
    basic salary for every selected candidate, enter date of interview and finally submit the form.
    These data should be save into these tables.
    FinalSelect(nicNo,date)
    EmpSalary(nicNo,basicSal)
    In this "ShowFinal.jsp" page, it validates the following conditions using JavaScript.
    1) If the user submit the form without checking at least one checkbox, then the system should be
    display an alert message ("Please select at least one candidate").
    2) If the user submit the form without entering the basic salary of that candidate which was
    checked, then the system should be display an alert message ("Please enter basic salary").
    These are working well. But my problem is how to wrote the "AddNewFinal.jsp" page to save these
    data into the db.
    Here is my code which I have wrote. But it points an error.
    "AddNewFinal.jsp"
    String interviewDate = request.getParameter("date");
    String[] value = request.getParameterValues("ChkNicno");
    String[] bs = request.getParameterValues("basicSal");
    String sql ="INSERT INTO finalselect (nicNo,date) VALUES(?,?)";
    String sql2 ="INSERT INTO EmpSalary (nicNo,basicSal) VALUES(?,?)";
    for(int i=0; i < value.length; i++){
         String temp = value;     
         for(int x=0; x < bs.length; x++){
              String basic = bs[x];
              pstmt2 = connection.prepareStatement(sql2);
              pstmt2.setString(1, temp);
              pstmt2.setString(2, basic);
              int RowCount1= pstmt2.executeUpdate();
         pstmt1 = connection.prepareStatement(sql);
         pstmt1.setString(1, temp);
         pstmt1.setString(2, interviewDate);
         int RowCount= pstmt1.executeUpdate();
    Here is the code for "ShowFinal.jsp".
    <form name="ShowFinal" method="POST" action="AddNewFinal.jsp" onsubmit="return checkEmpty() &&
    ValidateDate();">
    <%--  Loop through the list and print each item --%>
    <%
         int iCounter = 0; //counter for incremental value
         while (igroups.hasNext()) {
              Selection s = (Selection) igroups.next();
              iCounter+=1; //increment
    %>
    <tr>
         <td style="background-color:ivory" noWrap width="20">
         <input type="checkbox" name="<%= "ChkNicno" + iCounter %>"      
    value="<%=s.getNicno()%>"></td>
            <td style="background-color:ivory" noWrap width="39">
                 <%= s.getNicno() %>  </td>
         <td style="background-color:ivory" noWrap width="174">
              <input type="text" name="<%= "basicSal" + iCounter %>" size="10"> </td>
    </tr>
    <%
    %>
    Date of interview<input type="text" name="date" size="17"></td>
    <input type="submit" value="APPROVE CANDIDATE" name="B1" style="border: 1px solid #0000FF">
    </form>........................................................
    Here is the error generated by TOMCAT.
    root cause
    java.lang.NullPointerException
         at org.apache.jsp.AddNewFinal_jsp._jspService(AddNewFinal_jsp.java:70)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
    I have goto the file "AddNewFinal_jsp.java". The line 70 points to the following line.
    for(int i=0; i < value.length; i++){ [/b]
    Please can someone help me to solve this problem? Please help me to do this task.
    Thanks.

    Hi Casabianca ,
    It is clearly that your problem is not on the database end, more like a servlet/jsp issue.
    I will not comment on the javascript portion, but rather the 2 jsps.
    a simple way to trace what's go wrong is to check the final result (the html code) of the first jsp (showFinal.jsp), and compare against what is expected by the 2nd jsp (AddNewFinal.jsp). Most browser do provide "view source" on the page visited.
    the following code
    <input type="checkbox" name="<%= "ChkNicno" + iCounter %>" value="<%=s.getNicno() %>">
    <input type="text" name="<%= "basicSal" + iCounter %>"
    would likely to be "translated" to html code something as follow:
    <input type="checkbox" name=""ChkNicno0" value="nicNo>">
    <input type="text" name="basicSal0">
    the original code in "AddNewFinal.jsp" using
    request.getParameterValues("ChkNicno");
    which looking for a none exist http request parameter (sent as "ChkNicno0",etc but look for "ChkNicno"), which has explained before.
    the second attempt to use String[] value = request.getParameterValues("ChkNicno" + iCounter); give Cannot resolove symbol :iCounter. because iCounter never defined in the 2nd jsp!
    Most of the error message do give clue to cause of error... : )
    not too sure on your intension, assume you wish to update only those selected (checked) row to db.
    some suggestions:
    1) <input type="text" name="ChkNicno" size="10"> </td>...
    <input type="text" name="basicSal" size="10"> instead.
    then use javascript to based on checked element index (refer to javascript spec for more details), for those index not checked, clear off the correspond index "basicSal" field value.
    e.g. ChkNicno[1] is not checked, empty basicSal[1] value before submission.
    This will give us only selected rows values.
    2) retain the code
    String[] value = request.getParameterValues("ChkNicno");
    String[] bs = request.getParameterValues("basicSal");at 2nd jsp, as now the http request will pass parameters using "ChkNicno" and "basicSal".
    3) some change to the code for optimization
    for(int i=0; i < value.length; i++){
         String temp = value;     
         for(int x=0; x < bs.length; x++){
              String basic = bs[x];
              pstmt2 = connection.prepareStatement(sql2);
              pstmt2.setString(1, temp);
              pstmt2.setString(2, basic);
              int RowCount1= pstmt2.executeUpdate();
         pstmt1 = connection.prepareStatement(sql);
         pstmt1.setString(1, temp);
         pstmt1.setString(2, interviewDate);
         int RowCount= pstmt1.executeUpdate();
    to
    pstmt1 = connection.prepareStatement(sql);
    pstmt2 = connection.prepareStatement(sql2);
    for(int i=0; i < value.length; i++){
         String temp = value;     
         for(int x=0; x < bs.length; x++){
              String basic = bs[x];
              pstmt2.setString(1, temp);
              pstmt2.setString(2, basic);
              int RowCount1= pstmt2.executeUpdate();
         pstmt1.setString(1, temp);
         pstmt1.setString(2, interviewDate);
         int RowCount= pstmt1.executeUpdate();
    preparestatement created once should be sufficient as we do not change the sql statement throughout the loop.
    there are better solutions out there, this just some ideas and suggestions.Do try out if you wish.
    Hope it helps. : )

  • VIRUS PROBLEMS, HELP PLEASE???

    I continue to have messages popping up saying my computer is infected. It wants me to cleanup and I have to register with Mac Shield 2.6.  Pronograhic websites keep popping up.  Anyone having this problem?  Did not have this problem yesterday, but it's here today!  There is also a Red Sheild on the top of the toolbar where it shows the time, battery life, etc.  Right clicking on the sheild drops down Scan Now, Cleanup, Control Center, Scan, System Info, Settings, About, and Register.  A pron site just popped up again!  Need help Please!!

    Fuony wrote:
    The Mac Shield malware can come through Firefox too if you allow it to and you click on it!
    Your exactly right, it is possible that if you visit a site and need the scripts to run for something that the malware that uses Javascript is on that site, then your going to be presented with it.
    The thing is with the Firefox + NoScript combination defeats alot of the web side trickery the malware authors are using to get the malware to appear in the first place.
    Also this "MacDefender" isn't the only malware making the rounds. There are some serious Flash vulnerabilities being hosted on hostile/adult websites that are running scripts for no apparent reason other than to try to infect your machine.
    By running all scripts all the time, your computer is in a state as if you tried running across a busy highway blindfolded.
    As a lifelong "MacHead" I can understand Apple loyalty, but if Apple isn't cutting the mustard on their browser security, rather place their users security at serious risk for the sake of convenience, then I have to think about using and recommending to others something else that is more secure.
    As a example, I surf thousands of web pages a day, some on really nasty sites, yet I haven't seen this "MacDefender" appear on my computer. Even when I purposely visited links that people have submitted that had the malware. (I maintain a couple of bootable clones of my boot drive just in case)

  • ICloud problems help please!

    I have an iPhone 6 and during the setup I must have did something wrong and now I have my old iCloud account on it that I no longer remember the password, security questions, and no longer have the email address to that account.  I think I was hacked and my password and security questions changed. I want to log out of iCloud and start using my current iCloud account.  I know these are security measures, but how can I get logged out??? My iPhone is having problems since the latest update and now I can't make a call or text.  I can't call apple support without a working number  HELP Please.

    Hello shelbyrecords,
    Oh no! That sounds really frustrating. Unfortunately, if iCloud Find my iPhone Activation Lock is enabled on the device we’ll need to gain access to your previous Apple ID account to disable it. Based on the information you have provided, it sounds like you may need a personalized support experience to recover your previous Apple ID:
    If you forgot your Apple ID password - Apple Support
    http://support.apple.com/en-us/HT201487
    Make sure that you’re entering the correct Apple ID. In most cases, your Apple ID is also the primary email address of your Apple ID account. If these steps didn't help you change your password, contact Apple Support.
    Thanks,
    Matt M.

  • Soundtrack problems - help please

    Help please. I tried doing a send to multi-track project from FCP with the base layer video option and kept getting the 'error sending selection to Soundtrack Pro' message. I did a search and the suggestion is that I have no disk space but I have over 600GB!
    Then I tried a send with the full video and the file saved okay. However when I try to open the .stmp file, Soundtrack Pro starts and then freezes. I've tried opening in various ways.
    Help please, I just cannot figure this out! What am I doing wrong?

    Not sure how much help this is, but since you're having problems with the layout, did you try deleting the layout file? MacintoshHD/users/username/Library/Application Support/Soundtrack Pro/Layouts
    BTW, I found a BKiLifeConfiguration.plist in the following path:
    MacintoshHD > Library > Application Support > ProApps > Internal Plug-ins > BrowserKit > iLife.bkplugin > Contents > Resources
    Do you find it there?

  • K8N Neo2-fx Ram problem Help please

    I have three ram(2x512MB single sided , 1x1GB double sided). Is there any way I can put them all on the motherboard? When I place them all the computer is not starting and it`s making a "beep" every 2-3 seconds. If i connect the 1GB double sided on the Dimm1(green) and the one 512MB single sided on the Dimm3(green) it`s working properly. Is there any way I can use all my ram at the same time. I`m desperate. Help please...  thank you

    Quote from: wodahS on 09-November-06, 05:55:17
    How can I put my computer facts under any post I am posting? I should make it my signature?
    That's the rule mate which you need to gives all your component in details including your PSU and Bios revision so that others can help you! Like what BOSSKILLER say it won't works with 3 DIMMS unless you purhased another 1 GB of RAM then it can solve your problem with 4 DIMMS or else with 2*512MB RAM. Make sure that you've lowered your HT to <=800Mhz as default is 1000Mhz. GD luck.

  • Shockwave Player 11 - Problem HELP PLEASE!!

    I have upgraded to Shockwave Player 11 but I am having big
    problems. I have installed it but when going on a Shockwave
    supported sites ie; iSketch, it comes up in a white-box with a
    message ''Adobe Shockwave Player is now installing.'' ''Installing
    compatibility components.'' with a white bar below which is
    supposed to fill up but doesnt. Screenshot on Link below. I have
    been trying it both on IE7 & Firefox, tried both semi and full
    installer but no luck. Please help?
    http://i7.photobucket.com/albums/y295/ldndude/others/ShockwaveFlash11Problem.jpg

    quote:
    This worked for me. It will actually let me access the game,
    but it is unplayable. The drawings are all just random lines. When
    I draw people see this problem, it looks like I am just drawing
    random lines on the canvas.
    I'm glad 4 helping u.4 me all the games r playable.But the
    new ones like....
    http://www.miniclip.com/games/power-boat/en/
    or
    http://www.miniclip.com/games/rally-championship/en/
    r very slow.

  • SQL 2.0 and CVI 5.5 Problem - Help please!

    Hi All,
    I have recently updated to CVI 5.5. Over the last week I have been update
    my programs to 5.5. However, I am having problems with the SQL toolbox -
    more specifically the "DBImmediateSQL" function. When the line of code runs
    which contains this function, it returns the error code -11, and an
    Automation Error code -2147352573, Unknown error.
    I am stuck, as this program has been running in 5.0.1 for about a year.
    Does anyone have any idea what could be wrong?
    Richard

    Bill,
    After some discussion with the folk from NI, we discovered that it was
    caused by the installation of SP4 for MSVS. I found I had to reverse all
    changes made by this upgrade to the OBDC and database access. Once this was
    done, I reloaded an older version and things worked fine.
    Sorry for the delay in replying - been on holidays.
    Richard
    "Bill Groenwald" wrote in message
    news:[email protected]..
    >
    > Richard,
    > I don't have an answer but maybe a clue. I am still running 5.0.1 and have
    > just run into the same problem. I'm suspecting a recent install of a
    software
    > inventory management package effected some Oracle library file that
    LabWindows
    > goes through. I found that if I switched to the DBActivateSQL for my
    insert,
    > that worked. I have asked support what could allow DBActivateSQL to work
    > and DBImmediateSQL to fail but have no answer yet. If you can, try that
    workaround
    > to see if it helps. Good Luck.
    > Bill Groenwald
    >

  • Hibernate-very strange problem, help please

    Hi, i got such a strange problem that im sure you ll think im doin crazy talk :) , i dont see why this would happen at all, i have a class called "Package", mapped to a table "package". whenever i do a query on this table using hibernate, even the simplest "find all" kinda of query, hibernate does update on the table b4 doin the query! even more weird, it does the update when the first query on this table happens, it deletes all values of a column (yes only this column); then if i do the same query again, no update at all. however if now i mannuall add those missing values, it does the update again and deletes them! sry its confusing, heres my code and more of wat i done:
    The mapping Package.hbm.xml
    <hibernate-mapping package="tuition.bo">
    <class name="Package" table="package">
    <id name="id" column="study_package_id" type="long">
    <generator class="sequence"/>
    </id>
    <property name="name" column="name" not-null="true"/>
    <property name="satTiming" column="sat_timing" not-null="false"/>
    <property name="satSubjects" column="sat_subjects" not-null="false"/>
    <property name="sunTiming" column="sun_timing" not-null="false"/>
    <property name="sunSubjects" column="sun_subjects" not-null="false"/>
    <set name="classes" inverse="true" cascade="delete-orphan" lazy="true">
    <key column="package_id"/>
    <one-to-many class="Class"/>
    </set>
    </class>
    </hibernate-mapping>
    For example initialy i populated database using hibernate, like this:
    package_id, name, sat_timing, sat_subjects, sun_timing, sun_subjects
    1 no.1 9-12 business 9-12 law
    2 no.2 9-11 business 9-11 law
    Then after i populated this database, i did this query:
    <b>List res=getHibernateTemplate().find("FROM Package");</b>
    and you can see the log file as such: (excerpt)
    16:23:06,687 INFO TransactionFactoryFactory:31 - Using default transaction strategy (direct JDBC transactions)
    16:23:06,703 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
    16:23:09,968 DEBUG JDBCTransaction:46 - begin
    16:23:09,968 DEBUG JDBCTransaction:50 - current autocommit status: true
    16:23:09,968 DEBUG JDBCTransaction:52 - disabling autocommit
    <b>16:23:10,640 DEBUG SQL:324 - select</b> studypacka0_.study_package_id as study1_, studypacka0_.name as name12_, studypacka0_.description as descript3_12_, ....... from _3AT_package studypacka0_
    Hibernate: select studypacka0_.study_package_id as study1_, studypacka0_.name as name12_, studypacka0_.description as descript3_12_, studypacka0_.day as day12_, studypacka0_.sat_timing as sat5_12_, studypacka0_.sat_subjects as sat6_12_, .......
    16:23:10,734 DEBUG JDBCTransaction:83 - commit
    <b>16:23:10,796 DEBUG SQL:324 - update</b> _3AT_package set name=?, description=?, day=?, sat_timing=?, sat_subjects=?, sat_hours=?, sun_timing=?, sun_subjects=?, sun_hours=?, unit_price=?, years_id=?, group_id=? where study_package_id=?
    Hibernate: update _3AT_package set name=?, description=?, day=?, sat_timing=?, sat_subjects=?, sat_hours=?, sun_timing=?, sun_subjects=?, sun_hours=?, unit_price=?, years_id=?, group_id=? where study_package_id=?
    <b>16:23:10,812 DEBUG SQL:324 - update </b>_3AT_package set name=?, description=?, day=?, sat_timing=?, sat_subjects=?, sat_hours=?, sun_timing=?, sun_subjects=?, sun_hours=?, unit_price=?, years_id=?, group_id=? where study_package_id=?
    Hibernate: update _3AT_package set name=?, description=?, day=?, sat_timing=?, sat_subjects=?, sat_hours=?, sun_timing=?, sun_subjects=?, sun_hours=?, unit_price=?, years_id=?, group_id=? where study_package_id=?
    <b>16:23:10,812 DEBUG SQL:324 - update</b> _3AT_package set name=?, description=?,
    16:23:10,953 DEBUG JDBCTransaction:173 - re-enabling autocommit
    16:23:10,953 DEBUG JDBCTransaction:96 - committed JDBC Connection
    as you can see, it does update and changed table field values to this:
    package_id, name, sat_timing, sat_subjects, sun_timing, sun_subjects
    1 no.1 business law
    2 no.2 business law
    ---------- all tiimings are gone. and now if i re-do the same query, there are NO UPDATE operations....howver if i add some values to sat_timing, sun_timing, and re-do the query, very surprisingly, i saw those update operations which delete all timing values again!
    im totally lost... i havent changed any config, this doenst happen to my other classes at all but just this one.... any ideas please! even some thought of what may caused this would be great help! thank you!

    well i got the setters wrong.... being so stupid i am... sry for creating such a long and massy thread.

  • PHOTOSHOP ELEMENTS 10 USING CANON 7D IMAGE PROBLEMS - HELP PLEASE

    I AM HAVING PROBLEMS WITH ELEMENTS 10 AND IMAGES FROM MY CANON 7D WHEN I DOWNLOAD TO SONY LAPTOP ON WINDOWS VISTA. COLOURS ARE DISTORTED, ESPECIALLY ON REDS WHICH ARE SHOWING AS EXTREMELY VIVID AND SOME BROWNS GOING TO A WINE COLOUR. THIS IS A FAIRLY RECENT PROBLEM AND NOT SURE WHAT I AM DOING WRONG? HAVE I ADJUSTED A SETTING BY MISTAKE? ALL HELP APPRECIATED
    MIKE WEBSTER
    SCOTLAND
    UK
    70 YEARS YOUNG
    [email protected]

    Hi Brian,
    Thanks for your reply.
    I have had the 7d for 4 years or more.
    The images downloaded before from the 7d, we're ok and still look ok, it is only in the past month this has happened and it is not with every image it is intermittent. Some are clear then others on the same shoot have the problem. It is even more exaggerated when printed.
    I have tried Zoom browser and it is less evident on there but still shows.
    I am shooting both with Raw & Jpeg and I think it shows in both.
    Being a mean Scotsman I grudge having paid for Photoshop Elements and not getting the good of it.
    I have tried Adobe on line but no luck and they ask me to pay for an annual contract before they will give me technical support, which is about £100.
    I appreciate your assistance and any further help.
    Best wishes,
    Mike
    Sent from AOL Mobile Mail

  • Maybe you are looking for

    • Can't create an ExecuteWithParams activity in a bounded task flow

      I'm trying to replicate the application in the demo, Passing Parameters to a TaskFlow on the URL - http://www.youtube.com/watch?v=3cklxe1qq5I I created a ViewObject named PagerByLastName which has an iterator with the generated name, PagerByLastName1

    • Wildcards in Interactive Report Search Bar

      Here's a question I haven't seen anywhere else. It's a long shot, but I'm going to ask anyway. We are using APEX 4.1.0.00.32. The IR Search bar uses a search where no wildcards are needed. In fact, if you do include a wildcard in the middle of the se

    • Material group issue

      Dear All, The requirement is for a particular material type the system should purpose the material group that belong to that material type only not all the material groups that are defined in the system. Example; Material group—V-belt, bearings, etc

    • Presentaion service frequently going down

      Hello, I am trying to genrate a report in a pivot table format which contains 15 rows.When i am trying to generate this report ,all of a sudden the presentation service is going down.Its not showing any errors. What might be the cause. Thanks in adva

    • Problem stroking a shape

      Can someone please help me figure out how to stroke a shape? I want to place opaque white circles over curved dotted line paths. I have succeeded in making the curved paths, and stroking them with dotted lines. I have succeed in placing opaque white