Avatar of hipal
hipal
Flag for United States of America asked on

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.
ProgrammingJava

Avatar of undefined
Last Comment
ksivananth

8/22/2022 - Mon
ksivananth

you may want to add them into a JWindow and show/hide as popup!
hipal

ASKER
Thanks for reply.

Can you please please give a small code snippet doing that ?
hipal

ASKER
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 ??
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
ASKER CERTIFIED SOLUTION
ksivananth

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
hipal

ASKER
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. :(
ksivananth

yes, it needs lots of code, you need to get the click location and place the window in that location!
ksivananth

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
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.