I made a JComboBox and filled it using data from a table.  Simply put this
is what's happening.

@entity class {
  Integer id;
  String name;
 getId(); //return Integer
 getName(); //return String
}

JComboBox cb = (JComboBox) evt.getSource();
myObject newItem = (myObject)cb.getSelectedItem();

String aString = newItem.getName(); //no error
Integer aNum = newItem.getId(); // null pointer exception

I'm using JPA and I have issue getting the String back but when I try to
assign the getId method to an integer I get a null pointer exception.

is this common problem?

-- 
You received this message because you are subscribed to the Google
Groups "Java EE (J2EE) Programming with Passion!" group.
To post to this group, send email to
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en

Reply via email to