JComboBox - how to get popup or add listener

Hi,
Using a JComboBox I want to add a mouse listener so I can detect when a user press mouse on it. It seems that the popup may be getting the mouse event though. Is there a way to add a mouse listener to it so I can catch mousepressed event? perhaps a way to get the actual ComboPopup??
...hopefully it can be done without subclassing the combobox UI, or popup, or jcombobox itself.
thanks

It occurs to me that what you are probably asking is not 'how do I add a MouseListener
to the popup menu', but rather, 'how do I add a MouseListener to the ComboBox itself'.
Camickr suggestion is spot on if your combo box is editable. If it is not, you should add
it to the renderer. However, I'm not sure if that will still catch mouse events on the arrow
button which pops the list, and that doesn't seem to be accessible from the UI.
Hmmm. Probably your best bet is to iterate through the combo box's child components
and add the listener to each of those.
: jay

Similar Messages

  • How to get rid of adds tht come when i browse

    how to get rid of adds that come when i browse

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    Do a malware check with some malware scanning programs on the Windows computer.<br>
    Please scan with all programs because each program detects different malware.<br>
    All these programs have free versions.
    Make sure that you update each program to get the latest version of their databases before doing a scan.
    *Malwarebytes' Anti-Malware:<br>http://www.malwarebytes.org/mbam.php
    *AdwCleaner:<br>http://www.bleepingcomputer.com/download/adwcleaner/<br>http://www.softpedia.com/get/Antivirus/Removal-Tools/AdwCleaner.shtml
    *SuperAntispyware:<br>http://www.superantispyware.com/
    *Microsoft Safety Scanner:<br>http://www.microsoft.com/security/scanner/en-us/default.aspx
    *Windows Defender: Home Page:<br>http://www.microsoft.com/windows/products/winfamily/defender/default.mspx
    *Spybot Search & Destroy:<br>http://www.safer-networking.org/en/index.html
    *Kasperky Free Security Scan:<br>http://www.kaspersky.com/security-scan
    You can also do a check for a rootkit infection with TDSSKiller.
    *Anti-rootkit utility TDSSKiller:<br>http://support.kaspersky.com/5350?el=88446
    See also:
    *"Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked

  • How to get parameter and add it to hyperlink using struts tag?

    Hi everyone:
    There is a.jsp pass a parameter to b.jsp.How to get the parameter in b.jsp using struts Tag?I also want to add the parameter to a hyperlink in b.jsp.For example in b.jsp <html:link forward=.....>cxxxx</html:link>.How to add the parameter(get from a.jsp) to cXXXX in b.jsp?

    Try this:
    Copy A Request Parameter - You can create a new bean containing the value of a parameter included in this request. If no parameter of the specified name was included, a request time exception will be thrown - therefore, it is common to nest the use of this tag inside a <logic:present parameter="xxx"> tag to ensure that the parameter was really included. If there is the possibility that more than one parameter of the same name was included, specify the "multiple" attribute (and the resulting value bean will be an array of String values, instead of a single String).
    <bean:parameter id="name" name="name"/>
    And then just use <html:link> with paramId. No java code at all.

  • JComboBox    How to get input from JComboBox

    Hi all.
    I have a JComboBox called combobox.
    User can choose one string out of 5 using this JComboBox.
    Whenever the user press a button, I'd like to get an input through this combobox using actionListener.
    How can I get input through JComboBox?
    combobox.getValue() ???
    I appreciate your help !

    http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JComboBox.html
    Object getSelectedItem()

  • How to get popup in UWL

    Hi Experts,
    I need to show any popup (dialog, confirmation etc.) when the user clicks on the 'Completed button' in the UWL. When I tried to put in normal java code for the above java.awt.HeadlessException was thrown since I am very new to this I am unable to get it right. Can anyone help me with proper code as how to do it?
    Thanks & Regards,
    Amit Sinha.

    Hi RamaRao,
    If you are using window.open() method for pop up,use below parameter in your method and it is:
    window.open('test.htm','','scrollbars=no,resizable=yes');
    -Suresh

  • When ever link any link on a web page many popups are opening. I don't get popups or adds when I use chrome or IE. Really frustrated with Firefox.

    Fire fox current version very frustrating and allows losts of ads and popups. When ever I click on any link from a web page ( any web page) i get a pop ups from ads like jabong, etc. I use the url of the same web page in chrome or IE I do not get such popups. It also crashes often.
    The only way to get rid of this is to get use to Chrome or some other browser.

    vksh89, What Extensions do you have installed as there are a few that can insert ad links on pages for example.
    Also if Firefox is your default browser something on computer may be targeting it.

  • How to get service name and listening host to connect to oracle DB server?

    I have successfully installed oracle db client 10g release 2 on my winXP. But when I tried to use Net Congiguration Assistance to connect to oracle db server. I do not know what is the "service name" and listening "host" I supporse to enter. Where can I get the names?
    PLEASE HELP! THANKS!

    machine name or IP = machine name or IP address of the database server
    To know the service name do the following on the server :
    $ lsnrctl services
    LSNRCTL for Linux: Version 10.1.0.3.0 - Production on 30-DEC-2005 00:24:28
    Copyright (c) 1991, 2004, Oracle.  All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))
    Services Summary...
    Service "PLSExtProc" has 1 instance(s).
      Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
        Handler(s):
          "DEDICATED" established:0 refused:0
             LOCAL SERVER
    Service "test10" has 1 instance(s).
      Instance "test10", status READY, has 1 handler(s) for this service...
        Handler(s):
          "DEDICATED" established:0 refused:0 state:ready
             LOCAL SERVER
    The command completed successfully
    $The service name is test10 in my case. Of course you have to use yours.

  • How to get rid of add-on that won't go away?

    Somehow the Quiknowledge add-on (or is it a plugin?) reactivated itself in my Firefox browser. How can I make it go away for good?
    I went into Firefox, checked the box to deactivate, and restarted Firefox. I even rebooted my PC. These steps were supposed to make it go away. Despite Quiknowledge no longer being listed as active, it continues to turn my Firefox pages into pages full of link ads.
    Help!

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    You can delete a possible user.js file and numbered prefs-##.js files and rename (or delete) the prefs.js file to reset all prefs to the default value including prefs set via user.js and prefs that are no longer supported in the current Firefox release.
    *http://kb.mozillazine.org/Preferences_not_saved

  • Re: How do get readers to add data within the app?

    Is this possible

    You'd have to build an HTML form and then include it via a web overlay in your folio.
    Neil

  • How to get the sum in appropriate column without a red triangle appearing?

    Hello,
    In 'Numbers" - How do get columns to add (calculate) the sum in each decending column on an Expense Report.
    When I highlight the decending column the total appears on the far left of the screen.  When I drag the sum amount from there to the appropriate column a red triangle with an ! appears instead of the amount.
    Thanks for your immediate help.

    The red triangle is an Error triangle. Clicking it will display the error message and tell you what error has occurred. From your description, my assumption is that you dragged the SUM() function from the quick calculations at the lower left and dropped it intto a cell in the column being summed.
    If that's the case, this is likely the error message you would see:
    When you highlighted the 'decending column,' you likely selected all of the cells in that column, including the one into which you dropped the function.
    Instead, do one of the following. These assume the column you want to sum is column B.
    If you want the sum at the top of the column:
    Make sure the row you want the sum to appear in is a Header row.
    Enter this formula into any Header Row cell in column B:   =SUM(B)
    If you want the sum at the bottom of the column:
    Add a Footer row to the table. (Go Table (menu) > Footer Rows > 1).
    Enter this formula into the Footer Row cell in column B:   =SUM(B)
    SUM (and other functions) that expect a range of cells will interpret a cell reference entered using only the column letter (B) as meaning 'all of the non-header, non-footer cells in column B', and will exclude those cells in header or footer rows.
    Regards,
    Barry

  • How to get rid of an apple id from a iphone

    I gave my sister my old iphone to get a difrent phone and when she got a new sim recently I keep getting popups to add the number to my ipod's facetime , imessenger ect. she was using my apple id and then made a new one and just signed in to her phone. So every time she reactivates imessanger or anything else my apple id comes up automatically. Is there any way to remove my id keeping all her data without having her having to start from scrach.

    Icttv123 wrote:
    is there any other solution????
    Erasing the iPhone is the solution; there are at least two ways to do that, though. 
    The second one is, go to icloud.com and login with your Apple ID and password.  Go to "Find My iPhone" and click "Devices."  From there you'll be able to erase the iPhone.  All the magic will happen as soon as the iPhone has internet access.

  • How to get data from database to JComboBox

    hi
    i am trying to get data which is in database. here the problem is i am getting only one row in the JcomboBox
    i want all data just like list. i dont know how to get that . below is the code plz any one help me....
    import javax.swing.*;
    import javax.swing.JList.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.lang.String.*;
    import java.lang.Integer.*;
    import java.sql.*;
    public class customer_code extends JFrame implements ActionListener
    Container c=getContentPane();
    JLabel customer_code=new JLabel("Customer Code and Name");
    customer_code()
    super("Customer Details");
    setSize(300,250);
    setVisible(true);
    setLayout(null);
    setLocation(430,310);
    Font f=new Font("SansSerif",1,16);
    Font f1=new Font("SansSerif",0,14);
    customer_code.setBounds(10,20,250,30);
    add(customer_code);
    customer_code.setFont(f);
    ResultSet rs=null;
    String j=null,k=null;
    try
    System.out.println("MySQL Connect Example.");
    Statement st=null;
    Connection con=null;
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con = DriverManager.getConnection("jdbc:odbc:project","vikky","vishu");
    System.out.println("Connected to the database");
    st=con.createStatement();
    rs=st.executeQuery(" select code as c,Customer_name as n from customer_details ");
    while(rs.next())
    j=rs.getString("c");
    k=rs.getString("n");
    System.out.println(j);
    System.out.println(k);
    String[] names = new String[] {j,k};
    JComboBox comboBox = new JComboBox(names);
    add(comboBox);
    comboBox.setBounds(25,60,250,50);
    comboBox.setFont(f);
    comboBox.addActionListener(this);
    comboBox.setMaximumRowCount(10);
    con.close();
    System.out.println("Disconnected from database");
    catch (Exception e)
    e.printStackTrace();
    public void actionPerformed(ActionEvent event)
    if ("comboBoxChanged".equals(event.getActionCommand()))
    System.out.println("User has selected an item from the combo box.");
    JComboBox comboBox = (JComboBox) event.getSource();
    if(comboBox.getSelectedItem().equals("None"))
    public static void main(String agr[])
    customer_code cd=new customer_code();
    }

    r035198x wrote:
    Also separate that database code from interface display code.
    You should never access the database on the EDT.
    See [Doing Swing Right|http://bytes.com/topic/java/insights/853297-doing-swing-right] for more details.
    Yes! By the time you are working with Swing and JDBC you should already know how to structure code. If not, then you are not ready for these topics and you've jumped the gun.

  • Keep getting popup on Mac saying "Aministration rights are required to complete Adobe Add-0ns installation or removal" Where?????

    Keep getting popup on Mac saying "Aministration rights are required to complete Adobe Add-0ns installation or removal" Where????? And how to correct this?

    If the previous advice does not work, read the link below
    This link says After Effects, but check YOUR permissions !!!
    -http://blogs.adobe.com/aftereffects/2014/06/permissions-mac-os-start-adobe-applications.ht ml

  • How to get the values from popup window to mainwindow

    HI all,
       I want to get the details from popup window.
          i have three input fields and one search button in my main window. when i click search button it should display popup window.whenever i click on selected row of the popup window table ,values should be visible in my main window input fields.(normal tables)
       now i am able to display popup window with values.How to get the values from popup window now.
       I can anybody explain me clearly.
    Thanks&Regards
    kranthi

    Hi Kranthi,
    Every webdynpro component has a global controller called the component controller which is visible to all other controllers within the component.So whenever you want to share some data in between 2 different views you can just make it a point to use the component controller's context for the same. For your requirement (within your popups view context) you will have have to copy the component controllers context to your view. You then will have to (programmatically) fill this context with your desired data in this popup view. You can then be able to read this context from whichever view you want. I hope that this would have made it clear for you. Am also giving you an [example|http://****************/Tutorials/WebDynproABAP/Modalbox/page1.htm] which you can go through which would give you a perfect understanding of all this. In this example the user has an input field in the main view. The user enters a customer number & presses on a pushbutton. The corresponding sales orders are then displayed in a popup window for the user. The user can then select any sales order & press on a button in the popup. These values would then get copied to the table in the main view.
    Regards,
    Uday

  • How to get system popup menu in java?

    I want to know how to get windows xp or any operating systems default popupmenu in java.
    And i also have problem for using mnemonic for JPopupMenu, it works well when i first press right click of my mouse and use the specified mnemonic for that the action specifed for that is triggered but when is use mnemonic without the using my mouse it doesn't trigger why.

    Please how to get native(e.g windows explorer) popup menu in jfilechooser

Maybe you are looking for

  • Nested loops and if statements

    I have four schemas with a problem category table "gppcat" that has problem categories and problem descriptions. I need to output these categories and descriptions to a csv file. while doing this I need to make sure I don't include duplicate records.

  • Variant configuration document

    Dear Experts,                      I am new to Variant configuration ,so I want an end end to document with example related  to  PP .Which includes create of characteristic ,class,super BOM,super routing,maintain of object dependencies ,configuration

  • Intergrating ACS with user database in windows DC

    Please, I just installed and configured ACS on window 2003 server on my network. The next task is to integrate the user database in my DC with the ACS. I need you to tell me in steps what else that need to be done.The documentaion is not specific. (I

  • Is Maxtor 3200 500 G compatible with my MAC OS X 10.5

    that's my question...I just bought a Maxtor 3200 500G thinking I could store all my stuff there and alliviate my Mac, but it seems not compatible... can someone help me? I already followed instructions going to disk utility...erase...choose Mac OS ex

  • Xml extract assign to varchar2

    How do i assign the xml Extract to a varchar2.. its throwing me error, is it possible or an alternative method to do this. ST_Name1 varchar2(120); ST_Name1:= xml_st.EXTRACT ('ST/Name1/text()').getstringval ();Thanks