Results 1 to 3 of 3
Like Tree1Likes
  • 1 Post By gimbal2

Thread: How to disable Ctrl select multiple entries in a dialog ?

  1. #1
    anes_pa is offline Member
    Join Date
    Feb 2015
    Rep Power

    Default How to disable Ctrl select multiple entries in a dialog ?

    Dear Friends,
    I am using the following code to create a dialog , but my need is user can select only 1 entry . Using this code
    can select multiple items by pressing Ctrl ... How it can avoid ... My current code is

    Java Code:
    SecureCloudStorage_Service service = new SecureCloudStorage_Service();
                List<String> files = service.getSecureCloudStoragePort().listFiles();
                SelectFileDialog dialog = new SelectFileDialog(this.getFrame(),true,files);
                Toolkit toolkit = Toolkit.getDefaultToolkit();
                Dimension screenSize = toolkit.getScreenSize();
                int x = (screenSize.width - dialog.getWidth()) / 2;
                int y = (screenSize.height - dialog.getHeight()) / 2;
                dialog.setLocation(x, y);
    Please advise me fast


  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Washington, DC
    Rep Power

    Default Re: How to disable Ctrl select multiple entries in a dialog ?

    You'll have much better luck if you post an MCVE instead of a disconnected snippet. We have no idea what a SelectFileDialog is.

    Recommended reading: How to Use File Choosers (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Swing Components)
    How to Ask Questions the Smart Way
    Static Void Games - GameDev tutorials, free Java and JavaScript hosting!
    Static Void Games forum - Come say hello!

  3. #3
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Rep Power

    Default Re: How to disable Ctrl select multiple entries in a dialog ?

    Please advise me fast
    Hold your horses, one thing at a time. So you solved your previous problem then?
    KevinWorkman likes this.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. Can we disable CTRL+X option in excel using XSSF poi.
    By srikanth152 in forum Apache POI
    Replies: 1
    Last Post: 05-07-2013, 10:41 AM
  2. Disable Text Select without Disabling Right Click
    By tetrabyteluke in forum New To Java
    Replies: 10
    Last Post: 03-29-2012, 05:58 PM
  3. Replies: 0
    Last Post: 04-21-2011, 08:21 PM
  4. Printing multiple user entries.
    By mConfused in forum Advanced Java
    Replies: 2
    Last Post: 04-09-2010, 12:44 PM
  5. How to Disable the ctrl + keys using java
    By jazz2k8 in forum Advanced Java
    Replies: 7
    Last Post: 07-29-2009, 07:08 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts