I'm having difficulty in getting resources that will help me with an issue. I want to add a button that will let me insert text anywhere in my JFrame
so I can click and add a text
Before that, I have been using JTextField
and JTextArea
, but these are useful in a predefined space (I believe).
What I want is like the classic Add Text button in Paint ("A" button) in which when you click on it, you will have the text cursor (like an "I") and then click somewhere in the frame so I can actually add text in that area. Which I call "adding text dynamically". Unfortunately I don't have any code to show because I'm not sure how to build the code from scratch or maybe use a method in Swing, but I'm more than keen to explain better if this is too generic for you guys.