Toolbar buttons do not highlight when moused

  • aappddeevv

    aappddeevv - 2006-06-10

    JDK 1.5 update 7.

    I am adding JButtons to a JToolBar to create the toolbar.  For the L&Fs I expected the buttons to be "flat" and highlight their content area when moving the mouse over then have a deeper highlight when the mouse button is pressed.  I only get a highlight when I press a button though and then it looks like the highlight sticks to the button.


    • aappddeevv

      aappddeevv - 2006-06-10

      Just a followup note.  The standard menus perform highlighting and dehighlighting fine.  My toolbar has icons as well as text components in it.

    • Robert Futrell

      Robert Futrell - 2006-06-13

      Hmm, I've never heard of this behavior before.  Could  you provide a small, standalone test case showing this behavior and post it here?  In the meantime I can try to write a small program with a toolbar with both buttons and text components, but there may be something "special" about the way you're creating the toolbar.

    • aappddeevv

      aappddeevv - 2006-06-24

      I think I figured it out.  I was adding the buttons okay (and turning off the border etc. as needed).  But the right way to activate the highlighting behavior correctly was to JToolBar.setRollover(true) which I had not set.  That made the highlighting work correctly.


Log in to post a comment.