24. Juni 200619 j Hallo Forum, welches Signal kann ich wo abfangen, wenn eine JComboBox geöffnet wird? Ich möchte erst beim aufklappen die anzuzeigenden items erstellen. danke im voraus mfg jghj
24. Juni 200619 j Hier die Meinung der JavaAPI: Although JComboBox inherits methods to register listeners for low-level events — focus, key, and mouse events, for example — we recommend that you don't listen for low-level events on a combo box. Here's why: A combo box is a compound component — it is comprised of two or more other components. The combo box itself fires high-level events such as action events. Its subcomponents fire low-level events such as mouse, key, and focus events. The low-level events and the subcomponent that fires them are look-and-feel-dependent. To avoid writing look-and-feel-dependent code, you should listen only for high-level events on a compound component such as a combo box. For information about events, including a discussion about high- and low-level events, refer to Writing Event Listeners (in the Creating a GUI with JFC/Swing trail). Aber es ist wohl machbar mit einem PopupMenuListener. Einfach per addPopupMenuListener einbinden.
Archiv
Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.