• 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:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Weird tabstop behavior with a hidden control

 
Ranch Hand
Posts: 167
1
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a button that I use to delete records from a tableview. When a record is selected in the view, then that delete button becomes visible, and when no record is selected, that button is hidden (visible property set to false).

What is weird, is that when I am tabbing controls on the form, that button will get a tabstop landing and become visible while it has focus.

I tried to find a way to exclude the button from having any tabindex, but I can't seem to find a way to do that ... and perhaps my approach to the problem is wrong in the first place.

SO, does anyone know how I can make sure that this non-visible button does not get focus during the activity of tabbing between controls on my form, or perhaps some way to make it invisible with enough certainty that it becomes overlooked when tabbing around the form?

Thank you,

Mike
 
Sheriff
Posts: 7108
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try setting the focusTraversable property to false.

https://openjfx.io/javadoc/11/javafx.graphics/javafx/scene/Node.html#setFocusTraversable(boolean)
 
Michael D Sims
Ranch Hand
Posts: 167
1
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Knute Snortum wrote:Try setting the focusTraversable property to false.

https://openjfx.io/javadoc/11/javafx.graphics/javafx/scene/Node.html#setFocusTraversable(boolean)



Yeah, I tried that ... I posted my project to github ... if you have a working MySQL server that you have create schema privilege on, the readme explains everything you need to re-create the problem... basically you just put in the MySQL username and password then run the project ... pick a recipe and start tabbing around and you'll see the button show up then disappear when you tab off of it.

Here is the git repository

Thank you very much,

Mike
 
    Bookmark Topic Watch Topic
  • New Topic