Win a copy of Clojure in Action this week in the Clojure forum!
    Bookmark Topic Watch Topic
  • New Topic

Populate the 'current' JTextField via a button/label

 
Lee Quinlan
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
This is my first post.! I'm hoping it's clear and concise enough for constructive replies !
I'm working on a very simple app for my PPC, trying to make best use of screen real estate and simplify text entry.
The application has a simple form with numerous text fields and I'd like to be able to click a button/label titled 'N/A' to populate the textfield that currently has focus with the same value ('N/A').
In other words, I want to click in the text field I want to popluate with N/A and instead of using the SIP keyboard and typing 'N/A' every time, I want to use a single '"N/A' button/label for any field.
I'm trying to write efficient code and so trying to avoid multiple buttons that just populate their neighboring textfield.
I've done plenty of goolge'ing before making this post but couldn't find anything that fit my scenario.
I get the feeling I should be capturing focus events, determining the component name that triggered the event and then '.setText'ing that component.
Easier said than done for me at my level though
Any help greatly appreciated.
 
Lee Quinlan
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
Apologies. I figured this post was best placed in the Beginning Java forum.
Posted in 'Beginning Java' instead
 
Rob Spoor
Sheriff
Pie
Posts: 20380
46
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
Let's close this one and move the other thread here.
 
I agree. Here's the link: http://aspose.com/file-tools
    Bookmark Topic Watch Topic
  • New Topic