Skip to content

Workaround to JFX21 bug causing transparent labels#3892

Closed
rjwills28 wants to merge 1 commit into
ControlSystemStudio:masterfrom
rjwills28:fix_jfx21_transparent_labels
Closed

Workaround to JFX21 bug causing transparent labels#3892
rjwills28 wants to merge 1 commit into
ControlSystemStudio:masterfrom
rjwills28:fix_jfx21_transparent_labels

Conversation

@rjwills28

Copy link
Copy Markdown
Contributor

See description and discussion of bug here: #3891.

Bug in JFX21 means that setting the foreground color of the label widget using the setter fails and the label is rendered transparent.

JFX21 bug: https://bugs.openjdk.org/browse/JDK-8336097

This bug has been fixed in JFX24.

The workaround is to set the style using inline CSS.

Once we have moved to JFX25 this workaround should be removed - I have added a TODO for this in the code.

Checklist

  • Testing:

    • The feature has automated tests
    • Tests were run
    • If not, explain how you tested your changes
  • Documentation:

    • The feature is documented
    • The documentation is up to date
    • Release notes:
      • Added an entry if the change is breaking or significant
      • Added an entry when adding a new feature

@kasemir

kasemir commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Looks like the Label in Group boxes also needs this fix.

@kasemir

kasemir commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

And the labels in Tabs

@kasemir

kasemir commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

.. and Radio Buttons as well as Check boxes.

Now I'm not sure any more if reverting until JFX25 comes out is more practical

kasemir

This comment was marked as outdated.

Should be reverted once moved to JFX25.
Fix has to be applied to all widgets that set the text fill color
using a setter.
@rjwills28
rjwills28 force-pushed the fix_jfx21_transparent_labels branch from 91d61f9 to 0c5fec7 Compare July 22, 2026 12:02
@sonarqubecloud

Copy link
Copy Markdown

@rjwills28

Copy link
Copy Markdown
Contributor Author

Thanks for noting those @kasemir - you're right - everywhere that we do a setTextFill() we need to apply the patch.

I have just done that for this branch - mostly to show what the solution would look like. I created a helper method to do this to save repeating the same code too much. But we have now modified 12 files...

Note, I rebased the branch to keep the changes to a single commit so that we can easily revert it when we move the JFX25. If you have previously checked out the branch there may be problems so I would advise switching back to master, deleting your local version of this branch (fix_jfx21_transparent_labels) and then check it out again. Something like:

git checkout master
git branch -D fix_jfx21_transparent_labels
git checkout fix_jfx21_transparent_labels

All that said, if we still think it is simpler to revert the original commits in the PR that caused this issue in JFX21, #3887, then I am happy for that to be the strategy as long as we make a point to test and merge them again when we have moved to JFX25.

@kasemir

kasemir commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Once we get to JFX25, I think we agree that all will be fine.

But until that time, what do you prefer? Revert, or update those 12 files? Either way, it would be temporary to keep the main branch usable until JFX25

@rjwills28

Copy link
Copy Markdown
Contributor Author

To be honest I guess it feels like it would be easier to revert the previous PR commits as that only impacts 2 files instead of changing 12...

@kasemir

kasemir commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

easier to revert

Then do that, and re-apply when we're on JFX25.

@kasemir

kasemir commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Replaced by #3893

@kasemir kasemir closed this Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants