identifier expected with ArrayList in JDK5RC

Just started with J2SE1.5 but still am unable to compile. Already fixed the generics.
Error is <identifier> expected. See code.
Who can help me with this? I am stuck :-(
import java.util.List;
import java.util.Vector;
import java.awt.Dimension;
import javax.swing.JFrame;
import javax.swing.JTable;
import javax.swing.JScrollPane;
import javax.swing.table.AbstractTableModel;
public class TableWithVectorData extends JFrame {
     private JTable table;
     private Model model;
     public static void main(String[] arg) {
          TableWithVectorData t = new TableWithVectorData();
          t.setVisible(true);
          t.setSize(new Dimension(600, 300));
          t.validate();
     public TableWithVectorData() {
          super("Walter's Table Demo");
          model = new Model(); // getDummy2Data());
          table = new JTable(model);
          JScrollPane scrollPane = new JScrollPane(table);
          getContentPane().add(scrollPane);
     public class Model extends AbstractTableModel {
          public static final int MAC_CODE_COL = 0;
          public static final int MAC_NAME_COL = 1;
          public static final int IP_COL = 2;
          public static final int OS_COL = 3;
          public static final int DOMAIN_COL = 4;
          public List<String> colNames = new ArrayList<String>();
          // the next line gives error message <identifier> expected
          // api doc: public boolean add(E o)
          colNames.add("Machine Code");
          colNames.add("Machine Name");
          colNames.add("IP Address");
          colNames.add("Operating System");
          colNames.add("Domain");
          public List<Class> colTypes = new ArrayList<Class>();
          colTypes.add(Integer.class);
          colTypes.add(String.class);
          colTypes.add(String.class);
          colTypes.add(String.class);
          colTypes.add(String.class);
          public List<MachineData> data = new Vector<MachineData>();
          data.add(new Integer(100), "Robert", "288.209.140.223", "Win NT", "Engineering");
          data.add(new Integer(105), "Rahul", "288.209.140.214","Solaris 5", "Engineering");
          data.add(new Integer(110), "Daina", "288.209.140.220","HP UX", "Engineering");
          public void SimpleTableModel() { // List macDataVector) {
               super();
               //m_macDataVector = macDataVector;
          public int getColumnCount() {
               return colNames.size();
          public int getRowCount() {
               return data.size();
          public void setValueAt(Object value, int row, int col) {
               MachineData mD = (MachineData) data.get(row);
               switch(col) {
                    case MAC_CODE_COL : mD.setMacCode((Integer) value);
                         break;
                    case MAC_NAME_COL : mD.setMacName((String) value);
                         break;
                    case IP_COL : mD.setMacIP((String) value);
                         break;
                    case OS_COL : mD.setMacOS((String) value);
                         break;
                    case DOMAIN_COL : mD.setMacDomain((String) value);
                         break;
          public String getColumnName(int col) {
               return colNames[col];
          public Class getColumnClass(int col) {
               return colTypes[col];
          public Object getValueAt(int row, int col) {
               MachineData mD = (MachineData) data.get(row);
               switch(col) {
                    case MAC_CODE_COL : return mD.getMacCode();
                    case MAC_NAME_COL : return mD.getMacName();
                    case IP_COL : return maD.getMacIP();
                    case OS_COL : return mD.getMacOS();
                    case DOMAIN_COL : return mD.getMacDomain();
               return new String();
     public class MachineData {
          private Integer m_macCode;
          private String m_macName;
          private String m_macIP;
          private String m_macOS;
          private String m_macDomain;
          public MachineData() {
          public MachineData (Integer macCode, String macName, String macIP, String macOS, String macDomain) {
               m_macCode = macCode;
               m_macName = macName;
               m_macIP = macIP;
               m_macOS = macOS;
               m_macDomain = macDomain;
          public Integer getMacCode() {
               return m_macCode;
          public String getMacName() {
               return m_macName;
          public String getMacIP() {
               return m_macIP;
          public String getMacOS() {
               return m_macOS;
          public String getMacDomain() {
               return m_macDomain;
          public void setMacCode(Integer macCode) {
               m_macCode = macCode;
          public void setMacName(String macName) {
               m_macName = macName;
          public void setMacIP(String macIP) {
               m_macIP = macIP;
          public void setMacOS(String macOS) {
               m_macOS = macOS;
          public void setMacDomain(String macDomain) {
               m_macDomain = macDomain;

Now the table is not displayed.
import java.util.List;
import java.util.Vector;
import java.util.ArrayList;
import java.awt.Dimension;
import javax.swing.JFrame;
import javax.swing.JTable;
import javax.swing.JScrollPane;
import javax.swing.table.AbstractTableModel;
public class TableWithVectorData extends JFrame {
     private JTable table;
     private Model model;
     public static void main(String[] arg) {
          JFrame.setDefaultLookAndFeelDecorated(true);
          TableWithVectorData app = new TableWithVectorData();
          app.setSize(new Dimension(600, 300));
          app.setVisible(true);
          app.validate();
     public TableWithVectorData() {
          super("Walter's Table Demo");
          model = new Model();
          table = new JTable(model);
          table.setPreferredScrollableViewportSize(new Dimension(500,200));
          JScrollPane scrollPane = new JScrollPane(table);
          add(scrollPane);
     public class Model extends AbstractTableModel {
          public static final int MAC_CODE_COL = 0;
          public static final int MAC_NAME_COL = 1;
          public static final int IP_COL = 2;
          public static final int OS_COL = 3;
          public static final int DOMAIN_COL = 4;
          public List<String> colNames = new ArrayList<String>();
          public List<Class> colTypes = new ArrayList<Class>();
          public List<MachineData> data = new Vector<MachineData>();
          public void Model() {
               colNames.add("Machine Code");
               colNames.add("Machine Name");
               colNames.add("IP Address");
               colNames.add("Operating System");
               colNames.add("Domain");
               colTypes.add(Integer.class);
               colTypes.add(String.class);
               colTypes.add(String.class);
               colTypes.add(String.class);
               colTypes.add(String.class);
               data.add(new MachineData(new Integer(100), "Robert", "288.209.140.223", "Win NT",
"Engineering"));
               data.add(new MachineData(new Integer(105), "Rahul", "288.209.140.214","Solaris
5", "Engineering"));
               data.add(new MachineData(new Integer(110), "Daina", "288.209.140.220","HP UX",
"Engineering"));
          public int getColumnCount() {
               return colNames.size();
          public int getRowCount() {
               return data.size();
          public void setValueAt(Object value, int row, int col) {
               MachineData mD = (MachineData) data.get(row);
               switch(col) {
                    case MAC_CODE_COL : mD.setMacCode((Integer) value);
                         break;
                    case MAC_NAME_COL : mD.setMacName((String) value);
                         break;
                    case IP_COL : mD.setMacIP((String) value);
                         break;
                    case OS_COL : mD.setMacOS((String) value);
                         break;
                    case DOMAIN_COL : mD.setMacDomain((String) value);
                         break;
          public String getColumnName(int col) {
               return colNames.get(col);
          public Class getColumnClass(int col) {
               return colTypes.get(col);
          public Object getValueAt(int row, int col) {
               MachineData mD = (MachineData) data.get(row);
               switch(col) {
                    case MAC_CODE_COL : return mD.getMacCode();
                    case MAC_NAME_COL : return mD.getMacName();
                    case IP_COL : return mD.getMacIP();
                    case OS_COL : return mD.getMacOS();
                    case DOMAIN_COL : return mD.getMacDomain();
               return new String();
     public class MachineData {
          private Integer m_macCode;
          private String m_macName;
          private String m_macIP;
          private String m_macOS;
          private String m_macDomain;
          public MachineData() {
          public MachineData (Integer macCode, String macName, String macIP, String macOS, String
macDomain) {
               m_macCode = macCode;
               m_macName = macName;
               m_macIP = macIP;
               m_macOS = macOS;
               m_macDomain = macDomain;
          public Integer getMacCode() {
               return m_macCode;
          public String getMacName() {
               return m_macName;
          public String getMacIP() {
               return m_macIP;
          public String getMacOS() {
               return m_macOS;
          public String getMacDomain() {
               return m_macDomain;
          public void setMacCode(Integer macCode) {
               m_macCode = macCode;
          public void setMacName(String macName) {
               m_macName = macName;
          public void setMacIP(String macIP) {
               m_macIP = macIP;
          public void setMacOS(String macOS) {
               m_macOS = macOS;
          public void setMacDomain(String macDomain) {
               m_macDomain = macDomain;
}

Similar Messages

  • Issue in mapping.. Source message expect with prefix ns0 in input message!

    Issue in mapping.. Source message expect with prefix ns0 in input message
    Hi All,
    I used the XSD structure which I got from partner which starts like below.
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://xxxx.com/DirectSales/CustomerData" xmlns:prodata="urn:schemas-progress-com:xml-prodata:0001" xmlns="">
    <xsd:element name="CustomerRequest" prodata:proDataSet="true">
    I'm receiving the messages through SOAP adapter and the message looks like below.
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?><!-- Technical Routing --> <CustomerRequest xmlns='http://XXXX.com/DirectSales/CustomerData' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:SE='http://schemas.xmlsoap.org/soap/encoding/'>
    The message is failing during mapping. When i checked in message mapping, I found that the input source message is expecting with prefix "ns0" like <ns0:CustomerRequest...
    how I can solve this issue? Is there anyway I can add the prefix "ns0" before it comes to mapping step.?
    Thanks
    Deepthi

    Hi Guys,
    I tried to use the below paramter.
    anonymizer.acceptNamespaces         'http://XXXX.com/DirectSales/CustomerData  ns0
    The ns0 is coming in all the tags including segments and fields. I just want ns0 to come only at the root level ie <ns0:customerReq..>
    it is coming like below...
    - <ns0:CustomerRequest xmlns:ns0="http://XXXXXX.com/DirectSales/CustomerData">
    - <ns0:ttCustomer>
      <ns0:branch-num>1424</ns0:branch-num>
      <ns0:cust-num>121</ns0:cust-num>
      <ns0:contact-code>3</ns0:contact-code> 
       </ns0:ttCustomer>
      </ns0:CustomerRequest>
    I want the message to come as
    - <ns0:CustomerRequest xmlns:ns0="http://XXXXXX.com/DirectSales/CustomerData">
    - <ttCustomer>
      <branch-num>1424</branch-num>
      <cust-num>121</cust-num>
      <contact-code>3</contact-code> 
       </ttCustomer>
      </CustomerRequest>
    Kindly help me with the paramater value  to be passed for anonymizer.acceptNamespaces.
    Thanks
    Deepthi

  • Problem with ArrayLists and writing and reading from a .dat file (I think)

    I'm brand new to this forum, but I'm sure hoping someone can help me with a problem I'm having with ArrayLists. This program was originally created with an array of objects that were displayed on a GUI with jtextFields, then cycling thru them via jButtons: First, Next, Previous, Last. Now I need to add the ability to modify, delete and add records. Both iterations of this program needed to write to and read from a .dat file.
    It worked just like it was suppose to when I used just the array, but now I need to use a "dynamic array" that will grow or shrink as needed: i.e. an ArrayList.
    When I aded the ArrayList I had the ArrayList use toArray() to fill my original array so I could continue to use all the methods I'd created for using with my array. Now I'm getting a nullPointerException every time I try to run my program, which means somewhere I'm NOT filling my array ???? But, I'm writing just fine to my .dat file, which is confusing me to no end!
    It's a long program, and I apologize for the length, but here it is. There are also 2 class files, a parent and 1 child below Inventory6. This was written in NetBeans IDE 5.5.1.
    Thank you in advance for any help anyone can give me!
    LabyBC
    package my.Inventory6;
    import java.awt.Container;
    import java.awt.Dimension;
    import java.awt.GridBagConstraints;
    import java.awt.GridBagLayout;
    import java.awt.Insets;
    import java.awt.Toolkit;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.text.DecimalFormat;
    import javax.swing.JOptionPane;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JTextField;
    import java.io.*;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.lang.IllegalStateException;
    import java.util.NoSuchElementException;
    import java.util.ArrayList;
    import java.text.NumberFormat;
    // Class Inventory6
    public class Inventory6 extends javax.swing.JFrame {
    private static InventoryPlusColor[] inventory;
    private static ArrayList inList;
    // create a tool that insure the specified format for a double number, when displayed
    private DecimalFormat doubleFormat = new DecimalFormat( "0.00" );
    private DecimalFormat singleFormat = new DecimalFormat( "0");
    // the index within the array of products of the current displayed product
    private int currentProductIndex;
    /** Creates new form Inventory6 */
    public Inventory6() {
    initComponents();
    currentProductIndex = 0;
    } // end Inventory6()
    private static InventoryPlusColor[] getInventory() {
    ArrayList<InventoryPlusColor> inList = new ArrayList<InventoryPlusColor>();
    inList.add(new InventoryPlusColor(1, "Couch", 3, 1250.00, "Blue"));
    inList.add(new InventoryPlusColor(2, "Recliner", 10, 525.00, "Green"));
    inList.add(new InventoryPlusColor(3, "Chair", 6, 125.00, "Mahogany"));
    inList.add(new InventoryPlusColor(4, "Pedestal Table", 2, 4598.00, "Oak"));
    inList.add(new InventoryPlusColor(5, "Sleeper Sofa", 4, 850.00, "Yellow"));
    inList.add(new InventoryPlusColor(6, "Rocking Chair", 2, 459.00, "Tweed"));
    inList.add(new InventoryPlusColor(7, "Couch", 4, 990.00, "Red"));
    inList.add(new InventoryPlusColor(8, "Chair", 12, 54.00, "Pine"));
    inList.add(new InventoryPlusColor(9, "Ottoman", 3, 110.00, "Black"));
    inList.add(new InventoryPlusColor(10, "Chest of Drawers", 5, 598.00, "White"));
    for (int j = 0; j < inList.size(); j++)
    System.out.println(inList);
    InventoryPlusColor[] inventory = (InventoryPlusColor[]) inList.toArray
    (new InventoryPlusColor[inList.size()]);
    return inventory;
    } // end getInventory() method
    /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">
    private void initComponents() {
    jPanel1 = new javax.swing.JPanel();
    IDNumberLbl = new javax.swing.JLabel();
    IDNumberField = new javax.swing.JTextField();
    prodNameLbl = new javax.swing.JLabel();
    prodNameField = new javax.swing.JTextField();
    colorLbl = new javax.swing.JLabel();
    colorField = new javax.swing.JTextField();
    unitsInStockLbl = new javax.swing.JLabel();
    unitsInStockField = new javax.swing.JTextField();
    unitPriceLbl = new javax.swing.JLabel();
    unitPriceField = new javax.swing.JTextField();
    invenValueLbl = new javax.swing.JLabel();
    invenValueField = new javax.swing.JTextField();
    restockingFeeLbl = new javax.swing.JLabel();
    restockingFeeField = new javax.swing.JTextField();
    jbtFirst = new javax.swing.JButton();
    jbtNext = new javax.swing.JButton();
    jbtPrevious = new javax.swing.JButton();
    jbtLast = new javax.swing.JButton();
    jbtAdd = new javax.swing.JButton();
    jbtDelete = new javax.swing.JButton();
    jbtModify = new javax.swing.JButton();
    jbtSave = new javax.swing.JButton();
    jPanel2 = new javax.swing.JPanel();
    searchIDNumLbl = new javax.swing.JLabel();
    searchIDNumbField = new javax.swing.JTextField();
    jbtSearch = new javax.swing.JButton();
    searchResults = new javax.swing.JLabel();
    jbtExit = new javax.swing.JButton();
    jbtExitwoSave = new javax.swing.JButton();
    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Inventory Program"));
    IDNumberLbl.setText("ID Number");
    IDNumberField.setEditable(false);
    prodNameLbl.setText("Product Name");
    prodNameField.setEditable(false);
    colorLbl.setText("Product Color");
    colorField.setEditable(false);
    colorField.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    colorFieldActionPerformed(evt);
    unitsInStockLbl.setText("Units In Stock");
    unitsInStockField.setEditable(false);
    unitPriceLbl.setText("Unit Price $");
    unitPriceField.setEditable(false);
    invenValueLbl.setText("Inventory Value $");
    invenValueField.setEditable(false);
    restockingFeeLbl.setText("5% Restocking Fee $");
    restockingFeeField.setEditable(false);
    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
    jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(jPanel1Layout.createSequentialGroup()
    .addContainerGap()
    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
    .addComponent(unitPriceLbl)
    .addComponent(unitsInStockLbl)
    .addComponent(colorLbl)
    .addComponent(prodNameLbl)
    .addComponent(IDNumberLbl)
    .addComponent(restockingFeeLbl)
    .addComponent(invenValueLbl))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
    .addComponent(IDNumberField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 176, Short.MAX_VALUE)
    .addComponent(prodNameField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 176, Short.MAX_VALUE)
    .addComponent(colorField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 176, Short.MAX_VALUE)
    .addComponent(unitsInStockField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 176, Short.MAX_VALUE)
    .addComponent(unitPriceField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 176, Short.MAX_VALUE)
    .addComponent(restockingFeeField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 176, Short.MAX_VALUE)
    .addComponent(invenValueField, javax.swing.GroupLayout.DEFAULT_SIZE, 176, Short.MAX_VALUE))
    .addContainerGap())
    jPanel1Layout.setVerticalGroup(
    jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(jPanel1Layout.createSequentialGroup()
    .addContainerGap()
    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(IDNumberLbl)
    .addComponent(IDNumberField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(prodNameLbl)
    .addComponent(prodNameField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(colorField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(colorLbl))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(unitsInStockField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(unitsInStockLbl))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(unitPriceField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(unitPriceLbl))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(restockingFeeField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(restockingFeeLbl))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 10, Short.MAX_VALUE)
    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(invenValueField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(invenValueLbl))
    .addContainerGap())
    jbtFirst.setText("First");
    jbtFirst.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jbtFirstActionPerformed(evt);
    jbtNext.setText("Next");
    jbtNext.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jbtNextActionPerformed(evt);
    jbtPrevious.setText("Previous");
    jbtPrevious.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jbtPreviousActionPerformed(evt);
    jbtLast.setText("Last");
    jbtLast.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jbtLastActionPerformed(evt);
    jbtAdd.setText("Add");
    jbtAdd.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jbtAddActionPerformed(evt);
    jbtDelete.setText("Delete");
    jbtModify.setText("Modify");
    jbtModify.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jbtModifyActionPerformed(evt);
    jbtSave.setText("Save");
    jbtSave.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jbtSaveActionPerformed(evt);
    jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Search by:"));
    searchIDNumLbl.setText("Item Number:");
    jbtSearch.setText("Search");
    searchResults.setFont(new java.awt.Font("Tahoma", 1, 12));
    javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(
    jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(jPanel2Layout.createSequentialGroup()
    .addContainerGap()
    .addComponent(searchIDNumLbl)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(jPanel2Layout.createSequentialGroup()
    .addGap(259, 259, 259)
    .addComponent(searchResults, javax.swing.GroupLayout.PREFERRED_SIZE, 213, javax.swing.GroupLayout.PREFERRED_SIZE))
    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
    .addComponent(jbtSearch, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(searchIDNumbField, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE)))
    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    jPanel2Layout.setVerticalGroup(
    jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(jPanel2Layout.createSequentialGroup()
    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(searchIDNumLbl)
    .addComponent(searchIDNumbField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(jPanel2Layout.createSequentialGroup()
    .addGap(32, 32, 32)
    .addComponent(searchResults, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE))
    .addGroup(jPanel2Layout.createSequentialGroup()
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addComponent(jbtSearch)))
    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    jbtExit.setText("Save and Exit");
    jbtExit.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jbtExitActionPerformed(evt);
    jbtExitwoSave.setText("Exit");
    jbtExitwoSave.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jbtExitwoSaveActionPerformed(evt);
    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addContainerGap()
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 248, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 44, Short.MAX_VALUE)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
    .addComponent(jbtExitwoSave, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .addComponent(jbtExit)))
    .addGroup(layout.createSequentialGroup()
    .addComponent(jbtFirst)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addComponent(jbtNext)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addComponent(jbtPrevious)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addComponent(jbtLast))
    .addGroup(layout.createSequentialGroup()
    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .addGap(12, 12, 12)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
    .addComponent(jbtAdd)
    .addComponent(jbtDelete)
    .addComponent(jbtModify)
    .addComponent(jbtSave))))
    .addContainerGap())
    layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jbtFirst, jbtLast, jbtNext, jbtPrevious});
    layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jbtAdd, jbtDelete, jbtModify, jbtSave});
    layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addGap(21, 21, 21)
    .addComponent(jbtAdd)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addComponent(jbtDelete)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addComponent(jbtModify)
    .addGap(39, 39, 39)
    .addComponent(jbtSave))
    .addGroup(layout.createSequentialGroup()
    .addContainerGap()
    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(jbtFirst)
    .addComponent(jbtNext)
    .addComponent(jbtPrevious)
    .addComponent(jbtLast))
    .addGap(15, 15, 15)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addGroup(layout.createSequentialGroup()
    .addComponent(jbtExit)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addComponent(jbtExitwoSave)))
    .addContainerGap())
    pack();
    }// </editor-fold>
    private void jbtExitwoSaveActionPerformed(java.awt.event.ActionEvent evt) {                                             
    System.exit(0);
    private void jbtSaveActionPerformed(java.awt.event.ActionEvent evt) {                                       
    String prodNameMod, colorMod;
    double unitsInStockMod, unitPriceMod;
    int idNumMod;
    idNumMod = Integer.parseInt(IDNumberField.getText());
    prodNameMod = prodNameField.getText();
    unitsInStockMod = Double.parseDouble(unitsInStockField.getText());
    unitPriceMod = Double.parseDouble(unitPriceField.getText());
    colorMod = colorField.getText();
    if(currentProductIndex == inventory.length) {
    inList.add(new InventoryPlusColor(idNumMod, prodNameMod,
    unitsInStockMod, unitPriceMod, colorMod));
    InventoryPlusColor[] inventory = (InventoryPlusColor[]) inList.toArray
    (new InventoryPlusColor[inList.size()]);
    } else {
    inventory[currentProductIndex].setIDNumber(idNumMod);
    inventory[currentProductIndex].setProdName(prodNameMod);
    inventory[currentProductIndex].setUnitsInStock(unitsInStockMod);
    inventory[currentProductIndex].setUnitPrice(unitPriceMod);
    inventory[currentProductIndex].setColor(colorMod);
    displayProduct(inventory[currentProductIndex]);
    private static void writeInventory(InventoryPlusColor i,
    DataOutputStream out) {
    try {
    out.writeInt(i.getIDNumber());
    out.writeUTF(i.getProdName());
    out.writeDouble(i.getUnitsInStock());
    out.writeDouble(i.getUnitPrice());
    out.writeUTF(i.getColor());
    } catch (IOException e) {
    JOptionPane.showMessageDialog(null, "I/O Exception writing data",
    "", JOptionPane.ERROR_MESSAGE);
    System.exit(0);
    } //end writeInventory()
    private static DataOutputStream openOutputStream(String name) {
    DataOutputStream out = null;
    try {
    File file = new File(name);
    out =
    new DataOutputStream(
    new BufferedOutputStream(
    new FileOutputStream(file)));
    } catch (IOException e) {
    JOptionPane.showMessageDialog(null, "I/O Error", "", JOptionPane.ERROR_MESSAGE);
    System.exit(0);
    return out;
    } // end openOutputStream()
    private static void closeFile(DataOutputStream out) {
    try {
    out.close();
    } catch (IOException e) {
    JOptionPane.showMessageDialog(null, "I/O Exception closing file",
    "", JOptionPane.ERROR_MESSAGE);
    System.exit(0);
    } // end closeFile()
    private static DataInputStream getStream(String name) {
    DataInputStream in = null;
    try {
    File file = new File(name);
    in = new DataInputStream(
    new BufferedInputStream(
    new FileInputStream(file)));
    } catch (FileNotFoundException e) {
    JOptionPane.showMessageDialog(null, "The file doesn't exist",
    "", JOptionPane.ERROR_MESSAGE);
    System.exit(0);
    } catch (IOException e) {
    JOptionPane.showMessageDialog(null, "I/O Error creating file",
    "", JOptionPane.ERROR_MESSAGE);
    System.exit(0);
    return in;
    private static void closeInputFile(DataInputStream in) {
    try {
    in.close();
    } catch (IOException e) {
    JOptionPane.showMessageDialog(null, "I/O Exception closing file",
    "", JOptionPane.ERROR_MESSAGE);
    System.exit(0);
    } // end closeInputFile()
    private double entireInventory() {
    // a temporary double variable that the method will return ...
    // after each product's inventory is added to it
    double entireInventory = 0;
    // loop to control number of products
    for (int index = 0; index < inventory.length; index++) {
    // add each inventory to the entire inventory
    entireInventory += inventory[index].setInventoryValue();
    } // end loop to control number of products
    return entireInventory;
    } // end method entireInventory
    private void jbtLastActionPerformed(java.awt.event.ActionEvent evt) {                                       
    currentProductIndex = inventory.length-1; // move to the last product
    // display the information for the last product
    displayProduct(inventory[currentProductIndex]);
    private void jbtPreviousActionPerformed(java.awt.event.ActionEvent evt) {                                           
    if (currentProductIndex != 0) // it's not the first product displayed
    currentProductIndex -- ; // move to the previous product (decrement the current index)
    } else // the first product is displayed
    currentProductIndex = inventory.length-1; // move to the last product
    // after the current product index is set, display the information for that product
    displayProduct(inventory[currentProductIndex]);
    private void jbtNextActionPerformed(java.awt.event.ActionEvent evt) {                                       
    if (currentProductIndex != inventory.length-1) // it's not the last product displayed
    currentProductIndex ++ ; // move to the next product (increment the current index)
    } else // the last product is displayed
    currentProductIndex = 0; // move to the first product
    // after the current product index is set, display the information for that product
    displayProduct(inventory[currentProductIndex]);
    private void jbtFirstActionPerformed(java.awt.event.ActionEvent evt) {                                        
    currentProductIndex = 0;
    // display the information for the first product
    displayProduct(inventory[currentProductIndex]);
    private void colorFieldActionPerformed(java.awt.event.ActionEvent evt) {                                          
    // TODO add your handling code here:
    private void jbtModifyActionPerformed(java.awt.event.ActionEvent evt) {                                         
    prodNameField.setEditable(true);
    prodNameField.setFocusable(true);
    unitsInStockField.setEditable(true);
    unitPriceField.setEditable(true);
    private void jbtAddActionPerformed(java.awt.event.ActionEvent evt) {                                      
    IDNumberField.setText("");
    IDNumberField.setEditable(true);
    prodNameField.setText("");
    prodNameField.setEditable(true);
    colorField.setText("");
    colorField.setEditable(true);
    unitsInStockField.setText("");
    unitsInStockField.setEditable(true);
    unitPriceField.setText("");
    unitPriceField.setEditable(true);
    restockingFeeField.setText("");
    invenValueField.setText("");
    currentProductIndex = inventory.length;
    private void jbtExitActionPerformed(java.awt.event.ActionEvent evt) {                                       
    DataOutputStream out = openOutputStream("inventory.dat");
    for (InventoryPlusColor i : inventory)
    writeInventory(i, out);
    closeFile(out);
    System.exit(0);
    private static InventoryPlusColor readProduct(DataInputStream in) {
    int idNum = 0;
    String prodName = "";
    double inStock = 0.0;
    double pric

    BalusC -- The line that gives me my NullPointerException is when I call the "DisplayProduct()" method. Its a dumb question, but with NetBeans how do I find out which reference could be null? I'm not very familiar with how NetBeans works with finding out how to debug. Any help you can give me would be greatly appreciated.The IDE is com-plete-ly irrelevant. It's all about the source code.
    Do you understand anyway when and why a NullPointerException is been thrown? It is a subclass of RuntimeException and those kind of exceptions are very trival and generally indicate an design/logic/thinking fault in your code.
    SomeObject someObject = null; // The someObject reference is null.
    someObject.doSomething(); // Invoking a reference which is null would throw NPE.

  • My iphone 4s no longer has any sound expect with headphones.

    My iphone 4s no longer has any sound expect with headphones. I have cleaned the head jack and dock connector, restarted, and reset the phone. This occurred after updating to ISO 6. What else can be done? Thanks!

    If you are near one, make a reservation at the Genius Bar at the Apple Store.

  • A problem with ArrayLists

    Hello
    I'm pretty new to Java, and sometimes all those objects, instances, classes, data types etc confuse me. I'm having some kind of a problem with ArrayLists (tried with vectors too, didn't work) . I'm writing a program which takes float numbers from user input and does stuff to them. No syntax error in my code, but I get a java.lang.ClassCastException when I run it.
    I insert stuff to the ArrayList like this:
    luku.add(new Float(syotettyLuku));no problem
    I'm trying to access information from the list like this inside a while loop
    float lukui = new Float((String)luku.get(i)) .floatValue();but the exception comes when the programme hits that line, no matter which value i has.
    Tried this too, said that types are incompatible:
    float lukui = ((float)luku.get(i)) .floatValue();What am I doing wrong? I couldn't find any good tutorials about using lists, so i'm really lost here.
    I'll post the whole code here, if it helps. Sorry about the Finnish variable and method names, but you get the idea :)
    package esa;
    import java.io.*;
    import java.util.*;
    public class Esa {
    static final int maxLukuja = 100;
    static BufferedReader syote = new BufferedReader(new InputStreamReader(System.in));
    static String rivi;
    static String lopetuskasky = "exit";
    static double keskiarvo;
    static ArrayList luku = new ArrayList();
    static int lukuja;
    static float summa = 0;
    // M��ritell��n pari metodia, joiden avulla voidaan tarkastaa onko tarkasteltava muuttuja liukuluku
    static Float formatFloat(String rivi) {
        if (rivi == null) {
            return null;
        try {
            return new Float(rivi);
        catch(NumberFormatException e) {
            return null;
    static boolean isFloat(String rivi) {
        return (formatFloat(rivi) != null);
    // Luetaan luvut k�ytt�j�lt� ja tallnnetaan ne luku-taulukkoon
    static void lueLuvut() throws IOException{
        int i = 0;
        float syotettyLuku;
        while(i < maxLukuja) {
            System.out.println("Anna luku kerrallaan ja paina enter. Kun halaut lopettaa, n�pp�ile exit");
            rivi = syote.readLine();
            boolean onkoLiukuluku = isFloat(rivi);
            if (onkoLiukuluku) {
                syotettyLuku = Float.parseFloat(rivi);
                if (syotettyLuku == 0) {
                    lukuja = luku.size();              
                    break;
                }  // if syotettyluku
                else {
                    luku.add(new Float(syotettyLuku));
                    i++;
                } // else
            } // if onkoLiukuluku
            else {
               System.out.println("Antamasi luku ei ole oikeaa muotoa, yrit� uudelleen.");
               System.out.println("");
            } // else
        } // while i < maxlukuja
    // lueLuvut
    static void laskeKeskiarvo() {
        int i = 0;
        while(i < lukuja) {
            float lukui = ((float)luku.get(i)) .floatValue();
            System.out.println(lukui);
            summa = summa + lukui;
        }   i++;
        keskiarvo = (summa / lukuja);
    } // laskeKeskiarvo
    public static void main(String args[]) throws IOException {
    lueLuvut();
    laskeKeskiarvo();
    } // main
    } // class

    Thanks! Now it's functioning.
    As I mentioned, I tried this:
    float lukui = ((float)luku.get(i))
    .floatValue();And your reply was:
    float lukui =
    ((Float)luku.get(i)).floatValue So the problem really was the spelling, it should
    have been Float with a capital F.
    From what I understand, Float refers to the Float
    class, Correct. And float refers to the float primitive type. Objects and primitives are not interchangeable. You need to take explicit steps to convert between them. Although, in 1.5/5.0, autoboxing/unboxing hide some of this for you.
    so why isn't just a regular float datatype
    doing the job here, like with the variable lukui?Not entirely sure what you're asking.
    Collections take objects, not primitives, and since you put an object in, you get an object out. You then have to take the extra step to get a primitive representation of that object. You can't just cast between objects and primitives.
    Again, autoboxing will relieve some of this drudgery. I haven't used it myself yet, so I can't comment on how good or bad it is.

  • Syntax error on token "Enum", Identifier expected

    Hello,
    We are using the LinkType class(com.sapportals.wcm.repository.enum.LinkType) but at the import statement we get an error message: Syntax error on token "Enum", Identifier expected
    Configuration:
    JDK version: jdk1.5.0_17
    NWDS 7.1 SP7 CE
    import com.sapportals.wcm.repository.enum.LinkType;
    Has anyone experienced the same issue and found a workaround or solution?
    Regards,
    Edwin.

    Thanks, but that is not the problem... Unfortunately.
    The class we needed (linkType) is found in the KM API for NWDS 04, but this KM API is not available anymore in NWDS 7.1...
    So we will have to redesign the application and re-do the developments...
    Regards,
    Edwin.

  • Error in compile smol program identifier expected

    I CAN'T Compile this code - the ansuer <identifier> expected
    the code
    // Exercicio - Ticker.java
    import java.applet.*;
    import java.awt.*;
    public class Ticker extends Applet implements Runnable {
    private volatile Thread tickerThread = null;
    String tickertext = "Exercicio - fita do registrador";
    int tickerSpeed = 1;
    String tickerFontName = "TimesRoman";
    int tickerFontSize = 12;
    Font tickerFont = null;
    String tickerDirection = "Left";
    Dimension tickerSize = null;
    int tickerTextWidth = 0;
    int tickerHeight = 0;
    int tickerPosition = -63000;
    public void init() {
    if (getParameter("tickerText") != null) {
    tickerText = getParameter("tickerText");
    if (getParameter("tickerSpeed") != null) {
    tickerSpeed = Integer.parseInt(getParameter("tickerSpeed"));
    if (getParameter("tickerFontName") != null) {
    tickerFontName = getParameter("tickerFontName");
    if (getParamenter("tickerFontSize") != null); {
    tickerFontSize = Integer.parseInt(getParameter("tickerFontSize"));
    tickerFont = new java.awt.Font(tickerFontName, Font.PLAIN, tickerFontSize);
    if (getParameter("tickerReverse") == null) {
    tickerDirection = "Left";
    tickerPosition = -63000;
    else {
    tickerDirection = "Right";
    tickerPosition = 63000;
    this.setBackground(Color.white);
    public void start() {
    if (tickerThread == null) {
    tickerThread = new Thread(this);
    tickerThread.start();
    public void stop() {
    tickerThread = null;
    public void run() {
    Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
    Thread thisThread = Thread.currentThread();
    while (thisThread == tickerThread) {
    try {
    Thread.sleep(10);
    catch (InterruptedException e) {}
    repaint();
    public void paint(Graphics ticker) {
    tickerSize = getSize();
         ticker.setFont(tickerFont);
         if (tickerTextHeight == 0) {
    tickerTextHeight = ticker.getFontMetrics().getHeight();
    if (tickerTextWidth == 0) {
         tickerTextWidth = ticker.getFontMetrics().stringWidth(tickerText);
    if (tickerDirection == "Left") {
    if (tickerPosition <= tickerTextWidth * -1) {
    tickerPosition = tickerSize.width ;
    else {
    tickerPosition = tickerPosition - tickerSpeed;
    else {
    if (tickerPosition > tickerTextWidth) {
    tickerPosition = 0 - tickerSize.width ;
         else {
                             tickerPosition = tickerPosition + tickerSpeed;
              ticker.setColor(Color.black);
              ticker.drawString(tickerText, tickerPosition, (tickerSize.height + tickerTextHeight) / 2);

    Hello,
    The last *}* is not placed on the correct line... It should be after the two last lines:
        ticker.setColor(Color.black);
        ticker.drawString(tickerText, tickerPosition,(tickerSize.height + tickerTextHeight) / 2);
    }since ticker is known only in paint meethod...
    By the way, using code tags makes things easier for us to help...
    Hope this helps

  • Unable to create timer - identifier expected? Why?

    Hi all,
    Given this code excerpt:
    private Timer mytimer;
    ActionListener taskPerformer = new ActionListener() {
    public void actionPerformed(ActionEvent evt) {
    //...Perform a task...
    mytimer = new javax.swing.Timer(progress_bar_refresh_delay,taskPerformer);
    Why does the compiler stop at the above line:
    TestFTPApplet.java:128: <identifier> expected
    mytimer = new javax.swing.Timer(2000,taskPerformer);
    ^
    1 error
    What identifier? What does it expect? I've tried everything I can think of but the compiler absolutely refuses to comple the above code. As far as I can determine, mytimer is not a reserved word or object reference - I've tried several different names but the compiler keeps stopping at the above line, saying <identifier> expected.
    The fact that an identifier is expected is non-sensical - what identifier? What am I doing wrong?
    -What- is expected? An Object reference? An abstract object?
    Thanks...

    What am I doing wrong?If that code appears outside of any method, no statements or expressions
    are allowed; just initializations and definitions, that's why the compiler
    is whining. Your code looks like this:T1 foo;
    T2 bar= <initialization>;
    foo= <some value>;You can't assign a value to a variable there. Either change it to this:T1 foo= <some value>;
    T2 bar= <initialization>;... or assign <some value> to foo in the constructor or another method.
    kind regards,
    Jos

  • Working with arraylists in JavaScript????

    I am getting a script error while trying to use an ArrayList inside a JavaScript method. How will i store the list???.My code is as follows :
    obj1[<c:out value="${count.count}"/>]=<c:out value="${formids.excludeList}"/>
    where 'excludeList' is an arrayList and it has the value [yellow,green] i am getting a JavaScript error that 'yellow' is undefined. I tried to declare obj1 as :-
    var obj1 = new Array(count); and var obj1 = new Object();
    still it was showing errors. I tried putting single values like integers into the array and it worked but not with arraylists. Can anyone pls help.

    Are yellow and green supposed to be string values in JS? If so, you will have to enclose them in quoted. Add a loop to fill in the JS array:
    var obj1 = new Array(count); //Can't be count or count.count  Must be the length of the List
    <c:forEach var="color" items="${formids.excludeList}" varStatus="innerCount">
      obj1[<cout value="${innerCount.count}"/>] = "<c:out value="<c:out value="${color}"/>";
    </c:forEach>

  • identifier expected error when trying to create a class instance?

    public static Time time;
    //Cannot find symbol package1.Controller - both have the same package statement.
    //When the 2nd line is included ony that is flagged as giving an error
    //Gives <identifier> expected
    public static Time time;
    time = new Time();
    //Simply typing:
    time = new Time();
    //does too
    The classes look like:
    package package1;
    public class Controller extends Applet
    public static Time time;
    time = new Time();
        public void init()
         this.setLayout(new FlowLayout());
         Panel panel = new Panel();
         add(Time.timeP);
        public void paint()
         //Some stuff here
    package package1;
    import java.awt.*;
    import java.io.*;
    public class Time extends Panel implements Runnable
        public static Panel timeP;
        public Time() {timeP = new Panel();}
         //Some other unrelated stuff here
    }

    Sorry, i forgot about that.
    public static Time time = new Time();/*Gives
    cannot find symbol
    symbol: class Time
    location class package1.Controller
    cannot find symbol
    symbol: class Time
    location class package1.Controller
    It looks like it's looking for the Time class in the Controller class?

  • I use two PC's on a daily basis, both using 3.6.7. One does everything I would expect with regard to history, the other consistently loses history data, with no real pattern as to what it keeps and what it doesn't. Tried adjusting custom settings but no

    I use two PC's on a daily basis, both using 3.6.7. One does everything I would expect with regard to history, the other consistently loses history data, with no real pattern as to what it keeps and what it doesn't. Tried adjusting custom settings but nothing works.

    oops! that should've been 3.6.8!

  • KDC identifying both with client authentication

    hi everybody
    i am using a client authentication certificate template's ,
    and i also want to use a KDC identifying both with client authentication
    looking for this configure specified
    thank you
    Marv Kikovanovich

    Hey Marv
    Thanks for posting ,
    You've need to add another Application Policy: "KDC Authentication" on client
    certificate template.
    Certification Authority\Certificate Templates\Manage
    properties the client certificate template - extensions TAB
    Edit Application Polices , and Add the "KDC Authentication" Policy.
    Good Luck.
    I'd be glad to answer any question

  • DB identifier mismatch with data volujme and log volume

    Hi,
             I would like to perform backup and restore test on linux (maxdb database )  ECC 6.0 system.
    I have taken the backup of (i.e  data , incremental and log backups ) on one system.
    Then created a new system with same host name, SID and instance number.
    Then i Performed to restore the database on the new system in the ADMIN mode.
    First i done the data then incremental backup. These are successful on the new system.
    But when i performed the log backup  it gives the following error as :
    Db identifier mismatches with data volume and log volume.
    Database then goes to offline state.
    How to perform the successful log backup ?
    Thanks
    Srikanth

    Hi,
    As you are performing restore on the new machine  you have to restore with recovery with initialization option.
    for this you have to first  create template on the new machine using DBMGUI or DBMCLI for  complete_bkp/incremental_bkp and log_bkp's.
    It will first restore complete backup after that incremental backup and after that all the available log backups will be applied.After that you will be able to make in online mode.
    You can perform this either using dbmgui or dbmcli.
    http://help.sap.com/saphelp_nw04/helpdata/en/d1/b386654dc211d4aa1100a0c9430730/frameset.htm
    Regards,
    Sahil

  • Identifier expected error......plzz help

    it is showing the error ....identifier expected where i am declaring the variables JTextArea and JButton....
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import javax.swing.*;
    import javax.swing.filechooser.*;
    import javax.swing.SwingUtilities.*;
    //import javax.swing.JEditorPane;
    import java.net.URL;
    public class tm extends JPanel implements ActionListener
         public static void main(String args[]) throws Exception
         JTextArea = program, input, state;
         JButton = loadp, run, step,loadi;
         public tm()
              JPanel c = new JPanel();
              c.setLayout(new GridLayout(1,1));
              loadi = new JButton("LOAD INPUT STRING");
              contentPane.add(loadi);
              loadi.addActionListener(this);
              loadp = new JButton("LOAD PROGRAM");
              contentPane.add(loadp);
              loadp.addActionListener(this);
              run = new JButton("RUN");
              contentPane.add(run);
              run.addActionListener(this);
              step = new JButton("STEP");
              contentPane.add(step);
              step.addActionListener(this);
              program=new JTextArea("");
              program.setBounds(100,400,100,400);
              input=new JTextArea("");
              input.setBounds(300,400,200,50);
              state=new JTextArea("");
              state.setBounds(700,400,100,50);
         public void actionPerformed(ActionEvent e)
           try{
             if(e.getSource()==loadp)
                  JFileChooser chooser=new JFileChooser();
                   int r= chooser.showOpenDialog(this);
                   if(r==JFileChooser.APPROVE_OPTION)
                        String name=chooser.getSelectedFile().getName();
                        File f=chooser.getSelectedFile();
                        FileInputStream filestream = new FileInputStream(f); 
                        BufferedInputStream bufferstream = new BufferedInputStream(filestream); 
                        DataInputStream datastream = new DataInputStream(bufferstream); 
                        String record = null;
                        tapep.setText("");
                        try { 
                               while ( (record=datastream.readLine()) != null )
                                  program.append(record);                         
                            catch (Exception p)
                              System.out.println(p);                      
              else if(e.getSource()==run)
              else if(e.getSource()==step)
              else if(e.getSource()==loadi)
           catch(Exception t)
                System.out.println(t);
    }

         public static void main(String args[]) throws Exception
         JTextArea = program, input, state;
         JButton = loadp, run, step,loadi;That's not valid Java syntax.
    The Java? Tutorial - Trail: Learning the Java Language
    ~

  • Identifiers expected?

    This is an inner class inside an outer class, inside the main method. I have tried using final in front of the int k and int l, and also static, but still i get the same two errors, that identifiers are expected. Why is that?
         public static void main (String args[])
              int k = 10;
              int l = 25;
              class Inner
                   int d = 3;
                   final int e = 15;
                   private int h = 25;
                   System.out.println ("k " + k); //identifier expected
                   System.out.println ("l " + l); //identifier expected
                   public void print()
                        outer o = new outer();
                        System.out.println ("a " + o.a);
                        System.out.println ("b " + b);
                        System.out.println ("c " + o.c);
                        System.out.println ("g " + o.g);
              }

    To bring it to the point - k and l are not accessible
    from the inner class because they belong to the
    main-method and not to the class, they are accessible
    by the main-method only - is that right? - Guess, IIt depends on the modifier: if the variable is marked as final than it is visible to the inner class of that method, but if the variable is not marked as final than the inner class cannot access it. But this only applies to classes inside methods.
    Static inner classes, like static methods can only access static variables in the outer class. They behave just like static methods. The reason is that in a static inner class there is no built in reference to this, so the inner class cannot access member variables. And you cannot have static inner classes inside methods. A static inner class is just like a top class and this mechanism provides an alternative to packaging.

Maybe you are looking for

  • Follow up on iwork09 question

    Thanks to all the folks that responded to my "rant". A phone all to Apple ended any confusion. I found the invoice, got the key, and then entered a "5" instead of an "S". I was impressed with phone help that I received, it was fast, accurate and solv

  • Sitewide constants / variables

    Can I somehow define constants like SiteName = "Company XYZ" and then put in page titles expressions like SiteName + " - Welcome" - or - SiteName + " - Pricelist" etc? It seems strange to me that such a mighty tool like Dreamweaver would force design

  • Charset problems using SQLLDR

    Hello! My task is to import data from a Microsoft Access Database into an Oracle Database. I got a Script which creates Flatfiles and Controlfiles with the data from Access. My problem is the characterset. There are some signs (e.g. the typical germa

  • How to escape Elements 9 limbo? Can you answer 3 questions?

    I'm new to PSE 9. Tried to figure it out on my own. Now I'm stuck: When I save work, a PSE icon replaces the photos in my Windows Photo Gallery, the source location of the pix. How do I avoid that? I want my original photos unedited in Photo Gallery.

  • I got my CS6 serial key, but suddenly it is invalid. Please help.

    I got my CS6 Design and Web Premium Edu serial key. When I try to use it to install another components from disc, it said can't verify the key. The key is authenticated which is already registered in my adobe account. Please help.