I am maintaining some code the implements a customized Look and Feel in Java. While doing a recent upgrade of Java version (for other reasons) I found that the Look and feel broke due to a field not found on
sun.swing.SwingUtilities2.BASICMENUITEMUI_MAX_TEXT_OFFSET;
This is in a class that is closely based on BasicMenuItemUI.layoutMenuItem()
circa Java 6u02 (here's the source). I have found that Oracle have re-factored their code to include a MenuItemLayoutHelper
in the new target version I am using, Java 6u31.
I could just use the MenuItemLayoutHelper
but that doesn't solve the problem it just puts it off until the next time the Java internals are changed around. Therefore, I have discounted this as a solution.
I am after some advise on how to achieve a left to right layout similar to BasicMenuItemUI
without needing to know the parents' maximum text offset (removing the bad dependency on sun.swing.SwingUtilities).