java - How to add an editable text box in JPanel -


I want to add a text box to a JPNL. This text box will be something similar to Microsoft PowerPoint: One is that you can resize, move around, etc. I have looked at the JTextField but I do not think I need it because I do not a popup box like this:

Enter Image Here Details

I have a program that allows users to add shapes, resize and move allows for. Now I want to be able to put a text box in these sizes. Here's an example of what I'm looking for:

Enter image details here < / P>

Can I do this anyway? Thank you.

Looks for class resizing. Here is an example for the recombine JTextArea:

  public static zero main (string [] args) {EventQueue.invokeLater {newOnRunball} {@Override Public Zero () {buildGUI ( );}}); } Private static zero buildGUI () {JFrame f = new JFrame ("Test"); F.setDefaultCloseOperation (WindowConstants.EXIT_ON_CLOSE); Component Receptor = New Component Ridge: (); Jepinal mainpanel = new zpn (null); F.add (mainPanel); JTextArea textArea = new JTextArea ("some text \ n some other text"); Cr.registerComponent (text field); MainPanel.add (text field); TextAresetBound (50, 50, 150, 150); F.setSize (400, 400); F.setLocationRelativeTo (zero); F.setVisible (true); }  

If you also want to transfer JTextArea, you can use it in addition to this and add the following code:

  ComponentMover cm = New ComponentMover (); Cm.registerComponent (text field); Cm.setDragInsets (cr.getDragInsets ());  

Comments