Problems with JBLabel.setText(text) after updating to 2019.2
When i'm creating JBLabel by constructor
new JBLabel (text)
all works fine. But when i am changing text in label by
JBLabel.setText (text)
it stops to work. Lable just didnt shown . Problems begins after updating idea to 2019.2. When i am trying to build plugin on 2019.1 - all work fine.
请先登录再写评论。
From where do you update setText()? Is it called in EDT?
Yes, it is EDT thread.
may be this code will help
private JBLabel createLink(String linkText, String linkHref) {
JBLabel label = new JBLabel();
label.setCopyable(true);
updateLink(label, linkText, linkHref);
return label;
}
private void updateLink(JBLabel linkLabel, String linkText, String linkHref) {
linkLabel.setText(String.format("<html><a href=\"%s\">%s</a></html>", linkHref, linkText));
}
Cannot find a bug, specified code snippet works for me. Please check if linkText and linkHref don't contain tags or any special symbols,