Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4287690
Votes 6
Synopsis JComboBox should send a drop down event
Category java:classes_swing
Reported Against 1.2.2 , 1.2fcs , 1.2beta3
Release Fixed 1.4(merlin-beta)
State 10-Fix Delivered, request for enhancement
Priority: 4-Low
Related Bugs 4143699 , 4198474
Submit Date 03-NOV-1999
Description
Will be implemented for Merlin




java version "1.2.2"
Classic VM (build JDK-1.2.2-W, native threads, symcjit)

I want JComboBox to send an event just before the popup (drop down) list is
displayed. This would allow me to use an editable JComboBox in the following
way:

  1) The user enters a simple search criteria in the text field, e g "Cis*".

  2) The user presses the drop down button or down key.

  3) The application detects the drop down event, recognizes that the current
     selection is a String (the criteria) and populates the list model
     with entries matching that criteria.

  4) The user selects one of the entries.

  5) The user changes her mind and drops down the list again.

  6) The application detects the drop down event, recognizes that the current
     selection is an XxxEntry, not a String and does not repopulates the list
     model.

  7) The user selects a new entry from the current set.
(Review ID: 97391) 


======================================================================



Is there a way to capture when a user presses
the arrow on a combobox?  If not, could there be? 
I have a bit of processing to do to fill a combo
box and I would like to not load it until if and 
when it is wanted.

I want to capture a press
on the arrow and not just in the combobox itself.  In other words, if a
user drops the box down, I want to make sure that the list is
populated.  However, if the user just wants to type text in that field,
without loading the list first, they should be able to.
(Review ID: 29985)
======================================================================
Work Around
	




By detecting Item events, most of the above functionality can be achieved, but
the user must press enter or leave the field before dropping down the list, or
no Item event is fired. This is especially annoying when using this combo box
as editor for a JTable column.
======================================================================
Evaluation
This requires some additional API but it has been completed for the next major release of the JDK (1.4).

The PopupMenuEvent will from the JPopupMenu will be forwarded to the JComboBox. A client of the JComboBox can register itself as a PopupMenuListener to recieve the notification.

 xxxxx@xxxxx  2000-10-25
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang