自动换行的draw2d标签

Draw2D里的Label不支持自动换行,虽然可以插入换行符手动换行。用TextFlow和适当的Layout可以实现文字的自动换行。以下代码由sean朋友贡献,原文链接

class LabelEx extends FlowPage {

    private TextFlow contents;

    public LabelEx() {
        this("");
    }

    public LabelEx(String text) {
        contents = new TextFlow();
        contents.setLayoutManager(new ParagraphTextLayout(contents, ParagraphTextLayout.WORD_WRAP_SOFT));
        contents.setText(text);
        add(contents);
    }

    public void setText(String text) {
        contents.setText(text);
    }

    public String getText() {
        return contents.getText();
    }
}

169 thoughts on “自动换行的draw2d标签

  1. Pingback: watch online TV LIVE
  2. Pingback: Film 2021
  3. Pingback: Film 2020
  4. Pingback: Film
  5. Pingback: Watch Movies Online
  6. Pingback: boys braces dark red
  7. Pingback: 1plus1
  8. Pingback: #1plus1
  9. Pingback: 1plus1serial.site
  10. Pingback: tvrv.ru
  11. Pingback: sweaters dames sale
  12. Pingback: Watch+movies+2020
  13. Pingback: Dailymotion
  14. Pingback: serial 2020
  15. Pingback: Dollface-Season-1
  16. Pingback: Evil-Season-4
  17. Pingback: Evil-Season-3
  18. Pingback: Evil-Season-2
  19. Pingback: Evil-Season-1
  20. Pingback: See-Season-1
  21. Pingback: 4serial.com
  22. Pingback: nike red golf hat
  23. Pingback: alimento de soja
  24. Pingback: viagramdtrustser.com
  25. Pingback: hqcialismht.com
  26. Pingback: bolsos gucci de mano
  27. Pingback: topedstoreusa.com
  28. Pingback: 1 seriya
  29. Pingback: bofilm
  30. Pingback: womens zero essential
  31. Pingback: trustedmdstorefy.com
  32. Pingback: LostFilm HD 720
  33. Pingback: kinosmotretonline
  34. Pingback: HDrezka
  35. Pingback: movies hdrezka
  36. Pingback: dorama hdrezka
  37. Pingback: youtube2019.ru
  38. Pingback: cerialest.ru
  39. Pingback: serial
  40. Pingback: filmy-2019-kinokrad
  41. Pingback: kinokrad-2019
  42. Pingback: filmy-kinokrad
  43. Pingback: Kinokrad
  44. Pingback: Watch TV Shows

发表评论