• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Tab keyboard to move from one textarea to another textarea ?

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, as the subject states, it is about how to make the tab in our keyboard take the focus from one textarea to the next textarea.
I have found some code across the Internet, although it does not work because there is no clsTabOrder class in my function.
This is the code

Maybe somebody could tell me what is this clsTabOrder, or have another alternative for this problem.
Thank You.
 
Marshal
Posts: 80138
418
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to the GUIs forum.

Please write yourself an SSCCE, so you can simply try out focus with the tab key. I shall try one for myself; please watch this space.
 
Lando Chan
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I dont quite understand why you give me sscce. I guess my description is unclear so let me describe it one more.

It is not exactly a problem.
Just imagine you want to login your facebook account, first you insert the email textfield and press tab button to move to the password textfield. I want to know if I can apply that to my program.

For your information, I have two JTextArea and I want that when I press tab it moves to the next JTextArea

Thanks
 
Campbell Ritchie
Marshal
Posts: 80138
418
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please go to the Java™ Tutorials and use ctrl‑;f‑Éc;focus”. I got two hits, which I think will be useful to you.

I couildn't get my SSCCE to work; I am sure somebody else will know more than me.
 
Lando Chan
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found out a useful site which explains about this focus
From reading this "Tab shifts the focus in the forward direction. Shift-Tab moves the focus in the backward direction. For example, in FocusConceptsDemo, the first button has the initial focus. Tabbing moves the focus through the buttons into the text area. Additional tabbing moves the cursor within the text area but not out of the text area because, inside a text area, Tab is not a focus traversal key. However, Control-Tab moves the focus out of the text area and into the first text field. Likewise, Control-Shift-Tab moves the focus out of the text area and into the previous component. The Control key is used by convention to move the focus out of any component that treats Tab in a special way, such as JTable."

I got the feeling that it is not possible to solve my problem
FocusConceptsDemo.png
[Thumbnail for FocusConceptsDemo.png]
FocusConceptDemo
 
Rancher
Posts: 3324
32
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here are 4 approaches:
 
Lando Chan
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot, it is a great explanation.
 
crispy bacon. crispy tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic