Disabling WINDOWS CTRL+C in Java Application

Hello Friends,
I want to use CNTRL+C in my SWING Application. But in Windows CTRL+C is used for COPY. I want to use CTRL+C for different purpose. So I want to disable WINDOWS CNTRL+C in my application.
Is there any way to achieve this?
Thanks in Advance
Abhijai

Just one suggestion:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.table.*;
public class DisablingControlC {
  Object[][] data = {{"aaa","bbb"},{"ccc","ddd"}};
  String[] columnNames = {"000","111"};
  JTable table = new JTable(new DefaultTableModel(data,columnNames));
  JButton button = new JButton();
  private JPanel makeUI() {
    KeyStroke ks = KeyStroke.getKeyStroke(KeyEvent.VK_C, Event.CTRL_MASK);
    InputMap im = table.getInputMap(
        JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
    im.put(ks, "different_purpose");
    table.getActionMap().put("different_purpose", new AbstractAction() {
      public void actionPerformed(ActionEvent e) {
        if(table.getSelectedRowCount()>0) {
          System.out.println("copy");
          table.getTransferHandler().getCopyAction().actionPerformed(e);
        }else{
          System.out.println("different purpose");
    button.setAction(new AbstractAction("clear selection") {
      public void actionPerformed(ActionEvent e) {
        table.changeSelection(0, columnNames.length, false, false);
        table.clearSelection();
    button.setFocusable(false);
    JPanel p = new JPanel(new BorderLayout());
    p.add(new JScrollPane(table));
    p.add(button, BorderLayout.SOUTH);
    return p;
  public static void main(String[] args) {
    EventQueue.invokeLater(new Runnable() {
      public void run() {
        JFrame frame = new JFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.getContentPane().add(new DisablingControlC().makeUI());
        frame.setSize(new Dimension(320,240));
        frame.setVisible(true);
}Edited by: aterai on 2009/01/23 16:08

Similar Messages

  • How to make use of Windows authentication from my Java application

    I have a Java application, Instead I design one more login page for my application, I want to make use of Windows Authentication.
    How should I use that windows authentication in my java application
    can any help me in suggesting a solution

    How will they be able to access your application if they aren't users of the system?

  • How can I execute an IE browser window from within my java application?

    I am programming a java application that requires me to execute a browser application and point to a specific web site. How can I do this? I cannot seem to find any examples on the web.

    Hi Heals,
    This forum is for discussing Measurement Studio for Visual Basic and is not really a good place to ask general purpose Java questions. I suggest searching one of the comp.lang.java.* newsgroups at http://groups.google.com/.
    Off the top of my head, though, I would say take a look at the Runtime.exec method.
    - Elton

  • Access Web Dynpro Java application through direct URL

    Hi Guys,
    we have a requirement that there is a link in web dynpro abap screen, click on it will open a new ie window running web dynpro java application, so what i did is i have given direct url link for that web dynpro java application:
    as this:
    https://servername:50001/webdynpro/dispatcher/sap.com/ess~lea/TeamView
    but after i clicked on this url, it pop up 1 window, after i entered id & passoword, it is showing this wd java appl, but there is 1 grey image on top of the view & "welcome xxxx"; below that is the actual view from wd java.
    the layout is :
    grey image----
                             welcome xxxxxxxx
    Teamview
    actual ivew
    how to remove the grey image & the "welcome xxx"? it looks like masthead but we dun need it.
    thanks

    Hi Feng,
    Actually what you are seeing using the application URL and after giving the credentials on Portal is a portal screen which carries the theme as well. Therefore, you will be able to see the masthead with header and Portal User Name. So, use the URL generated by preview of a web dynpro iView in your component to avoid the masthead.
    Regards,
    Tushar Sinha,
    Infosys,
    Hyderabad

  • [Solved] Java applications and awesome issue

    Hello Folks,
    I know this issue has been solved before, but it didn't work for me:
    You all know the issue with the grey windows when starting a java application, right? Well, I have that issue too and I'd like to bring that to work.
    I read this article   http://awesome.naquadah.org/wiki/Problems_with_Java   but the workarrounds didn't work (I didn't try the second one with wmname).
    Is there yet any other know workarround? I also tried this one but that one didn't work eighter:
    export AWT_TOOLKIT=MToolkit
    [tectu@mercur ~]$ awesome -version
    awesome v3.4.11 (Pickapart)
    • Build: Apr 27 2012 09:01:08 for x86_64 by gcc version 4.7.0 (nobody@archbuild)
    • D-Bus support: ✔
    [tectu@mercur ~]$ java -version
    java version "1.7.0_03-icedtea"
    OpenJDK Runtime Environment (IcedTea7 2.1) (ArchLinux build 7.b147_2.1-3-x86_64)
    OpenJDK 64-Bit Server VM (build 22.0-b10, mixed mode)
    [tectu@mercur ~]$
    Does somebody have a working solution for me?
    ~ Tectu
    Last edited by Tectu (2012-05-24 11:21:17)

    Oh, the 'wmname LG3D' solution did work indeed.
    I was just curious about saying that I use a different window manager, that I thought I'm just gonna try the two other solutions.
    Thank you guys!

  • Excel Sheet Drag & Drop into Java Application Q

    New to this forum. Have a question regarding the ability to drag and drop an Excel Sheet from an open Excel file onto a Java application. A friend has been able to drag and drop an Excel file from Windows Explorer onto a Java application and then read the sheets to select what you want and display/use the information in a particular sheet, I'd like to take it a step further to so that the user has the ability to be working in Excel and then drag and drop individual sheets into a Java application as they desire. Is this latter option possible?

    Hi,
       Hope the below links helps...
    Re: upload & download files 
    https://wiki.sdn.sap.com/wiki/display/WDJava/Uploading%20excel%20file%20using%20WebDynpro%20for%20Java
    http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3417600)ID0729285250DB01215080400348251106End?blog=/pub/wlg/6603
    Thanks,
    Prakash

  • How can I run a java-application on starting of Windows 2000

    How can I run a java-application without any user on starting of Windows 2000?
    For example, if the computer is restarted and nobody enter into it yet, my java-application should run anyway.
    How can I do that?

    Hi, you have to put it in a Windows service.
    To do this you have a program, Srvany.exe that allow to insert a .exe or .bat program in a Windows service.
    For example, i develop a program, TomcatGuardian and i put it in a service because i need to run it in a server without Administrator logged in.
    Regards,
    Ivan.

  • How to Run a Hello World Java application on WIndows Mobile

    Hi!
    We have a sample Plug-in environment Java application downloaded from http://www-128.ibm.com/developerworks/library/os-ecl-ercp/index.html - IBM library.
    We have downloaded the source files org.eclipse.testworkbenchapp_1.0.0.jar and tried running the application on desktop PC, this worked fine.
    We are using Eclipse 3.2 to run this Java application on Desktop.
    Now, we are trying to run the same application on Intermec Windows Mobile 5.0 device.
    1. The device has IBM J9 ? WebSphere MicroEnvironment MIDP 2.0 for Windows Mobile2003 installed in it.
    2. On installing this on Windows Mobile, in Start ? Programs ? we find MIDlet HQ - on launching this, opens a window with Install button.
    3. On Click on Install button, another window opens which asks for URL to install.
    4. In the URL Edit box, I give file:////Org.Eclipse.testWorkbenchapp.feature_1.0.0.jar which is present in \MyDocuments\Update site folder copied from desktop workspace via Active sync ? As mentioned in the above IBM library site.
    5. I have also tried file:////MyDocuments\Updatesite\Org.Eclipse.testWorkbenchapp.feature_1.0.0.jar as input to URL.
    6. On click OK, I get an error titled AMS Error with description The application descriptor was missing the required MIDlet Name field.
    I am held up here and not able to move further.
    As mentioned in the above IBM library site I tried downloading the update site folder via Eclipse ? Software Updates ? Find and Install in Help menu.
    I selected Search for new features to install and browsed the Update site folder location present in my Eclipse workspace. This also does not work.
    Any help in this regard in greatly appreciated. Thanks in advance!

    I would ask such questions in the J2ME forums, or even better in a websphere forum, like here:
    http://www-128.ibm.com/developerworks/forums/wsdd_forums.jsp

  • To launch a java application in Windows environment

    hello,
    I need to distribute one stand alone application, that I made using NetBeans, for sale it.
    I know that this is not a so simple problem, because delivering the program to one client you cannot simlpy say him to launch the jar file....
    I saw that, in the Windows environment, program like eclipse or netBeans run thruogth an .exe file, that I think is a program that its purpose is to define the java environment for the application in the particular host operative environment .
    Perhaps they are corporations like InstallShield (now Macrovision) that sale programs to solve this type of problems..., and I already used this type of programs to install some my
    applications that I coded in languages different than java.
    But before to look for one of them, I should like have more informations how this problem fits in java language, knowing that java is different to other languages because use JRE and have proper tools, how JWS and JNPL, that concern with this problem.
    ...Looking in the forum I had not much help..., but I saw that someone uses to write launchers program in different language, like C, as well I had not so much detailled instructions about how to do it.
    In order to solve my problem I should like have, from some one that already made it, some general information about how he realized the commercial installation of java applications in the most used Operatve Systems (particullary Windows), and possibly to have links to web sites for good explanations, including advantages to buy apposite commercials installation programs too.
    thank you very much
    tonyMrsangelo

    You can distribute it as an executable JAR so users will run it by double clicking. The would be required to have JRE installed.
    You can distribute it online via WebStart. Users need JRE but it's easier to manage updates and distribution of new versions.
    You can distribute it with AjaxSwing, a product that deploys Swing applications as AJAX websites so you don't need JRE at all.
    You can create EXE files using many of the products available. Google for it and you'll get lots of hits.

  • Disable Window keys ALT+TAB, CTRL+ALT+DEL

    Hello i am developing an application in which i need to catch the ALT+TAB and CTRLALT+DEL key events and handle it in my own way.
    The default action of showing the next window or the task manager should not take place.
    In the event handler i have given
    eventName.consume();
    also.But the default handling is also done.
    How do i stop the default action from being done?

    Windows will not allow any application to catch the CTRL+ALT+DEL keystroke. In Windows NT-kernel OSes, this keystroke brings up a menu which, among other things, allows the user to change his or her password. If an application could intercept CTRL+ALT+DEL, it could present itself in such a way as to look just like that dialog. Then, if a user typed his or her password into that dialog, the program could log or transmit that password plaintext, severely violating security.
    All sorts of exploits like that would be possible. This is why you can't block system keystrokes.
    Is there any particular reason you need to override this behavior? Perhaps we can help you find another solution to whatever problem made you decide you wanted to catch those keystrokes in the first place.

  • File association on Windows for Java application?

    Sorry for the Windows-related question, but I thought maybe some fellow Java hackers had run into the same problem...
    We have a Java application targeted for multiple platforms, including Windows. We also have a certain file extension for our data files, call it .abc. Our customers would like the following functionality in Windows Explorer when the app is installed on Windows:
    1 - custom description for .abc files
    2 - custom icon for .abc files
    3 - double-click an .abc file to open it in our application
    It's easy enough to get this functionality by setting appropriate registry keys:
    HKEY_LOCAL_MACHINE\Software\Classes\.abc: @ = OurApplication.abc
    1 - HKEY_LOCAL_MACHINE\Software\Classes\OurApplication.abc: @ = An abc file for OurApplication
    2 - HKEY_LOCAL_MACHINE\Software\Classes\OurApplication.abc\DefaultIcon: @ = <path>\OurApplication.ico
    3 - HKEY_LOCAL_MACHINE\Software\Classes\OurApplication.abc\shell\open\command: @ = "<path>\OurApplication.exe" "%1"
    This works great, except you have to restart Windows to get the changes to take effect. Does anyone know how to get the Windows shell to update itself to reflect these new Registry keys without restarting Windows? I've seen the SHChangeNotify function, but I can't call Windows API functions easily from the installer.

    rundll32.exe may be of use...
    Here are some samples of how to use it: http://dev.remotenetworktechnology.com/cmd/rundll32.htm
    Google for more.
    - K

  • Calling a  java application in windows enviroment from a browser

    so for example first you install my java application.
    Then you surf to www.example.com and the page on that site calls my application installed on windows. Is this possible?
    thanks

    Yes. With Webstart, you can create a link that'll run a Webstart-distributed app when clicked. "Autoclicking" this link using Javascript should be easy.

  • Is it possible to Disable Right Mouse click In WebDynpro Java Application??

    Dear Experts,
    Is it possible to Disable Right Mouse click In WebDynpro Java Application??
    If yes then kindly suggest how.
    Warm Regards,
    Upendra Agrawal

    What is the use-case?
    Armin

  • Starting and stopping applications via a Java-application on Windows/Unix

    Hello,
    I want to start java and other applications via a java application.
    This java application should start several different applications on windows and
    on unix systems and take care of their current state (e.g. running/not running).
    For all applications to be started there are .sh-scripts for unix and .bat-scripts
    for windows. In the scripts there could be a java call, e.g. "java someApplication",
    or some executables could be called. These scripts set the applications' environment etc.
    and start the application finally.
    My java application calls these scripts via the ProcessBuilder API, which is working fine.
    But there is the following problem: on windows, when executing a script that starts
    some other application, the ProcessBuilder gives me process-handle to the started
    process. If calling destroy() on this handle, only the cmd.exe gets killed which
    started the application. The application itself is running on. This is undesired behaviour
    since I want to be able to control the started applications, at least start and stop it which
    is impossible that way.
    On unix, it is working when using
    "exec java someApplication"
    instead of just
    "java someApplication"
    in the .sh-scripts. The exec command substitutes the shell process with the underlying
    process started in the script, so everything is working as expected on unix.
    But how could I get this working on windows systems? Is there any equivalent to the exec
    command on unix? Any suggestions appreciated.
    If something's unclear in my description, please let me know.

    Yes - after looking at this option - I think that's the direction I am going to go. It probably makes sense to give my JMS topics and my BPEL server their own OC4J instances anyway - for a number of reasons.
    Lon

  • Run windows services from java application

    can java application run a windows server
    i have a web server that runing using tomcat and mysql
    can i make a icon in the systray
    that give me the option to (using a menu)
    run the server ,wicth means : tomcat and mysql are runing
    stop the server
    get tomcat stacktrace in a window
    i was thinking about runing tomcat and mysql as services
    and write the systray application using java,
    the systray application should acces window services ,
    and run/stop requierd services.
    what happend on a machine thar runs linux?
    thanks
    shay

    Ok .so it's will be a diffrent way under linux..
    for systray i will use http://systray.sourceforge.net/
    and for services i'll use the
    "net start <Service>" and "net stop service"
    i need to keep track on the service status
    so my Systray status will be updated
    what is the command for getting the status of the proccess
    thanks shay

Maybe you are looking for

  • Can I sync my device (iPhone/iPad) to a new iTunes without losing my old apps?

    My family and I have been sharing the same iTunes account for a while now. We have three iPhones and my iPad all using the same iTunes on our home desktop. I recently got my own Pro and want to creat my own itunes and sync my iPad and iPhone to it. I

  • After security checks my ibank statement page does not load, load indicator around 80% complete then hangs. in IE loads OK.

    == Issue == I have another kind of problem with Firefox == Description == ibank home page loads as does the security check page and accounts page. When specific account selected the loading indicator (bottom right) gets to around 80% then hangs. Trie

  • Query Performance Issue (First_rows hint)

    Dear friends, I am running a query on default optimizer mode (all_rows) but its not picking the right execution plan nor the right index but if changing optimizer mode into first_rows, its running insteadly. Tables statistics for concern tables are u

  • How to add attachment to a BO?

    Hello Colleagues, I am trying to use the dependent object AttachmentFolder to be able to upload document to the BO: [DependentObject(AttachmentFolder)] node Attachement; Then in UI Designer, the node Attachement is bonded to reuse component /SAP_BYD_

  • Yahoo imap push

    Hello all, I just bought the iPhone on Thursday and have been searching the forums for an answer to no avail. I've set up our exchange server at work to Bcc forward everything to my Yahoo! Plus account. If I manually connect via the iPhone, it works