• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Add mouse hover on JTabbledPaneUI with the BasicTabbledPaneUI

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI,

I want to add mouse hover on the Tab Pane, the mouse hovers effect desired is very simple, it should change the cursor when the mouse is over the tab name.

I'm doing an example, I have the component MateriaTabblePaneUI with this mouse event:





But this event run on all JTabbledComponent and I want to add this effect only on the text of the jTabbledPane, like "Panel1" or "Panel2"

I found this answer on stack overflow, but not use the component BasicTabbledPaneUI https://stackoverflow.com/a/4228349/10854225

I want to make this change because I want optimized the code and I need to help to find some good idea.

The desired effect is

MouseHover effect



Thanks for your time
 
Marshal
Posts: 80869
505
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What happens if you use the addToolTip() method on your tabbed pane?
 
Vincenzo Palazzo
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:What happens if you use the addToolTip() method on your tabbed pane?



Thanks for your time.

I added this this.tabPane.setToolTipText("TEST"); and don't have any result.

I'm sorry :/
 
Rancher
Posts: 3324
32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

it should change the cursor when the mouse is over the tab name.


You can try adding the MouseMotionListener to the tabbed pane.

The tabbed pane has a method:

If the value is not -1 you set the cursor to whatever you want.

If the value is -1, you set the cursor to null to reset the default cursor.
 
Vincenzo Palazzo
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Hi, I lose this message, sorry.

Today I will try this solution and I will return here to know the result.

Thanks for your time.
 
reply
    Bookmark Topic Watch Topic
  • New Topic