This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

textfield and listener  RSS feed

 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi.. am now preparing a new project.. i need to display Table when mouse button s pressed in a Text Field.. can anyone help me what type of listener we can use for that...thank you
 
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ambika,

Welcome to Java Ranch. I am unable to recollect it very soon. But it would be an ActionListener. I guess other Ranchers would be helping you out.
 
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ambika Nagalakshmi wrote:.. when mouse button s pressed in a Text Field..


What you need is a mouse listener.
What Raghavan said is not quite correct. The action listener will be fired only if the text field has focus and the user hits the enter/return key.
 
Raghavan Muthu
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Maneesh Godbole wrote:

Ambika Nagalakshmi wrote:.. when mouse button s pressed in a Text Field..


What you need is a mouse listener.
What Raghavan said is not quite correct. The action listener will be fired only if the text field has focus and the user hits the enter/return key.



Thanks Maneesh. yes, thats what I said I was unable to get it immediately. (Its been a long duration I worked with Swings/Applets).

Indeed it would be a MouseListener.
 
Maya Naga
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Maneesh Godbole wrote:

Ambika Nagalakshmi wrote:.. when mouse button s pressed in a Text Field..


What you need is a mouse listener.
What Raghavan said is not quite correct. The action listener will be fired only if the text field has focus and the user hits the enter/return key.




then i have to mouse listener... but if i want to display table when i point over the text field means what to do?
 
Maya Naga
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i need reply soon ya.. help..
 
Raghavan Muthu
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ideally speaking you should have the table as one of the components in your page/application. Upon clicking by mouse you should be updating the model (data) of the table so that it will display the contents. Swing is based on MVC (Model View Controller) Pattern.

You can spend sometime in reading the tutorial here : http://java.sun.com/docs/books/tutorial/uiswing/components/table.html. It should help you to get through!
 
Raghavan Muthu
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ambika Nagalakshmi wrote:i need reply soon ya.. help..



Hi Ambika,

The Java Ranch is said to be one of the friendly forums. It indeed exists to "help" the people but not upto the urgency of the seeker. As you know, individuals are taking their time out to help the members we can NOT really force any one to help us. It is one of the mandatory rules in the forum.

Please read this rule : PatienceIsAVirtue

As I have mentioned in the earlier post, please read out the tutorials in the sun's website. Google for the same. You might get the result by the time people see it and reply for your query Good luck!
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ambika Nagalakshmi wrote:
then i have to mouse listener... but if i want to display table when i point over the text field means what to do?



Recommended reading http://java.sun.com/docs/books/tutorial/uiswing/events/mouselistener.html
http://faq.javaranch.com/java/EaseUp
http://faq.javaranch.com/java/PatienceIsAVirtue
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ambika Nagalakshmi wrote:i need reply soon ya.. help..


http://faq.javaranch.com/java/UseRealWords
"Ya" is not a valid English word.
 
Maya Naga
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok.. thanks. it worked.
 
Maya Naga
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


hi here is my code.
when i run this am getting table frame alone. but the value inside the table is not executing. where i need to change??
thanks
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ambika,
In future, while posting code, please use code tags
http://faq.javaranch.com/java/UseCodeTags
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Maneesh Godbole wrote:Ambika,
In future, while posting code, please use code tags
http://faq.javaranch.com/java/UseCodeTags



Check the following code
 
Maya Naga
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi thanks.. that worked..
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!