• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JPopup That Looks Like ToolTip

 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Has anyone been able to or seen a Tooltip that you can click on like a JPopup Menu, or has anyone been able to make a JPopup Menu look like a Tooltip?
I hope that makes sense.
 
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Gregg,
the point of a tooltip is, that when you click on it, it disappears?!
why don't you want to use the "normal" popup menu?
is it, because you don't need a menu but some other component? say a JLabel?
I think this is a problem that pops up ( ) if you need a big menu where scrolling would be handy and you realize that the JPopupMenu somehow don't seem to have scrolling (or at least that was my experience). The SpeedJava plugin that comes with JEdit (= open source) has scrollable pop ups (& is fast). so this could be a good start to look for a solution (not only on scrolling but how to get any component into a popup).
cheers
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't want to use a normal JPopupMenu because it is bulky and doesn't mesh well with the rest of my application. I don't need it to scroll, I just want a slimmer, more sleak popup menu. A popup menu that LOOKS like a Tooltip would be great. Just don't know how to go about acheiving that without repainting the JPopup menu myself.
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do you mean when you say you want a JPopupMenu that looks more like a Tooltip? Do you want a smaller font? different color? Extra text that can't be clicked on?
 
Chantal Ackermann
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
that might not be the cleanest way but...
you could just use the ToolTipUI for layout out your PopupMenu in some way, like creating your own MyPopupMenuUI. Maybe it would work with some copy-pasting of source code.
but first you would have to make sure what is painted by ToolTipUI and what else by JToolTip. (I only know of JTableHeader that it does more actual layouting than TableHeaderUI.)
or (on second thought) you try to change the behaviour of JToolTip to that of a popup menu.
cheers
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic