• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with metalscrollbutton on jpopupmenu

 
Robert Ingmarsson
Greenhorn
Posts: 27
Java Netbeans IDE PHP
  • Mark post as helpful
  • send pies
  • 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.

 
m Korbel
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
  • 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
Greenhorn
Posts: 27
Java Netbeans IDE PHP
  • Mark post as helpful
  • send pies
  • 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!

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!