pop up textfield/area in java swing

when I am using JTextField or JTextArea .. I am albe to add them in my panel.

But I want them to appear as pop up or may be there is some other component which can act as popup text field ?

Please suggest.
hipalAsked:
Who is Participating?
 
ksivananthConnect With a Mentor Commented:
you can just re-use them, if creating everytime is expensive, just make visible true/false!
0
 
ksivananthCommented:
you may want to add them into a JWindow and show/hide as popup!
0
 
hipalAuthor Commented:
Thanks for reply.

Can you please please give a small code snippet doing that ?
0
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
hipalAuthor Commented:
Moreover doing it this way .. I guess I will have to create a separate new JWindow everytime I want a popup with text field. or else I will have to add/remove JTextFields everytime ??
0
 
hipalAuthor Commented:
But this is really strange that there is no in built pop up with text field. As it is used pretty frequently.

Moreover I want to add functionalities like .. popping it up next to pressed button.

And depending on which button is pressed I want to save text entered at different places. All this will require additional  code. :(
0
 
ksivananthCommented:
yes, it needs lots of code, you need to get the click location and place the window in that location!
0
 
ksivananthCommented:
you may follow this idea as well, no need to worry about the location, http://www.coderanch.com/t/341327/GUI/java/custom-popup-panel-display-hide
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.