How to make JPopupMenu not take focus/mouse cursor?

Hello,
I show() a JPopupMenu based on what the user types in a JTextField, however, when that happens the user typing on the keyboard will no longer write into the text field, unless with the mouse clicks again on the field, thus closing the popup menu.
I want, like in Eclipse and NetBeans code completion feature, that the user may still type in the field even if the popup menu comes out, although typing might close the popup menu (and in the IDEs that actually generates a new popupmenu with different content).
How can I achieve that? I thought it had to do with Focus, but it doesn't seem to.

one way is to have the default invoker/null. However that makes the popup stick, unlike in the ides.

Similar Messages

  • How to make JScrollpane not to fetch data while scrollbar is adjusting?

    how to make JScrollpane not to fetch data while scrollbar is adjusting?
    Hi,
    I need to make the jscrollpane get data only when the scrollbar stops scrolling.
    for instance if I hold the scrollbar's thumb and drag it to pass 1000 records, I want the view to wait until I release the thumb before taking any action( ex. adjust the view). in other words if the value of getValueIsAdjusting() of scrollbar is true, then the jscrollpsne should wait until it changes to false before doing anything. this is the same approach that Outlook takes when browsing through the list of emails in your mailbox.
    I don't know how to solve this issue. any help regarding this issue would be appreciated.
    thanks
    Saba

    You are planning to mention your cross-post(s) somewhere in this post, correct?

  • How to make Finder NOT to show files from a specific folder in "All My Files"?

    Hello!
    Can someone please advice how to make finder NOT to show files from a specific folder in "All My Files"? See the attach - I recently installed Civilization 5 from Steam and now I have a lot of unneeded files (*.log and *.ini) shown in  All My Files colder in Finder.
    I don't want to see them. Any advise?

    Using "All my Files" was very handy before all this rubbish popped up. =(

  • How do I make a button NOT take focus when it is clicked?

    I am trying to create a virtual keypad and the problem is that when I have a Robot make a KeyEvent for a certain number when a certain button is pressed, the TextField loses focus and the focus is placed on the button that was pressed, so nothing appears in the TextField.
    How can I make a button NOT take the focus when it is pressed?
    Edited by: tox0tes on Nov 28, 2008 8:06 PM

    great. another way is to have a call to myTextField.requestfocus() in the button's actionlistener actionPerformed method, but that leads to tight coupling.

  • How to make an indicator takes more than one input

    Hello,
    I want to know how to make an indicator ( like gauge for example) response to more than one case strrcuture result. In other words, how the indicator can take more than one input and move based on different input values ( the arrow of the gauge moves to different angles basesed on the logic structure and not only to one degree).
    Thanks in advance,
     

    YES, you got it right Coastal !
    This is what i want to do,
    I dont know how to establish this output in the software, i am still learning LabVIEW.
    I put a merge block to join the outputs but it didnt work.
    check it in the attached VI file.
    I am sure it is an easy thing but I dont know how to implement it.
    Any help you provide is appreciated,
    Best wishes 

  • How to make a function take a specific group of constants

    I know i asked this before, maybe a year ago, but I totally forgot how to do it, and I haven't been programming much lately. But I was wondering if somebody can tell me how to make a certain function take specific constants. For example there are java functions, of which I can not remember that will only take certain values. So the function might look like:
    public getInfo(String INFONAME){}Where INFONAME has to be like one of two names or something, and they are constants that are defined somewhere else. If anybody knows what I mean by this, and knows how to create functions like that please let me know. Thank you.

    here's an overkill,
    import java.util.*;
    abstract class DoWhatever {
        public static Hashtable ht = null;
        public static Object DoWhat( String s, Object obj ) {
         if( null == ht ) {
             ht = new Hashtable();
             ht.put( ThisDoWhatever.NAME, new ThisDoWhatever() );
             ht.put( ThatDoWhatever.NAME, new ThatDoWhatever() );        
         return ( (DoWhatever) ht.get( s ) ).doWhatever( obj );
        public abstract Object doWhatever( Object obj );
    class ThisDoWhatever extends DoWhatever {
        public final static String NAME = "this";
        public Object doWhatever( Object obj ) {
         System.out.println( NAME );
         return null;
    class ThatDoWhatever extends DoWhatever {
        public final static String NAME = "that";
        public Object doWhatever( Object obj ) {
         System.out.println( NAME );
         return null;
    public class DoThisOrThat {
        public static void main( String[] args ) {
         DoWhatever.DoWhat( args[ 0 ], null );
    }

  • How to make the scrollbar function with mouse scroll wheel?

    Is there a way how to make my content scroll even with the mouse scroll wheel?... I have to edit the coding??

    Hey!
    You shouldn't have to edit any code.
    There is an active player bug surrounding this issue however, which causes the following:
    1) It should work on windows.
    2) It may not work on Mac.
    We're continuing to pursue this issue, we know it's important to our users.
    Thanks,
    Tara

  • How to make my website take up ALL of the browser space?

    I have been working for a really long time on a website, and I don't know how the dimenstions work. I just used the standard dimensions that it starts you out with, but when I publish my site, the website is like a rectangle on the page sourrounded by gray, you can see what I mean here: mclayphotography.businesscatalyst.com
    How can I set it so that my website takes up the entire area, or at least looks aestheitc like a regular website, rather than being just some random box.
    Thanks so much for the help!

    Hello,
    You can choose to increase the page dimensions (page width and min height) from the File -> Site Properties section as per your choice and then the rectangle box in between (Page area) would become larger to fill more of the browser area, however, doing this also has a disadvantage. That is, if someone then views your site in smaller screen (lower resolution), there would be a horizontal scrolling bar, and they would have to scroll horizontally to look at the various sections of your site. They won't be able to view the whole site at one go, that is, without having to scroll. Muse only has fixed horizontal page width as of yet.
    The gray area you're referring to is the browser fill area. So, if the idea is just to make it not look gray, you can add different browser fills from the browser fill option from the Control Panel as shown here: http://jingsite.businesscatalyst.com/jing/2013-03-13_0738.png
    This would also make the browser area look attractive while still keeping the site viewable at one go in smaller resolutions.
    Hope this helps.
    Cheers,
    Parikshit.

  • ICC file associated with photoshop process on Windows, how to make them not associated?

    In my code, an ICC profile is created and copy to the system folder (C:\Windows\System32\spool\drivers\color)
    then assign this profile to current document in photoshop using sPSActionControl->Play(&result, StringToKey("assignProfile"), iDescriptor, mode); // iDescriptor contains the ICC profile name
    after assigning profile, the .icc file is associated with the ps process, that is, I can't delete it or rename it, nor can I replace it with another file having the same name. But on Mac, the ICC file won't be associated with the process, so I can overwrite the icc file and do other work, that's better.
    How to make the icc file not taken by photoshop after assigning profile on windows?

    what i finally did to go around this problem was to make another user on my computer and only download podcasts. just as long as you don't hook the ipod up in this new profile, you should be fine

  • JDev902: How to make it NOT start up a web browser on debug start?

    In my JDeveloper setup, when I click on the bug to start my application, it starts up the embedded OC4J and eventually finishes initializing it. I then go to my already running web browser and request the application URL. This works fine.
    My colleagues, however, get slightly different behavior when they click on the bug, at some point during that process it actually starts up another instance of a web browser and tries to go to a particular web page. We all find that very annoying and would like to turn it off. Fortunately for me, it doesn't do that to me. What do they have to do in their environments to make that NOT happen? We don't want it to start another web browser instance when we debug the application.

    You'd think if the field was blank, it wouldn't do this at all.
    I looked at my configuration, and the field is blank.
    I went to my coworker's system, whose field was also blank, and who is getting this annoying behavior, so we changed the field to "aaaa". This works. It doesn't bring up the browser window. It does, however, still print out a line in the messages window, like this:
    Target URL -- http://<ipaddress>:8992/felix/index.jsp
    I do NOT see this message.
    So this workaround helps, as it avoids the annoying symptom, but I still wonder WHY I never had this problem, and why I don't see that "Target URL" message, which seems to be related. Both of us have the "Default run target" in our projects set to the same JSP page.

  • How to make textfield to take only numbers, & it wont allow us to enter any other characters

    make textfield to take only numbers, & it wont allow us to enter any other characters

    Clean up the code a little (credit goes to Sakthivel
    var oInput = new sap.ui.commons.TextField();
    oInput.onAfterRendering = function() {
      if (sap.ui.commons.TextField.prototype.onAfterRendering) {
        sap.ui.commons.TextField.prototype.onAfterRendering.apply(this, arguments);
      this.$().keydown(function(event) {
        var ctrlKey = event.ctrlKey;
        var altKey = event.altKey;
        var shiftKey = event.shiftKey;
        var key = event.keyCode;
        return (
          ctrlKey ||
          altKey  ||
          ( 47 < key && key < 58 && shiftKey === false) ||
          ( 95 < key && key < 106 ) ||
          ( key === 8) || (key === 9) ||  
          ( key > 34 && key < 40) ||
          ( key === 46)
    oInput.placeAt('content');
    -D

  • How to make JPanel not to move when dragged using mouse

    hi guys,
    Can anyone tell me what method has to be called so that the JPanel doesn't move when someone tries to do by dragging the panel using a mouse.
    Thanks,
    Vishal j

    There is no built in support for dragging a panel with the mouse, so you must have custom code.
    So as the question is stated we aren't able to help you.
    If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
    And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the code retains its original formatting.

  • How to make JPopupMenu pop out upwards?

    The title is just my problem.I add a JToolBar at BorderLayout.South of a JPanel. A popup menu will shown when I click on one button of my JToolBar. But the low part of JPopupMenu was covered by the taskbar of Windows2000. I want to make my JPopupMenu pop out upwards. How can I?

    Assuming that the popup is triggered by the mouse click and it's screen coordinates (x, y). Since the toolbar is in the southern border, and the popup appears to the right and below from that position "(x, y)". Calculate the width and length of the popup, (say it's 60 pixels wide by 90 pixels long) subrtact the witdth value ,(60) and the length value, (90) from x and y respectively. So as to go something like this:
    private void maybeShowPopup(MouseEvent e) {
         if (e.isPopupTrigger()) {
              int x = e.getX() - 60;
                  int y = e.getY() - 90;
                       popup.show(e.getComponent(), x, y);
    }Or something to that effect. You simply alter the coordinates(x, y) to reposition the popup starting point. I did not test the above code as this is purely a fictional example. Hope this helps. Also if you need help measuring screen pixels here is a cool little program called Calipers that will help. http://www.iconico.com/caliper/

  • How to make configurator not change the lock screen

    i manage about 300 ipad mini's for a school district and i use apple configurator once a month to manually update the ios and apps on the ipads. i have a grade level that uses pictures of the kids for the lock screen to identify whose ipad is whose. the issue is when i plug them into configurator to update them it always resets this lock screen, how can i make it so that the lock screen is not effected? All of my ipads are supervised, and i do not have the option of removing the supervision from that grade level.

    If the phone is locked the only call you can place is to 911 (or its local equivalent) without unlocking it.  You can also take a picture, but not review other photos.
    Market Information? Come read The Market Ticker!

  • How to make Nano NOT appear on Mac desktop as connected drive when I plug in to recharge it? Just want charging, not syncing, and don't want to unmount drive each time.

    I have a 6th generation iPod Nano.
    I almost exclusively use it as an FM radio and as a pedometer -- so far I have not loaded any songs onto it for listening, nor do I intend to in the future.
    Here's my problem:
    When my Nano runs out of juice, I have to use the charging cord to plug it into to my iMac's USB port to recharge the Nano. However, whenever I do so, two different (unwanted) actions happened:
    First, the act of plugging in the iPod auto-launched iTunes, for syncing. I solved this problem by finding the preference check box for launching iTunes when connecting an iPid, and UNchecking the box. That worked, problem solved.
    However, the second automatic action is that the iPod appears as a connected drive on the iMac desktop, as any external device with a drive would appear when connected to any Mac. But I have no need for this to be happening -- I don't intend to upload anything to the iPod, nor to sync it, or whatever -- the only reason I ever connect the iPod to the iMac is to RECHARGE the iPod, not to tinker with the contents of what's on it.
    The problem is, every time I then want to disconnect the charging cord, I have to manually "unmount" the iPod drive by dragging its desktop icon to the Trash, when then allows the "it is now safe to disconnect your external drive" state to obtain, allowing me to then unplug it without getting a warning message telling me I shouldn't have just disconnected a connected drive without first unmounting it.
    This wouldn't be such a bother, except that the 6th generation iPod Nano has a new "feature" which makes it impossible to see how far along the charging is progressing while it is still in the act of charging. Thus, the only way to know if it is has become  fully charged is to unplug it, and look at the battery monitor. While is it still connected and charging, all that displays on the iPod is the "charging now" battery icon, which does not reveal just how the charging is progressing, or if it is fully charged yet. (My iPhone, by way of contrast, displays during charging a battery icon which reveals how far charged it is by that point.)
    As a result of this Nano "feature," I often find myself having to connect and disconnect the Nano two or three or more times each time I'm charging it, so I can simply check how far along the charging has gotten, since I want to disconnect it as soon as it has finished charging and get back to using it.
    But so far, I have not been able to find any kind of setting or preference which allow me to identify this device as one which I DON'T want to "mount" each time it is plugged in.
    All I want to do is just plug in the iPod, and be able to unplug it, without having to to ANY shenanigans on the computer itself. Just plug in = recharging, unplug = not charging any more. Simple.
    Question: is there any way to achieve this? Or is it simply not possible, and must I manually unmount the iPod's drive (more than once, usually) each time I plug it in for recharging?

    I should also point out that when I connect my iPhone, it DOESN'T appear as a connected drive on the desktop. Not sure how this can be so, since the iPhone also has a drive and also functions as an iPod if I want it to. I must have changed some setting to achieve this non-appearance, but don't remember what I must have done.
    What's the secret?

Maybe you are looking for