Input methods with non-java interface?

Here's the problem,
I have a C++ GUI which has 2 text fields. I need to be able to trap foreign characters in these text fields without touching any of the c++ code. That is, I need to use Java Input methods to do this. Any leads as to how to accomplish this?

I don't think it's possible. Java IMF works with Java AWT and Swing text components only.

Similar Messages

  • Is it possible to declare method with non-finite argument list ?

    Hi, everyone,
    Is it possible to declare method with non-finite argument list
    and to read values of these arguments inside this method ?
    I'm not talking about main() method (i know it can), but
    values to this method are passed through array. That won't do
    do for me.
    If it is possible, could someone show an example how to do this.

    void method(Object[]o)
    for (int i=0; i<o.length; i++)
    if (oinstanceof Integer)
    System.out.println("is is an integer: "+o[i]);
    else if (o[i]instanceof Point)
    System.out.println("is is an Point: "+((Point)o[i]).x+"/"+((Point)o[i]).y);
    else if (o[i]instanceof String)
    System.out.println("is is an String: "+o[i]);
    if you call it like
    method(new Object[]{new Integer(123), "Hello!", new Point(100, 200), "goodbye!"});then the method will output:
    is is an integer: 123
    is is an String: Hello!
    is is an Point: 100/200
    is is an String: Goodbye!
    this is as powerful as varible parameter counts like in c, and it it typesafe.

  • On iOS7, Korean Language Input Method with serious error.

    Korean Input Method for iOS7 has serious problems with bluetooth keyboard.
    It has absolutely incorrect state transition for the keyboard typings.
    Keyboard input and cursor moving are independently acting.
    On the word processing apps, when the line changing occurs while typing, error comes on the first word.
    It looks like to have very poor performance while typing.
    clearing last status of input and transiting to a new state to a new word-syllable are not working properly.
    Input method on iOS5 is much stable and better than on iOS7.
    iOS7 Korean Input Method really makes me annoying.

    For Apple to see this, you need to repost it at
    http://www.apple.com/feedback

  • CTI integration with Non-Java based Webclient

    Can anybody help?
    I need any documentation concerning the implementation/ configuration of the ICI/BCB with the IC Webclinet installed on a ABAP Stack (non-java version). All info seems to be based on Java based Webclient.
    Any help greatly received
    Rob

    I had a OSS ticket created and from that, what i could understand was that the ICI/BCB version is linked to the version of the CRM software and the associated ABAP Stack. For example CRM 2007 has the ICI  version 3.05 but what you get when you put http://javahost:javaport/bcb is the Java stacks ICI system information. WHich will be like 3.00. And I was asked to ignore that java info.
    What I heard is that the abap stack is the one implements the ICI/BCB Version and from CRM's version you know the ici version behind. But I did not get any mapping of "CRM version to ICI"from the OSS though.
    Hope it provides little more information to your question.
    Regards,
    Elaya

  • Keyboard input bug with non-english chars

    Hi community, i'm facing a weird problem with the following flex application (something very simple, couldn't be more):
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
         <mx:TextInput/>
    </mx:Application>
    The bug is coming only on Google Chrome (on Mac), when i try to enter french special chars in the input field, let's say i try to enter the following letters: éèçà, instead i'll get ÈËÁ‡ (see the following screenshots respectively for Safari and Chrome)
    I tried these browsers on Mac: Safari, Firefox, Omniweb, Opera. And it works like a charm for them. The bug is only on Google Chrome Mac.
    I also tried on Windows with IE6, IE7, Firefox, Opera, Google Chrome. No bug either for them on Windows.
    I've read on the Internet other people on Linux have the same bug sometimes (again, it's just for a couple of browsers and never all the browsers on their platform). I hope I don't have to tell my users to trick with their OS configuration. It's our job to make our apps to fit the visitor, not theirs!
    Does anyone knows a workaround for it? A special configuration to do (compatibility mode with older Flash version 8, 9, something like that?)...

    I just tested Firefox and Chrome on linux, i doesn't work either, but i get different weird chars: éèça
    However, on both mac and linux, if i copy the chars and paste them in the input field, it passes.

  • Java cryption not compatible with non-java?

    I can encrypt/decrypt my text with misc algorithms using the Java crypto API:
    SecretKeySpec key = new SecretKeySpec(key.getBytes(CHARSET), algorithm);
    Cipher cipher = Cipher.getInstance(algorithm);
    cipher.init(Cipher.ENCRYPT_MODE, key);
    byte[] stringBytes = plainText.getBytes(CHARSET); //encode
    byte[] rawBytes = cipher.doFinal(stringBytes); //encrypt
    BASE64Encoder encoder = new BASE64Encoder();
    result = encoder.encodeBuffer(rawBytes); //encode bytes to base64 to get a stringHowever, when using other en-/decryption tools with the same algorithms, keys and plain/crypted texts, it doesn't work anymore, i.e. I can't decrypt text with such a tool that was crypted with Java and vica versa. Is there something missing in my code?

    @ggainey:
    Okay, but how do I get these transformation strings with mode and padding? When I try read the algorithms via
                String [] result = null;
                Set set = new HashSet();
                String serviceType = "KeyGenerator";
                Provider[] providers = Security.getProviders(); //all providers
                for (int i = 0; i < providers.length; i++) {
                    Set keys = providers.keySet(); //Get services provided by each provider
    for (Iterator it = keys.iterator(); it.hasNext(); ) {
    String key = (String) it.next();
    System.out.println("key :"+key);
    key = key.split(" ")[0];
    if (key.startsWith(serviceType+".")) {
    set.add(key.substring(serviceType.length()+1));
    } else if (key.startsWith("Alg.Alias."+serviceType+".")) { // This is an alias
    set.add(key.substring(serviceType.length()+11));
    }//next service
    }//next provider
    result = (String[])set.toArray(new String[set.size()]);
    System.out.println("Algos: "+de.icomps.ICUtils.toString(result));
    I just get this output for DES:
    key :KeyGenerator.DES
    key :Alg.Alias.SecretKeyFactory.TripleDES
    key :Cipher.PBEWithMD5AndTripleDES
    key :AlgorithmParameters.PBE
    key :SecretKeyFactory.DES
    key :Cipher.AES
    key :Alg.Alias.KeyPairGenerator.DH
    key :Alg.Alias.AlgorithmParameters.DH
    key :Alg.Alias.KeyGenerator.TripleDES
    key :KeyAgreement.DiffieHellman
    How can I get/generate the "DES/CBC/PKCS5Padding" style strings?

  • How can I access CAPI 2.0 methods with LabView ?

    I must use CAPI 2.0 (common ISDN interface) method with LabView (graphical interface), the work is to command a ISDN S/T card on PXI Bus, and this card support CAPI 2.0.

    This depends upon what type of interface you have to the ISDN. I assume you have either Basic Rate Interface (BRI) or Primary Rate Interface (PRI). Do you have a DLL to control it? If so, you can use the "Call Library Function Node" VI to access this DLL and just make calls to it. If you have an ActiveX Server, you can use the LabVIEW ActiveX Automation VIs to access it.
    J.R. Allen

  • Contract-first : WSDL vs Java interface

    Hello,
    I am starting to work with web Service.
    Many blogs and articles suggest to write WebServices contract from a WSDL.
    I am a java Programmer. I totally agree with the contract-first and the data-driven communication concept.
    Here is my question: why use WSDL when you can convert any Java Interface and Bean into a WebServices?
    If a tool gives you the possibility to move from xml to java (and vice-versa), why not stay with a java interface?
    What are the pitfalls of using this technique (other than being too easy to change the contract)?

    The main reason why you would want to write WSDL first is to be able to create a more verbose XML schema. For instance, if you take a raw Java interface or class and convert from Java to WSDL/XSD everything ends up being optional because the converters have no idea what is supposed to be required versus what isn't as well as field length restrictions etc. Some of the newer tools may allow you to do this with annotations but I haven't really looked into this.
    Writing the XML schema first allows you to offload more work on the XML parser at run time because it can do the schema validation for you instead of you having to manually perform this. This also allows someone writing their own client to consume the WSDL and be able to generate a client that will do more work than one based off of Java classes (e.g. someone creating a .NET client can let the XML parser do some heavy lifting during the marshalling process before ever sending the request to your web service).

  • Interface methods with Exceptions

    I have an interface like the following
    public interface FooInterface
         void doMethod() throws Exception;
    }I've created a class which implements the interface
    public class BarClass implements FooInterface
         public void doMethod()
              // Code...
    }Why is it that when I compile the class, no warnings or compiler errors are generated when the exception reference is absent. When I change the signature of the class method to become..
    public void doMethod() throws ExceptionThe compiler error that appears is...
    doMethod() in BarClass cannot implement doMethod() in FooInterface; overridden method does not throw java.lang.Exception
    I'm confused. I recall seeing the opposite. That is, aren't compiler errors generated when I fail to add the exception to the implemented method in the class...Isn't that necessary to comply with the contract specified by the interface..

    When you implement an interface (or override amethod in a parent class)
    you can declare that you throw a narrower set ofexceptions--including
    none--because that doesn't violate the interface's(or parent class')
    promise not to throw more than that exception.Then the interface will define only "as bad as things
    could be" (struggling for words here) but will not
    impose requirements on the class to alert calling
    methods that the exception could be thrown.Yes, the interface is declaring a "things will be no worse than this" promise, but the method still has to declare any unchecked exceptions that it could throw. If the interface says throws FooException, BarException, then the implementing method is allowed to throw FooE, BarE, and any of their children. But if it turns out that my implementation only throws FooE, then I can declare throws FooE and skip the BarE in the implementation. If I also throw BarE, then I have to declare it. If the implementation also throws BazE and doesn't declare it, the compiler will complain about throwin an exception without declaring it, but if I declare it, then I'm violating the interface's contract, and the compiler will complain about that.
    So which exceptions are declared/thrown is bound by a couple of things:
    1) All methods must declare all the unchecked exceptions they throw (or superclass(es) that encompass those exceptions).
    2) Any method that implements an interface cannot declare or throw any unchecked exceptions outside of what the interface declares.
    2a) But it can declare/throw less
    2b) But it still has to declare what it throws.
    >
    A user of your class who codes to the interfacestill has to handle the
    exception that the interface throws. If they code toyour implementing
    class, then they only have to handle whateverexceptions it throws--i.e.
    a (possibly) empty subset of what the interfacedeclares.
    This sounds like the class should declare that the
    method could throw an exception... I'm not sure what
    you mean by code to the interface vs code to the
    implementing class..I've compiled a class which
    implements an interface, the method in which includes
    an Exception Specification. The class, however,
    compiles without any mention of the Exception. Are
    you saying that methods which call the method in the
    class, must be prepared to catch the Exception of the
    method which is implemented from the interface,
    regardless of whether it is even announced in the
    class?... It is implicitly passed on then..
    interface Foo {
        void foo() throws FooE;
    class FooImpl implements Foo {
        public void foo() { // I don't throw any exceptions, so I needn't declare anything
            // do nothing
    // coding to the interface--the preferred way. All I know about f1 is that it's a Foo
    Foo f1 = new FooImpl();
    // coding to the implementation. I know that f2 is a FooImpl which implements Foo
    FooImpl f2 = new FooImpl();
    // f1 is a Foo, and therefore can throw FooE
    try {
        f1.foo();
    catch (FooE exc) {
        // handle
    // f2 is a FooImpl, and therefore we know it throws no exceptions
    f2.foo();Now that I think about it, I'm actually not 100% sure that my claims about having to catch only the implementation's exceptions (none, here) if you code to the implementation are accurate. I suggest you put the above code into some boilerplate and see if it compiles.

  • LSMW updating problem with direct input method

    Hi!
    Using version 4.0.0 of the LSM Workbench from 2001-07-01 on SAP R/3 4.7, I need to update the purchase order text and wanted to use the direct input method.  I found a tutorial on SAPTechnical which I followed.  All went well, the input data was converted and at last I got the message:
    "Long Texts in Total : 2
    Successfully Transferred Long Texts : 2
    Non-Transferred Long Texts : 0"
    My trials are recorded in table STXH with date and time and also in the material master change history.  However, the result in the material master is that the purchase order text is NOT updated.
    Can anyone tell me why this might be?

    Hi Santosh!
    First of all, thank you very much for posting an answer.  But unfortunately it was of no help.  I want to update the purchase order text on a material that already has the purchasing and purchase order text views. When I compare the PO text before and after my "Successfuly Transferred Long Texts" there is no change.  I hope that this make it more clear but it is still a mystery to me.

  • Synchronized method in a java class used by many interfaces

    My interface (idoc to file) is using a java class, which has one method that reads a table from a central database and after doing some calculations updates it.
    (The interface instantiate the class inside a user-defined function and calls the method there.)
    The problem is that if somebody sends 100 idocs at the same time, there can be a “dirty read”, I mean, a read just before other interface updates the table.
    We want the following:
    Interface 1:
    -          Read counter from the table (counter = 5 )
    -          Increment counter (counter = 6)
    -          Update table with that counter (table with counter = 6)
    Interface 2:
    -          Read counter from the table (counter = 6 )
    -          Increment counter (counter = 7)
    -          Update table with that counter (table with counter = 7)
    RESULT: The table has the counter = 7
    But what is happening is the following:
    -          Interface 1 reads (counter = 5)
    -          Interface 2 reads (counter = 5)
    -          Interface 1 increments counter (counter = 6)
    -          Interface 2 increments counter (counter = 6)
    -          Interface 1 updates table (table with counter = 6)
    -          Interface 2 updates table (table with counter = 6)
    RESULT: The table has the counter = 6 (WRONG)
    I made the method synchronized. What I was expecting was that only one interface (i1) could enter the method (read the table and update it) while other interfaces running at the same time would have to wait until i1 finished that method.
    My first test indicates that's not happening. Can anybody help me to find a solution?

    Hi Bhavesh,
    If the QOS is EOIO this means that the integration engine manage the call to the mapping program (and all the other blocks) inside an "internal" synchronized method.
    So this means that in this case you do not need to manage the queued access (synchronization) inside your custom java code because it is already enveloped in a queued block by XI.
    The problem that Jorge had can be easily reproduced using the sample code that follows:
    <b>class Synch Object</b>
    import java.util.Date;
    public class SynchObject {
         String strName;
         public SynchObject(String strName){
              this.strName = strName;
         public synchronized void syncWrite(String strCaller) throws InterruptedException{
              Date now;
              now = new Date();
              System.out.println("-- " + now.toLocaleString() + " " + strCaller + " entering syncWrite of " + strName);
              System.out.flush();
              Thread.sleep(1000);
              now = new Date();
              System.out.println("-- " + now.toLocaleString() + " syncWrite of " + strName + " called by " + strCaller );
              System.out.flush();
              Thread.sleep(1000);
              now = new Date();
              System.out.println("-- " + now.toLocaleString() + " " + strCaller + " leaving syncWrite of " + strName);
              System.out.println("");
              System.out.flush();
    <b>class Caller</b>
    public class Caller implements Runnable {
         String strName;
         SynchObject target;
         int intMax;
         public Caller(String strName, SynchObject target, int intMax) {
              this.strName = strName;
              this.target = target;
              this.intMax = intMax;
         public void run() {
              for(int i=0; i<intMax;i++)
                   try {
                        target.syncWrite(strName);
                   } catch (InterruptedException e) {
                        e.printStackTrace();
    <b>class Workbench</b>
    public class Workbench {
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              SynchObject sObj1 = new SynchObject("syncObj1");
              SynchObject sObj2 = new SynchObject("syncObj2");
              Caller c1 = new Caller("caller1",sObj1,2);
              Caller c2 = new Caller("caller2",sObj1,2); '[*CHANGE*]
              Thread ct1 = new Thread(c1);
              Thread ct2 = new Thread(c2);
              ct1.start();
              ct2.start();
    Run the workbench class to see what happen when setting QOS EOIO (the synch object is the same).
    To see instead what happen now (missing synchronization) you have to change in Workbench class the statement
    Caller c2 = new Caller("caller2",sObj1,2); '[*CHANGE*]
    with
    Caller c2 = new Caller("caller2",sObj2,2); '[*CHANGE*]
    The reason is that every instance of the mapping program declare a new instance of the "Synchronized object" so the calls are synchronized inside the same mapping program but not between several mapping program.
    Hope this give you a better idea on this problems with java synchronization, but if you have further doubts (I know it's a little bit tricky ) feel free to ask.
    Kind Regards,
    Sergio

  • How to create a method with an interface parameter?

    Hi there.
    I would create a method with an interface parameter. I mean this:
    public interface MyInt {
        public void method(int i);
    public class SubClass implements MyInt {
        public void method(int i) {
            System.out.println("The number is: " + i);
    public class MainClass {
        public MainClass(MyInt inter) {
            inter.method(10);
        public static void main(String[] args) {
    (*)     new MainClass(new SubClass());
    }I tried to compile this but do not work (incompatible types on (*)) . Is it possible to do something like that or not?

    I compiled and runned this code on my machine and it works fine.
    How did you did to compile and run this code ?
    Did you put each code on its own file or all codes in the same file ?
    I did like this:
    I put each code in its own file and put all in the same dir, after I did:
    javac -classpath . MainClass.java
    After that, I did:
    java -classpath . MainClass
    I hope this help you
    Lucas

  • Avaya(Non-java app) integration with ADF

    Hi,
    We have a desktop application Avaya (non-Java) & want to integrate it with ADF. Currently we do it by passing parameters in HTTP URL. If the user clicks on a button in non-java app, it should:
    (1) open search page of an ADF application and execute search.
    (2) if the ADF application is already open, the button on Avaya app should execute search with partial page refresh. However, the whole page is being refreshed.
    Can you please guide, how to do this with partial page refresh? , as the No 1 is almost achieved.
    Thanks,
    NC

    Hi Shay,
    Below Options were tried for integration. Please have a look at them and suggest if there is any other possible way to Integrate Avaya with ADF.
    1) Calling ADF application with URL parameters.
    Reasons to drop:
    Every time a URL is called the entire page will get rendered again taking some 2-3 seconds which is very critical to the application.
    ADF is capable of handling URL parameters without re-loading the whole page(http://oracamp.com/passing-parameters-adf-application-through-url). But we can't use this inbuilt way as we have many customized developments implemented in the page. This way directly works at AMImpl (at Model level) level. We want the events to be fired at View level. That is backing bean level.
    2) Avaya is capable of dealing with ActiveX (OCX). They sent me 2 DLLs which handles communication between web page and Avaya application. A simulator was also sent (bundle attached herewith). The steps to be carried out for testing are-
    Installation procedures:
    i. Register the DTLCRMINT.ocx file. Start->Run-> Type the command
    ii. regsvr32 <ocx file location>
    iii. Register the DTLINTCMP.ocx file. Start->Run-> Type the command
    iv. regsvr32 <ocx file location>
    v. Double click on the Clinet.exe it would open up a windows application with a Textbox and Command button. Put In the data which needs to be sent.
    vi. Open the CRM Page.html. On opening the OCX would be loaded by default.
    vii. Now clicking the Send Data button on the client application, whatever information is there in the Client Text Box would be sent to the web page.
    viii. From CRM side, the application needs to use the OCX provided, and must wait for the event. On receiving the event the data that is retrieved as a part of the event can be parsed to update the text box and click on the search button.
    Reasons to drop:
    It works fine with basic HTML page. But once integrated with ADF page as an inline frame it doesn't work. We tried to embed the OCX object inside <verbatim> tags, but was not successful. The event fired by ActiveX object is triggered at client side by VBScript function. Avaya's ActiveXs seem to be only working with VBScript according to my understanding. So there was no way for ADF to capture VBScript events.
    ADF is capable of javascript up to some extent. To do a critical application like this, my feeling is javascript is never a good option.
    3) To use a text file. Avaya writes, ADF application reads.
    Reasons to drop:
    ADF can read the text files with normal java IO methods. But only the server directories are visible. So, Avaya has to write the information in the server file. With using a parameter like user name, ADF application can read the file in regular time intervals (with using poll feature) and get relevant information and automatically run the search.
    Initially the idea was to do this at client side. But since this is a web application, file reading at client side is next to impossible. Again when one side is reading and the other side is writing, file access violations may occur.
    4) Another option is if Avaya can offer the value in a web service, the ADF application can get it.
    Reasons to drop:
    There may occur a latency as well as Avaya says they can't offer web services.
    5) The ideal solution is, the ADF application's front end control's IDs can be provided. If the Avaya system is capable of accessing or getting hold of DOM and pushing the value to the controls and clicking the button; things would become pretty straight forward. JMeter works like this in testing J2EE applications.
    Any Recommendations how can it be done .
    Thanks.

  • Interfaces and methods with complex object

    In all the examples I have, the methods of an interface use only basic java datatypes (int, Character, ..)
    I want to pass a Vector that represents a list of objects from one of my own classes to an interface method.
    class Myclass ...
    private String p1;
    private int p2;
    myInterfaceMethod(..., Vector list, ...)
    // list is a vector of Myclass objects
    How do I know about Myclass when implementing the interface and how do I access p1 and p2 ?

    You can use any kind of "complex" object in your interface methods, all of them are objects at last.
    The other question seems to be a misunderstanding of interface implementation. When u "implement" an interface in a class, all that JVM does is to check that you actualy have one method (with code inside its body) for each method you defined previously in the interface.
    Think of an interface as a contract signed by a class. It's forced to implement each method definied in you interface. So, as the method is defined inside the class, you can access any data member of the class without doing anything "special". Do u catch it?

  • Non-varargs call of varargs method with inexact argument type for last para

    i have no idea what the error:
    non-varargs call of varargs method with inexact argument type for last parameter
    means.
    return (Component)sceneClass.getConstructor(
    new Class[]{int.class, int.class}).newInstance(
         new Integer[]{new Integer((int)sceneDimension.getWidth()),
                new Integer((int)sceneDimension.getHeight())});
    this is the problem area but i'm not sure how to get around it..
    any help would be appreciated

    I am a Java learner and I got the same warning. My code runs like this:
    import java.lang.reflect.*;
    class Reflec
         public static void main(String[] args)
              if(args.length!=1)
                   return;
              try
                   Class c=Class.forName(args[0]);
                   Constructor[] cons=c.getDeclaredConstructors();
                   Class[] params=cons[0].getParameterTypes();
                   Object[] paramValues=new Object[params.length];
                   for(int i=0; i<params.length; i++)
                        if(params.isPrimitive())
                             paramValues[i]=new Integer(i+3);
                   Object o=cons[0].newInstance(paramValues);
                   Method[] ms=c.getDeclaredMethods();
                   ms[0].invoke(o, null);
              catch(Exception e)
                   e.printStackTrace();
    class Point
         static
              System.out.println("Point class file loaded and an object Point generated£¡");     
         int x, y;
         void output()
              System.out.println("x="+x+"\ny="+y);
         Point(int x, int y)
              this.x=x;
              this.y=y;
    When I compiled the file I got the following:
    Reflec.java:26: warning: non-varargs call of varargs method with inexact argument type for last parameter;
    cast to java.lang.Object for a varargs call
    cast to java.lang.Object[] for a non-varargs call and to suppress this warning
    ms[0].invoke(o, null);
    ^
    1 warning
    Since the problem was with this line "ms[0].invoke(o, null);" and the specific point falls on the last argument as the warning mentioned that " ... method with inexact argument type for last parameter", I simply deleted the argument "null" and the line becomes "ms[0].invoke(o);" and it works, no warning anymore!
    DJ Guo from Xanadu
    Edited by: Forget_Me_Not on Jan 8, 2009 10:39 AM

Maybe you are looking for