Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
谁能知道如何在选择文本时显示虚线以便用户可以拖动该文本?
您可以像这里描述的那样添加亮点http://java-sl.com/tip_vertical_selection.html并定义自己的HighLightPainter。在画家BasicStroke中定义虚线并将drawRect与描边线一起使用。
HighLightPainter
BasicStroke