Ctrl-click deselects item in JList

I have JList with ListSelectionModel.SINGLE_SELECTION
and I need exactly one item to be ALWAYS selected.
But when I make ctrl+click on already selected item then
this item is deselected and isSelectionEmpty() returns true.
Does anybody knows how to disable this feature?

One would think the question would be better asked in the Swing section.
Why don't you use a JComboBox, because it's exactly made for taking a single selection from a list of items.

Similar Messages

  • Ctrl + Click = ERRORS!!!

    I have no clue what this problem could be but here is the issue. When I Ctrl + Click any item, It doesn't display the options, instead it shows a capitol letter followed by an interger:
    http://www.implicted.com/ErrorOptions.jpg
    When I Secure Empty the trash, this displays:
    http://www.implicted.com/ErrorDelete.jpg
    Certain files have messed up information displayed under the item. "IV9" "IV6" "IV8" etc.
    http://www.implicted.com/ErrorIV9.jpg
    If anyone can help... please do!!
    Thanks.
    Powerbook G4 12"   Mac OS X (10.4.9)   1.2GB Ram

    Hi
    Try relaunching the Finder:
    cmd-alt-esc
    Select Finder
    Click Relaunch
    If that doesn't work try going into Users/shortname/Library/Preferences, moving com.apple.finder.plist to the Desktop & then restarting. If that works, trash the plist on the desktop.
    Steve

  • Help implementing mouse multi record select deselect with shift/ctrl click

    Forms 10.1.2.3 on Solaris Sparc 64 bit
    We are trying to implement mouse multi record select/deselect using shift and ctrl click. I have read that you need the appcore library to do this but because we aren't using Oracle Applications (EBS) we can't have the appcore library.
    Has anyone implemented this function without the appcore library?
    Thanks

    Why not just use a CheckBox to indicate the selected records? The downfall to almost all methods is that you end up looping through the block to see which records are selected. An alternative to this is to use a record group to record which the selected records. I created a nice little wrapper package to work with Record Groups (RG). Take a look at Forms - Record Group Processing (Duplicate Value Checking). As the name suggests, this example demonstrates how to use an RG to perform duplicate checking, but you can easily adapt the process to keep track of selected records. I use RG's for this all the time. By using the RG, it eliminates the need to LOOP through the datablock - which can be very time consuming. Instead, you loop through the RG and only navigate to the specific records you need too in order to process that record. Looping through the RG is much faster than looping through the block - especially if you have a lot of records displayed in your block.
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • How to override Ctrl-Click behavior in Java L&F

    On the Mac, Ctrl-Click is the popup trigger. While Java L&F designers were obviously aware of this (it is warned about in the Java Look and Feel Design Guidelines, 2nd ed, page 106). However, just two pages later (page 108), they then generically specifify that Ctrl-Click is used in lists and tables to toggle the selection.
    The implementation of the Java L&F does not appear to consider the Mac's use of Ctrl-Click and still toggles selection. If there is an additional mouse listener that shows a menu in response to the popup trigger, it will ALSO open the menu on Ctrl-Click.
    What is the best way to overide the Ctrl-Click behavior in JTable etc. to NOT do the toggle selection? Note that this is a mouse event and not a key event, so it can't be turned off or changed by the getActionMap() mechanism.
    Also, does anyone know what the "Command" modifier on the Mac (Command-Click is supposed to toggle selection on Macs) shows up as in the InputEvent (isMetaDown(), isAltGraphDown()...)?

    Try extending the JList and override the processMouseEvent(MouseEvent evt) method and show your popup menu when the user clicks the mouse while holding the CTRL key down. The code below demonstrates the same.
    import java.awt.BorderLayout;
    import java.awt.event.MouseEvent;
    import java.util.Vector;
    import javax.swing.JFrame;
    import javax.swing.JList;
    import javax.swing.JOptionPane;
    import javax.swing.JScrollPane;
    import javax.swing.ListModel;
    import javax.swing.WindowConstants;
    public class Temp extends JFrame {
         public Temp() {
              super("Temp");
              setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
              String [] items = {"One", "Two", "Three", "Four", "Five"};
              JList list = new MyList(items);
              JScrollPane scroller = new JScrollPane(list);
              getContentPane().add(scroller, BorderLayout.CENTER);
              pack();
              setVisible(true);
         class MyList extends JList {
              public MyList() {
                   super();
              public MyList(Object[] listData) {
                   super(listData);
              public MyList(Vector listData) {
                   super(listData);
              public MyList(ListModel dataModel) {
                   super(dataModel);
              protected void processMouseEvent(MouseEvent evt) {
                   System.out.println(evt.isPopupTrigger());
                   int onmask = MouseEvent.CTRL_DOWN_MASK | MouseEvent.BUTTON1_DOWN_MASK;
                   if(evt.getModifiersEx() == onmask) {
                        JOptionPane.showMessageDialog(this, "Control + click");
                   else {
                        super.processMouseEvent(evt);
         public static void main(String[] args) {
              new Temp();
    }Hope this helps
    Sai Pullabhotla

  • How do I open multiple locations from the History after selecting them with Ctrl+click?

    Let's say I want to read some of the Mother Jones and Alternet articles I'd linked to from e-mails over the past in two months. I open my Firefox history. I do a search of the history libary to get a list of all the relevant locations. Then I use Control+click to select the few articles I want to read. I'd think Ctrl+O would open all those selected, but it doesn't. There must be a more efficient way than what I'm doing now, which is to open a new tab in the browser window, go to history, double click one line, wait for the page to load; open a new tab, go back to the history search results, click on a new location, wait as it loads, repeat.

    Where are you viewing your History? <br />
    Have you tried the History Sidebar? {Ctrl + H} <br />
    You can {Ctrl + Click} the pages you want to open in new Tabs, one at a time. <br />
    Also, if you have your Options > Tabs pref deselected for '''When I open a new tab, switch to it immediately''', it might be less distracting with all those pages opening in the background.

  • Show Package Content option not available in Ctrl+click

    Hi,
    I just installed Mozilla's Thunderbird email SW (v. 1.5.0.5) and I'm trying to import the mail I had accumulated previously in Mail 2.1 (this is under OS X Tiger 10.4.7, sadly running on a pretty old G4 400 MHz, AGP Graphics). The instructions from Mozilla seem pretty simple:
    <<How do I import e-mail messages from mail.app (MacOS X)?
    Go to ~/Library/Mail/ and root out the .mbox files in the finder. These are actually OSX packages. Select Show Package Contents and a new window will open revealing several files including a file named mbox. Copy that file to the subfolder called Local Folders in the folder Mail in your profile folder and rename it to something meaningful. This process needs to be done for each of your mailboxes. Finally start Thunderbird to see the new mail folders.>
    Well, I'm also a recent convert to OS X ('twas about time! I was still running OS 9.2.2 less than a month ago!), so I had never heard of "Show Package Contents". It seems that I should be able to see this in the contextual menu when I Ctrl+click (or right-click; I have a multi-button mouse) on the object (the *.mbox folder in this case). But my contextual menu has no such option.
    Any ideas?
    Louis

    Hmm... They do look like folders, don't they? Perhaps they were thinking of an earlier release of OS X...
    Anyway, what you describe is close but not exactly what I see. Let me describe to make sure the situation is clear: I am in home>Library>Mail>Mailboxes. Inside this, I have a set of *.mbox "folders", each of which contains only two items: an "info.plist" file and a "Messages" folder. The "Messages" folders (within each *.mbox folder) contain individual messages with the .emlx extension.
    So the *.mbox "folders" contain no mbox file that I can grab and move (and no index, content.index, of table of contents that you mention). Perhaps these are "hidden"? But I can't find an option anywhere to "Show hidden files".
    Ideas?
    Louis

  • Can't "open with" using finder ctrl click

    Hi-
    Sometimes when in the finder and I want to open an image in photoshop instead of preview i can ctrl click and select 'open with'. However, sometimes when I ctrl click on the image, the image is unselected and the only options that come up are the standard finder window options. Sometimes, when I try multiple times it will eventually allow me to "open with" but when I do - it opens up a completely different file than I ctrl clicked on.
    Any ideas why I am able to do this on some images and not others? I have noticed this in earlier versions of osx as well.
    ps- yes i am ctrl clicking on the image's icon (not next to it or the name)
    Thanks!!!

    Personally I have never seen this. If you have it on several different machines I would suspect something that you routinely install is causing a problem, perhaps some Contextual Menu item that you use.
    Far simpler way to open a file in another application is to simply drag the file onto the application's icon in the Dock. I do that all the time. I often have jpegs set to open in Preview by default, since Photoshop is such a memory hog and takes forever to launch. Rather than change this preference when I actually want to open and work with a file in PS I simply drag it to the PS icon.
    Francine
    Francine
    Schwieder

  • Finder refreshes if I right click (Ctrl-Click)

    Every-time I try to right click or Ctrl-Click on an icon, it refreshes my Finder. I have tried the black optical mac mouse, a Logitech MX 700 wireless, and a regular Logitech optical. When I say refresh I mean more of a restart. My open windows are closed and my desktop icons go away then come back. My open apps are not affected. Help!!!
    Power Mac G5   Mac OS X (10.4.6)  

    Hi Matthew,
    It sounds like it could be an item in /library/contextual menu items. Drag the contents of that folder to the desktop and test again. If that sorts it, put the items back one at a time to find the culprit.
    If that's not it, navigate to ~(yourhome)/Library/Logs/CrashReporter/Finder.crash.log open it and paste the contents here for the latest Finder crash and maybe we can figure what's going on.
    -mj
    [email protected]

  • Shift-Click, Ctrl-click weirdness

    This is just a rant, nothing much to be done about it, I suppose.
    I've always favored Mac UI principles over Windows, since they were articulated better.
    Unfortunately, LabVIEW, even on OS X, has adopted Windows principles, even where they clearly don't make sense.
    CASE 1: Windows Shift- click REMOVES things from selection.  In Explorer (Finder), create a list of 5 folders: A, B, C, D, E.  
    Click on A: selection is [ A ]
    Ctrl-click (command-click) on E: selection is [ A  E  ]
    Shift-click on C
       OS X:  selection is [ A  C  D  E ]
       Windows:  selection is [ C  D  E ]  {why remove the "A" ? Do you really think that's the intent?}
    CASE 2: Same test, except use a LabVIEW LIST BOX with A, B, C, D, E
    Click on A: selection is [ A ]
    Ctrl-click (command-click) on E: selection is [ A  E  ]
    Shift-click on C
      LV OS X:  selection is [ A  B  C ] removes E for some reason.
      LV Win , same as explorer. selection = [ C  D  E] (removes the A for some reason).
    CASE 3: In Explorer (Finder), create a list of 5 folders: A, B, C, D, E.   
    Click on A: selection is [ A ]
    Ctrl-click (command-click) on E: selection is [ A  E  ]
    Ctrl-click (command-click) on E: selection is [ A  ]
    Shift-click on C
       OS X:  selection is [A  B  C]
       Windows: selection is [ C  D  E ]  ???
    OK, just when you thought LV was adopting Windows all the way, there's this:
    CASE 4: same test, except use a LabVIEW LIST BOX with A, B, C, D, E
    Click on A: selection is [ A ]
    Ctrl-click (command-click) on E: selection is [ A  E  ]
    Ctrl-click (command-click) on E: selection is [ A  ]
    Shift-click on C
       OS X:  selection is [A  B  C]
       Windows: selection is [ C  D  E ] 
    Since I'm trying to match behavior between a LISTBOX (built-in behavior) and a TABLE (I create the behavior) this makes it difficult.
    < rant = OFF >
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks

    Shift click in windows doesn't actually remove items from a list.  It is more like adding items to a list from the first click to the 2nd click.  If you already having something else selected that is not in that range, the it does remove the item.
    What you want to do is a ctrl-shift-click.  Ctrl is the modifier to actually add to your selected items.  Shift is the modifier to select a range of items from first click to 2nd click.  Doing both in combination keeps your original list while adding to it with the "range" of the new items you are adding.
    Now how well LabVIEW adopts the Windows principles, I can't say.

  • Preview plugin does not allow Ctrl-Click in Safari

    This used to work. Was on TDCanadatrust.com and the PDF of my quarterly financial statement loaded ok but I was not able to Ctrl-Click anymore in order to open the pdf in Preview and hence I was not able to save the pdf or print it.
    I have deleted my Safari preferences.
    Ideas?
    Mark

    Hi Hawaiian Starman - thanks again for the response.
    The MacBook used to zip with my DLink router but now it crawls - inconsistently.
    Other contextual items:
    I also have a Windows Vista HP Laptop and it works very well with the DLInk and web surfing.
    I have run disk permissions and Disk Utility and Onyx and Maintenance software.
    I have run the hardware checker at startup - all seems fine.
    I have re-installed Safari.
    I have re-installed Mac OS X Tiger from the DVDs.
    I have re-started the cable modem and the router.
    I have hard coded the DNS server under the MacBook airport profile.
    I have taken the DNS server IP address out again.
    I have created a new Airport profile.
    I tried FireFox and Opera and same issues.
    I have reset Safari cache and have deleted all plugins.
    Anyway - mind boggling. I have noticed there have been a lot of MacBook wifi issues recently on the Discussion boards though.
    Mark

  • Ctrl-Click Window Settings

    Hello All,
    I'm working on an animation in Flash, and I'm doing a lot of right-clicking at the bottom of the screen when working on the timeline. It's really annoying to have to roll-over the down arrow and wait for the window to scroll every time. I was just curious if there was a way to set the ctrl-click window to appear higher, displaying everything, rather than forcing the user to wait for the scroll.
    I know I can just change the location of the timeline, but I like it down there.

    So what I'm getting is that there's no way to set the ctrl-click menu to display all items rather than scroll?
    I don't see how you'd do it. It would have to be a choice in the application preferences, if it can even be done. A contextual menu is going to appear according to Apple's programming guidelines and API's. If it has room to go down, it will.
    The only way to fix it is a hack that requires even more work?
    It's not a hack. Just grab the top gray bar of the entire Flash workspace and move it down on the screen so part of the application window is off the bottom of the screen, but still showing the timeline dashes. Having the timeline that close to the bottom of the screen forces the contextual menu to open in an upward manner. There is no other way to do what you want.

  • Ctrl Click

    When I ctrl click any pdf docs then choose "open width" I get the ff:
    Adobe Acrobat
    color Sync
    Discover RE
    Discover RE
    Path Finder
    Path Finder
    Photoshop Elements
    Preview
    Quicktime Player
    Safari
    Shiira
    Yep
    Yep
    As you could see some items are repeating. How do I correct this? Other files on the other hand I get items that are no longer in the system.

    Hi, Sidney.
    See my "Resetting Launch Services" FAQ.
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X
    Note: The information provided in the link(s) above is freely available. However, because I own The X Lab™, a commercial Web site to which some of these links point, the Apple Discussions Terms of Use require I include the following disclosure statement with this post:
    I may receive some form of compensation, financial or otherwise, from my recommendation or link.

  • Modify ctrl + click menu

    I'd like to modify the "ctrl + click menu" so that "Search in Google" has the option to bring up a new Tab. Any help would be great.....rob

    Adrian Clarke1 wrote:
    Edit: Actually I can't get anything to open selected text>control click in anything but the same tab no matter what key I hold while clicking "Search in Google". Which was OP's original problem... Am I missing something or is it a Leopard feature? (I'm back on Tiger, Leo too slow on my aging iBook.)
    I'm not certain – I'm using Leopard. But make sure you're following the right sequence:
    1) Highlight some text.
    2) Control-click on that text
    3) Release the Control key
    4) Scroll to "Search in Google" so it's highlighted
    5) Command-click on that menu item
    That might be what you tried; I can't quite tell. But that works for me every time.
    Message was edited by: Rachel R

  • Item is not available for reference to Excise Invoice, Deselect Item OK!

    Hai,
    I am doing a Sub contracting scenario, in which the excise is applicable to main material, i have maintained condition records, captured excise But while doing GRN i am getting Item is not available for reference to Excise Invoice, Deselect Item OK!
    Message no. 4F279
    above errror
    Plz solve my problem

    Whether you tested case in development server ???
    Are you sure SAP Note applies to our version & support package level ?

  • How can I force Firefox to override javascript when opening links with ctrl+click?

    There are certain sites that always open up a link in the active window despite said links being opened by ctrl+clicking it. Basically what happens is that a java script on the site forces the active window to load the link while at the same time Firefox follows the ctrl+click command and loads it in a new tab. You end up with two tabs with the same information and always have to go back in your original tab to be able to open other links.
    Usually you can open the link the way you want by right-clicking and selecting 'Open Link in New Tab' but for some reason ctrl+click is treated as if it was a regular click. How can I stop this from happening and force Firefox to ONLY load the new tab?
    This problem is not specific to the version of Firefox I'm using or the operating system, but seems to be caused by java script on the site. Disabling java scripts makes the problem go away but sometimes it also disables the sites.

    If you're trying to protect your browser from hackers, I'd recommend setting up a master password for your saved passwords. Other than that, your anti-virus and firewall are responsible for keeping your computer safe.
    If you're trying to protect your browser from someone else (i.e. somebody who can physically use the computer) just lock your entire computer with a password. If someone else has to use it, you could try letting them use the guest account.

Maybe you are looking for

  • Two different Apple ID's in the same house

    My wife and I have an iMac, MBP, iPhone, iPad and soon to be another iPhone. Today I tried to share a song from her iTunes by using Home Sharing.  I do not know what her password was and couldn't get in touch with her at work...so, I logged hers out

  • Why can't I import videos to my Macbook Air from a Samsung Galaxy Note 3?

    Hey guys Just wondering why i cant imort videos to my mac from a Samsung Galaxy Note 3. After much trial and error i managed to upload all photos however i cant share any videos to my mac at all, i have tryed: Google Drive, Email, Normal USB transfer

  • Adobe Flash Player 10 download not working.

    I have downloaded Flash player 10 with no success in using it. I have gone to the 32 bit process with same result. I used to be able to run things on here. Was that a old version? Why didn't that old version stay? How do I get it back?  Please advise

  • Diffrence between when-validate-item and post-text-item trigger

    What is the Diffrence between when-validate-item and post-text-item trigger, when they are written for the same item and the basic diffrence between when-validate-item and post-text-item trigger.

  • Files Missing When Printing, i.e.x2utilkd.dll (Xerox)

    We are seeing an issue pop up and it is occuring more frequently of late.  We have Windows Server 2008 R2 print servers, Windows 7 32 bit clients and Xerox printers.  A user will call with a problem either (1) printing from Office and it prints out s