问题
I am trying to make a program that requires a couple of custom JTextComponents. For example I need something that acts like a small JTextArea with a different border (not a rectangular one), and some more rules about how to layout the text, characters per lines, max lines aloud, and formatting to fit into the non rectangular border. How do I properly extend JTextComponent so that people will be able to edit the text inside this the component?
来源:https://stackoverflow.com/questions/27334155/how-to-make-a-custom-jtextcomponent