want to draw text over image. on first mouse click a rectangle region show, as soon as enter text, text should be drawn with in rectangle shap and rectangle should be auto resize with text as displayed in attached image.

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The basic concept is like any normal Swing form. You just need to add a little extra work to pull it all together.
The first thing you need to decide is do you want multi line support or not?
The example below simple uses a
JLayeredPane, to supply the free layout, and a customJTextAreato supply the editable fields.The neat thing about this, is the resizing is mostly taken care for you, as is the “re-editability”, simply click back on the text and you’ll see what I mean.
I’ll leave repositioning up to you 😉