I have a code that generates tag by pressing button ...like you type some random word then it generates a list of tags, here's the code
JButton tagGen = new JButton("GENERATE");
tagGen.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String copyTag;
String title = textField.getText();
String[] keywords = {"Google", "Yahoo", "Bing", "DuckDuckGo"};
for(int i=0; i<keywords.length; i++) {
copyTag = (title.replaceAll("Search Engine|search |is |Is","")
+ keywords[i]+", ");
textTag.setText(copyTag);
}
}
So the problem is i'm not getting the full tags like this...
random text Google, random text Yahoo, random text Bing, random text DuckDuckGo,
instead getting the only last tag...
random text DuckDuckGo,
what i'm doing wrong? i'm using setText method but still it's not printing full text
i tried to search the fix of this problem but couldn't find any solution