Make parts of a JTextArea non editable (not the whole JTextArea!)

前端 未结 5 1627
甜味超标
甜味超标 2020-12-16 18:42

I\'m currently working on a console window in Swing. It\'s based on a JTextArea and works like a common command line. You type a command in one line and press enter. In the

5条回答
  •  清酒与你
    2020-12-16 19:29

    AFAIK, you need to implement your own control

    Maybe you could simulate it with a list of textfields(even enabled and odd disabled) or a mix of textfields/labels

    EDIT:

    I would bet for a non-editable textarea and an editable textfield. Type in textfield, press enter, add "command" and output to the textarea

提交回复
热议问题