• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JTable tabbing

 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I want to make my main GUI so that it is navigable without the mouse. This means I want to be able to tab across each component on the screen.

However when the JTable component is selected the TAB key causes each individual cell to be selected and then it moves to the next row. When it reaches the last row, it moves back to the top.

Does anyone know how I can override the behaviour so that the TAB key causes the JTable to lose focus and the next component gets focus?

David
 
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi David,

Your goal sounds pretty good.

But if I were you, I would drop that feature, since


  • the feature is not requested by my assignment
  • more code that might contain a bug
  • more code to document
  •  
    Ranch Hand
    Posts: 75
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I completely agree with lucy. Like in the real life, and a bit more for the Developer certification always use the KISS rule I try to use it as much as I can

    cheers

    P.S.
    KISS = Keep It Simple Stupid
     
    David A. Scott
    Ranch Hand
    Posts: 55
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I think an important feature of good GUI design is that you should be able to navigate it without having to remove your hands from the keyboard.

    GUIs which require a bit of typing...followed by mouse click...followed by a bit more typing...followed by a mouse click etc etc... drive me nuts!

    I do accept what you are saying about keeping it simple, and I'm adhering to this philosophy in most other respects!!
     
    Lucy Hummel
    Ranch Hand
    Posts: 232
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi David,

    I totally agree that a GUI should be useable without a mouse and I provide some shortcuts and menubars to reach that goal.

    I know I did not reach this goal fully.
     
    Ranch Hand
    Posts: 286
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hello,
    My GUI is fully usable only with the keyboard...I'm too lazy so I hate moving to much ( i m a sporting personn, so every movement as to be necessery lool )...every action as a key combo
    Arno
     
    Ranch Hand
    Posts: 92
    Android Eclipse IDE Suse
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi,

    What if the assesor's computer doesn't have attached a mouse?
    I tried to make my GUI usable only with the keyboard, and I have the same problem, when the focus is captured by my table it doesn't let it go.
    Maybe some answers would be in the Swing area of this forum, but I didn't have the time to check yet, so I was looking with interest this thread.
    Hope somebody will find an answer...
     
    Lucy Hummel
    Ranch Hand
    Posts: 232
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi Romeo,

    In my opinion:
    If there is a GUI, there is a mouse! Or you have a touch screen.
     
    Arno Reper
    Ranch Hand
    Posts: 286
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hello,
    For me it works fine without a mouse...
    You can use tab and mnemonic keys. When you are blocked into the JTable you press "alt+[CHOICE]" and you jump to this component. I did it for the text fields, the buttons, the menus, ...

    @Lucy
    Because its java, I prefered to be sure that my prog could run on the most platform. Even those without a mouse...if I had more time I would do a CLI but its not asked. ( I work under Linux and Mac )
    But I think every approach is right...if you can justify it.

    Do you have news about your submission?
    Arno
     
    Lucy Hummel
    Ranch Hand
    Posts: 232
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi,

    You make me worring so I just add in my assumptions that the architecture assumes that the user has a mouse. Anyway, I also have some mnemonic keys, since I am a fan of vi.

    @Arno
    My submission state... My goal was to upload it today. But my familiy ... I want to get rid of it
     
    Romeo Son
    Ranch Hand
    Posts: 92
    Android Eclipse IDE Suse
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thanks all for the replies.
     
    Arno Reper
    Ranch Hand
    Posts: 286
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    A fan of vi woaawww
    Good luck with your family

    Arno
     
    Greenhorn
    Posts: 1
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    hi -

    tabbing inside the jtable will let you move in the table.

    if you want to focus the next focusable component you use Ctrl+Tab key combination. i think that's the default behaviour and shouldn't be changed.

    what do you think?

    thank you.
     
    David A. Scott
    Ranch Hand
    Posts: 55
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    In my application the JTable is only used to present the data and then select a record. There is no real need to TAB between the columns.

    So I'd like to use the TAB key to move onto the next component. I think this would be consistent with most professionally produced gui's.
     
    reply
      Bookmark Topic Watch Topic
    • New Topic