How to know when the JComboBox popup is about to show or hide?

Hi all,
In JDK 1.4, a new addPopupMenuListener() was added to the JComboBox component. I found out I have to use JDK 1.3, but I already wrote a lot of code around this particular capability. I am trying to figure out how to duplicate it in JDK 1.3. I need to know BEFORE and AFTER the popup is displayed. OR, is there a way with JDK 1.3 that as soon as they click the combo box, it fires an event. The thing is, as soon as they click it, I want to change the background color. When they are done selecting, I can use an ActionListener or ItemListener to find out what was selected and change the color again. My killer is trying to figure out how to know when they have selected the box. I tried adding MouseListener, PropertyChangeListener, AncestorListener. None are doing a thing when the JComboBox is first selected.
Any help would be much appreciated.
Thank you.

Hi all,
In JDK 1.4, a new addPopupMenuListener() was added to the JComboBox component. I found out I have to use JDK 1.3, but I already wrote a lot of code around this particular capability. I am trying to figure out how to duplicate it in JDK 1.3. I need to know BEFORE and AFTER the popup is displayed. OR, is there a way with JDK 1.3 that as soon as they click the combo box, it fires an event. The thing is, as soon as they click it, I want to change the background color. When they are done selecting, I can use an ActionListener or ItemListener to find out what was selected and change the color again. My killer is trying to figure out how to know when they have selected the box. I tried adding MouseListener, PropertyChangeListener, AncestorListener. None are doing a thing when the JComboBox is first selected.
Any help would be much appreciated.
Thank you.

Similar Messages

  • How to know when the PRICE AFTER DISCOUNT changed and get the value

    Hi,
    Everything I do to see if a value changed in the grid works except for PRICE AFTER DISCOUNT
    which seems to be inaccessible.
    Any idea how to know when exactly this value changed and do actions accordinly ?
    Also I always get 0.00 if I try to get the value of it
    This works to get in the condition of a vlaue changing but I always get 0.00 as the value of the column
    if (pVal.ItemUID == "38" && pVal.ColUID == COL_DISCOUNT.ToString() && pVal.EventType == BoEventTypes.et_VALIDATE && pVal.ItemChanged == true && pVal.ActionSuccess == true)
        try
            SAPbouiCOM.Matrix Matrix = (SAPbouiCOM.Matrix)SBO_Application.Forms.ActiveForm.Items.Item("38").Specific;
            SAPbouiCOM.EditText Editor = (SAPbouiCOM.EditText)Matrix.Columns.Item(COL_DISCOUNT).Cells.Item(pVal.Row).Specific;
            SBO_Application.MessageBox("Discount changed for : " + Editor.Value + "...", 1, "Ok", "", "");
        catch (Exception ex)
            SBO_Application.MessageBox(ex.Message, 1, "Ok", "", "");
    And this do not even get into the condition even tought I SEE the column PRICE AFTER DISCOUNT:
    if (pVal.ItemUID == "38" && pVal.ColUID == COL_PRICEAFTERDISCOUNT.ToString() && pVal.EventType == BoEventTypes.et_VALIDATE && pVal.ItemChanged == true && pVal.ActionSuccess == true)
        try
            SAPbouiCOM.Matrix Matrix = (SAPbouiCOM.Matrix)SBO_Application.Forms.ActiveForm.Items.Item("38").Specific;
            SAPbouiCOM.EditText Editor = (SAPbouiCOM.EditText)Matrix.Columns.Item(COL_PRICEAFTERDISCOUNT).Cells.Item(pVal.Row).Specific;
            SBO_Application.MessageBox("Price after discount changed for : " + Editor.Value + "...", 1, "Ok", "", "");
         catch (Exception ex)
             SBO_Application.MessageBox(ex.Message, 1, "Ok", "", "");

    just idea, maybe it will works
    Create one udf in row level and set there FS based on changes on price after discount and fill value what is in price after discount. Then the validation make on this field instead of standard SAP field.

  • Upgrade from CQ5.4 to CQ5.5, how to know when the initial startup is completed?

    The documentation at http://dev.day.com/docs/en/cq/current/deploying/upgrading.html under "STANDALONE (QUICKSTART) UPGRADE" step 3 says that the upgrade process "might take a few minutes". How do we know when the system has been started successfully? When monitoring the error.log file, it looks like that after a while (~20 minutes) an upgrade of the workflow models is started (even though step 4 says that workflow models will be upgraded after a restart). Might there be any problems with stopping the server to soon?
    So, to summarize: how do we know when the server has been started successfully?
    Thanks
    Joakim

    In the error.log you would see message like "Finished upgrading". Alternatively you would see 5 completed task in crx explorer at location /var/upgrade/status

  • How to know when the process to be killed

    I want to run 4 .exe programs under win98 in sequence, how should i know when does the .exe program end?

    If you ran the .exe file using the Process class, there is a method called waitFor() which
    will cause the current thread to wait for the process to finish
    eg
    public void execute() {
    Runtime runtime = System.getRuntime();
    System.out.println("Start minesweeper");
    Process process = runtime.exec("winmine.exe");
    process.waitFor();
    System.out.println("Finished");
    }

  • How to know when the voltage is over the X-axis

    I want to know if I can know when a voltage or current or any data pass the X-axis?
    I have 2 type of data, Current and Voltage, and I want to know which one will cross the X-axis first, can some one help me on that?
    Because with that I will know if my system is inductive or capacitive.
    Thanks

    Have a look at the code snippet.  The code can probably be improved using a For Loop, but this one should give you an idea of how to implement the solution.
    I did not know the order of your data, so I called it top & bottom.   It will also look for crossing the X-axis at the same time.
    If values are increasing instead of decaying, then swap the Less or Equal to Greater than or Equal, and swap the less than to greater than.  I think you'll get the picture.
    Message Edited by Ray.R on 03-17-2010 09:28 AM
    Attachments:
    crossesXaxis.png ‏25 KB

  • Streaming audio file over the network w JMF. How to know when the file end

    Hi
    I am streaming audio file over the network using JMF. I want to be able to know when a file end so I can close the streaming session.
    Can some one please help
    Thanks

    If you put a ControllerListener on the Processor that's associated with generating the RTP stream, it'll generate an "EndOfMedia" event when the end of the file is reached.

  • How to know when the tablespace was deleted?

    Hi
    can we find the information regarding which has been deleted.
    can we find that when it was deleted.
    can we find who deleted it?
    Thanks
    Shaikh

    Hi,
    Just for Example :-
    If you have given the access rights for two Users, who have the privi's to drop the tablespaces...and think you dont have the Option of Alert Log.
    what you would do..??
    Auditing...??
    Tracing.. ??
    I think better Option is Trace for Specific Session, which ever he is willing to you.
    How does that help in this scenario and otherwise also ? No one is gonna enable trace like this for the users.
    Let me know your valuable feed back, that might help me in correcting my mistakes..!! ';-)
    Thanks
    Pavan Kumar N

  • How i know when a EXECUTE_QUERY retrieved last record

    Hi...
    How i know when the EXECUTE QUERY retrieved the last record in a block ....?
    Exist a trigger after trigger POST-QUERY?
    Regards
    Hector Gabriel Ulloa Ligarius
    Santiago of Chile
    http://es.groups.yahoo.com/group/desarrolloOracle/

    Kevin, sorry
    But the :system.last_record not change the value during the execution of EXECUTE_QUERY.
    Only useful when the data was retrieved into blocks...not during..
    Other mode?
    Regards
    Hector Gabriel Ulloa Ligarius
    Santiago of Chile
    http://es.groups.yahoo.com/group/desarrolloOracle/

  • JPopupMenu : how can I know when the mouse leaves the popup?

    Hello,
    I need to know when the mouse leaves a JPopupMenu or more precisely when no items are overlighted. Adding a mouselistener to the popup does not work because the JMenuItems themselves capture the mouse.

    Actually, I added a MouseListener that extends MouseAdapter to the component that owns the popup, and the same MouseListner to the popup itself. I have only overriden the MouseEntered method to let me know that the mouse is no more over a JMenuItem. It's now working fine, but I don't like that kind of programming.....
    I need that to do a toggleButton with a popup menu that would remember the last item selected when the mouse leaves the popup. (Because once a choice is made, the selected "tool" appears as an icon in the button and that icon is updated when the items of the popup are overlighted. So that when the mouse leaves the popup, the selected tool has to reappear as an icon in the button and the associated item has to be armed.)

  • How do I stop the Adobe Popup when printing?

    I am constantly creating PDF files using Adobe Acrobat Professional 7.0. I create from multiple programs: Office Word, Excel, Paint, Etc. as well as AutoCADD.  I create them using Adobe as a printer, thus printing to PDF. Once the PDF has been created from the other program via printing to Adobe, the new PDF file pops up for viewing. I am ok with this; however I then click onto another program and after a few second the PDF pops up again. Even if I close it a few seconds later it pops up again. When I am printing multiple sheets out of a program I am jumping back and forth and the popup feature slows me up big-time or causes me to mess up the files I am working with.
    How do I stop the Adobe Popup?

    That fixed the problem of the printing taking over the screen multiple times. I would like to have a solution where the finished file shows "PDF results" once, letting me know that the file has been created successfully, then let me get back to another program. Maybe this can be an upgrade with the next version.

  • HT1459 My I pod is not responding  how do I know when the ipod had actually died?????

    my ipod has the green lights however when i try to listen to music ....nothing ....i tried several head sets. how do i know when the ipod is finally dead

    Read the manual for a solution - iPod Manuals

  • How do we know, when the service contract is last modified ?

    How do we know, when the service contract is last modified and by whom ?
    thanks
    siva
    Edited by: sivapara on Nov 24, 2008 3:14 PM

    To add also in OKC_K_HISTORY_B for some actions.
    Thanks
    Nagamohan

  • JComboBox Event? How do I know when a JComboBox has been clicked?

    What event is fired when a JComboBox is pressed?
    I can tell when an item has been selected but I want
    to know when the combobox was clicked originally.

    Two (untested) ways of doing this:
    1. Subclass JCombobox and fire an event when the box is opened. To find out when its opened, you'll probably have to look at the source for JCombobox and override the method.
    2. use the model as a clue. Chances are the underlying combo box model will have its getValueAt() method called when the user opens the drop down box. Cant be sure that thats the only time itll happen tho,,
    DS

  • How do I disable the brushes popup menu when I left click in Photoshop CS5?

    How do I disable the brushes popup menu when I left click in Photoshop CS5? I am trying to use the clone stamp and I am not able to get a sample because of this popup menu.

    LOL,  I can't even begin to complain with the number if times I misread questions, and then try to break my own record for the number of typos in a single post.
    The image above was taken on a photgraphic weekend where the group (of all young ladies ) I was travelling with, set us a photography challenge.  The one above was my response to a 'faceless portrait'.  The only other one I attempted was this response for a picture of a 'wild animal', featuring camera club president Liz.
    Oh what fun we had, laughing and laughing until our faces fell off.
    [EDIT]  Both taken at Karamea, which some visitors to NZ might recognise as the western end of the Heaphy Track.

  • How does c:url tag know when the session is cookieless and thus to redirect

    i have been looking at the source code for c:url tag and can't figure out how they are doing that. I need a way to do that in a jsp, to check if the cookies are allowed or not.

    how does c:url tag know when the session is cookieless and thus to redirecthuh?
    What do cookies have to do with redirecting?
    Cookies get encoded into a URL using the method in HttpServletResponse: response.encodeURL() or encodeRedirectURL().
    That method determines whether or not it prints out the session id as part of the url, or it gets uses cookies.
    You can try: request.isRequestedSessionIdFromCookie().
    If that is true, you know that session cookies are supported (or at least that one was)

Maybe you are looking for