i tried to write my program in different ways but i couldnt figure it out .. the program execute only the code under else even even if the condition is verified can anyone help me please thanks
here is my code :
table.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
int row = table.getSelectedRow();
int col = table.getSelectedColumn();
String path=table.getValueAt(row, col).toString();
String equipementMOID=txt.getText();
if(table.isColumnSelected(4) ){
if(table.getValueAt(row, 3).toString()=="UNIT" ){
String equipementDate2=comboBox_10.getSelectedItem().toString();
String xmlFile2=con.XMLSelection(equipementDate2);
GetNode ne=new GetNode();
try{
String equipementXml2=ne.nodeToString(xmlFile2, equipementMOID);
System.out.println(equipementXml2);
//GetNodeByPath node=new GetNodeByPath(equipementXml2,path);
}
catch (SAXException | IOException | ParserConfigurationException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
else{
String equipementDate1=comboBox_9.getSelectedItem().toString();
String xmlFile1=con.XMLSelection(equipementDate1);
GetNode ne=new GetNode();
try{
String equipementXml1=ne.nodeToString(xmlFile1, equipementMOID);
GetNodeByPath node=new GetNodeByPath(equipementXml1,path);
}
catch (SAXException | IOException | ParserConfigurationException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
}
});