2 Replies Latest reply: Feb 25, 2013 9:23 AM by 949137 RSS

    first underscore in string gobbled up by control in display text

    949137
      How do I go about preventing the first underscore in my display strings from disappearing. I realize it is probably related to mnemonics, but I have not set them for my controls (split menu button, menu item, and menu). I searched the forums and documentation, but I couldn't find anything related to escaping and underscore.
        • 1. Re: first underscore in string gobbled up by control in display text
          jsmith
          Try setting the mnemonicParsing property to false.

          http://docs.oracle.com/javafx/2/api/javafx/scene/control/Labeled.html#setMnemonicParsing%28boolean%29
          MnemonicParsing property to enable/disable text parsing. If this is set to true, then the Label text will be parsed to see if it contains the mnemonic parsing character '_'. When a mnemonic is detected the key combination will be determined based on the succeeding character, and the mnemonic added.
          The default value for Labeled is false, but it is enabled by default on some Controls.
          • 2. Re: first underscore in string gobbled up by control in display text
            949137
            One would hope the documentation would call out which controls it is enabled by default.

            What if I wanted mnemonic parsing on a string that needed to contain an underscore? Or would it just be easier to set an accelerator key and be done with it?