Internal padding for JTextArea with background Image

前端 未结 4 1873
既然无缘
既然无缘 2020-11-27 20:37

My ultimate goal is to have a JTextArea with a background image. I found code online that showed me how to do this, but now I\'m having an issue with the text b

4条回答
  •  伪装坚强ぢ
    2020-11-27 21:22

    To post code, indent every line by four spaces.

    I assume you are overriding paintComponent()* for your JTextArea. If you are, make sure that it is transparent by adding

    setOpaque(false);
    

    *This also works if you override paint(), but as trashgod correctly states, that would interfere with paintBorder().

提交回复
热议问题