Solved

pop up textfield/area in java swing

Posted on 2010-11-08
7
448 Views
Last Modified: 2012-05-10
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.
0
Comment
Question by:hipal
  • 4
  • 3
7 Comments
 
LVL 26

Expert Comment

by:ksivananth
ID: 34090671
you may want to add them into a JWindow and show/hide as popup!
0
 

Author Comment

by:hipal
ID: 34090698
Thanks for reply.

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

Author Comment

by:hipal
ID: 34090712
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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 26

Accepted Solution

by:
ksivananth earned 500 total points
ID: 34090719
you can just re-use them, if creating everytime is expensive, just make visible true/false!
0
 

Author Comment

by:hipal
ID: 34090739
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
 
LVL 26

Expert Comment

by:ksivananth
ID: 34090780
yes, it needs lots of code, you need to get the click location and place the window in that location!
0
 
LVL 26

Expert Comment

by:ksivananth
ID: 34090814
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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
This is about my first experience with programming Arduino.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn how to implement Singleton Design Pattern in Java.

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question