Java JTextArea Line Numbers

非 Y 不嫁゛ 提交于 2019-12-06 07:34:22

Have you tried putting both text fields in the viewPort? Maybe on a panel that gives the line numbers a fraction of the available width?

The compenent used to display the line numbers can be added using:

scrollPane.setRowHeaderView(...);

Another option is to use a JTable to display both columns. Using two text areas is really not the best solution.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!