• 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

problem with metalscrollbutton on jpopupmenu

 
Ranch Hand
Posts: 201
2
Netbeans IDE PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
G'day yall!

I have a JCombBox with a custom popup menu component. In my ComboBoxUI class
i invoke a JPopupMenu using the ComboPopup interface implementation. I want to use
a group of disabled MetalScrollBar button objects as navigator components for a
calendar that i am working on. I am using the mouseevent interface instead of
actionlistener which cases the popup function to hide and should not be used.

Nevertheless, in the upper part of my DatePopupMenu class that extends the
JPopupMenu class i have a "navigation panel" on which i wish to add my MetalScrollButtons
but when i do they don't show up at all when i invoke the popup by clicking on the
combobox object.

Everything works fine as long as i use BasicArrowButtons as disabled navigation
objects for my calendar project but not MetalScrollButton?

Any ideas or hints on this issue would be greatly appreciated. I am some what of a
semi-used user of java api. Please have patient. I dont think i need to post any code
for the problem in question, beacause it is formerly a question of theory and best
practice. Many thanks in advance for reading or replying in advance!

// confused and puzzled,
Robert.

 
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
- override ListSelectionModel, there you can to store value for view ---> e.g. enable/disable for XxxRenderer,
- to override selectionIndex (have to solve issue if the last of Items is disabled, otherwise jumping to the 1st Item),
- add ListSelectionListener for view instead of hunting for MouseEvent,
- override selectionIndex in XxxComboBoxModel, I'm sure that here is Mutable/AbstractListModel in SSCCE form, contains proper code for XxxSelectionXxx
- nothing clever without yout SSCCE, short, runnable, compilable with hardcoded value for JComboBox/XxxComboBoxModel in local variable
 
Robert Ingmarsson
Ranch Hand
Posts: 201
2
Netbeans IDE PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi forumist friend!

Thanks a for your answer. I haven't been active that much here at the ranch. But thiis thread is now solved.
I did a human error. I accidently replaced some paraters in the MetalScrollBar buttons constructors by misstake, so now
they show up as they where exptected to do. Oh well, errors are parents that give births to success, right ?

Best regards!

your humble semi-rated student java developer, sir and may the brews be with you!

Robert!

 
reply
    Bookmark Topic Watch Topic
  • New Topic