Displaying error message if no text found
I made a GUI that searches text in a JTextArea, but I want it to display an error message if there is no text in the search JTextField and the Target JTextArea... I figured my current code would have worked, but I guess not...
Any help will be much appreciated.
if(jtaTarget.getText() == "")
JOptionPane.showMessageDialog(null, "Target TextArea is empty");
else if(jtfSearch.getText() == "")
JOptionPane.showMessageDialog(null, "Search TextField is empty");