Java AWT/Swing coexisting with native Qt application

Hi,
I'm trying to figure out how to get a GUI application written in Java to work in a native Qt application by embedding the Java application in the Qt application.
Any suggestions on how to do this...

It requires creating a system window (possibly frameless) using a native API calls (e.g. WinAPI or Xlib). That window might be embedded in your application. You would have to send system messages to that window (WM_XXXXX on Windows and XEvent's on X).
For more information I suggest you to look at KDE sources where it is implemented for X Window (there is also a Java package, kjas which is a server for running applets in Konqueror.
Or if you have much time you could write AWT on top of Qt (there is one built with Gtk+) and give the JVM your classes instead of the original JDK.
The choice is yours. Happy Qt-ing!

Similar Messages

  • Known issues with native mail application

    Since 3 days now, the native email application on Series 60 3rd doesn't correctly download my mail anymore.
    Im using it to connectr to a gmail account via imap: all worked perfectly but now when I retreive email, it shows me a progress bar "updating email". But when its done, there is no new headers showing. The last email is still from 3 days ago and new ones are not showing.
    Im confused as there is no indication of any error.it connects, shows me a progress bar etc. but it just doesnt download any new headers.
    Are there any issues known with gmail accounts?

    OK this is definitely being casued by Exchange mail (I'm using Gmail).
    If restore the phone as new the drain stops - still at 100% in the morning.
    The problem starts again when I setup an exhange account for mail. I have no push or fetch turned on. The battery then starts this gradual drain of about 2% per hour.
    Is there anyone who can think why the phone is doing this - is it just mail being buggy ?
    Message was edited by: Flamehearted

  • LAN connection fall asleep only with Native Apple application.

    IMac 20' connected trough cable to a Netgear Router. Working regurarly no problems at all. If I leave the computer without touching it for less than 10 minutes, all the Apple application loose connection with internet (Safari, Mail, App store) while Firefox or Vuze for example continues to work. To restore I have to Activate AirPort anf then I can deactivate, or unplug and replug the ethernet cable. If I connect trough AirPort this problem does not show up.
    When Safari loose connection, I use the "diagnose network problem" and it shows that the internet connection works regularly. I tought initially it was a Safari problem and I cleaned up cache and cronology with no success. Now I realized the problem is also showing with Mail and the new App Store.
    The router is pretty new and the problem was present also with the previous one (Dlink 624GT).
    Anybody can help ? It's an OS bug ? Something related with bonjour ? It does not seem like an hardware problems, since third party application work correctly.
    Thanks for your support.

    Nobody can help ?

  • Will java support swings along with sip protocol

    sir i want the java and sip protocol to be used aside by aside by aside

    Do you mean you want do use SIP from Java? Google for "sip java" and e.g. the first hit is about a SIP API for Java.

  • Getting HWND to Swing component with C++ as main

    I've ran into another issue with the Native interface , it occurs when mixing it with JNI.
    Anyone know why the class load fails on the Native Invocatuon side if I include a JNI call on the Java side??
    Here's the sequence
    1 .Main.cpp -> 2 . MainNativeWindow.cpp (Native Interface) -> 3 . MyWindow.java (create Swing and call Native) -> 4. MyNativeWindow.cpp (get HWND and edit)
    1. So the main app is C++.
    2. The creates a JVM through the native interface
    3. The Java Sides paint is overridden on the C++ side, this gives me a HWND to the Java Canvas.
    4. The C++ side then writes to the Java Canvas.
    My problem is the combination of the Native invocation and the JNI, if I include the JNI call on the Java side then the Native call to access the Java class fails (it works if I remove the JNI function) !!
    Anyone know why the class load fails on the Native Invocatuon side if I include a JNI call on the Java side??
    Is there an easier way to get access to the Java Canvas from the C++ side, besides using the Java Paint function to give me access , I've given snippets of the code below
    1. and 2. C++ main
    #include "MainNativeWindow.h"
    //Native Interface
    #include <stdio.h>
    #include <jni.h>
    JavaVM *jvm; /* Pointer to a Java VM */
    JNIEnv *env; /* Pointer to native method interface */
    int verbose = 1; /* Debugging flag */
    int MainNativeWindow::InitJava()
      JavaVMInitArgs  vm_args;
      jclass cls;
      jmethodID main_methodID, test_methodID = NULL;
      jint res;
      JavaVMOption options[4];
      options[0].optionString = "-Djava.compiler=NONE"; /* disable JIT */
      options[1].optionString = "-Djava.class.path=${JDK_HOME}/lib;C:/jsdk1.4.2/_jvm/lib;."; /* user classes */
      options[2].optionString = "-Djava.library.path=lib"; /* set native library path */
      options[3].optionString = "-verbose:jni"; /* print JNI-related messages */
      /* Setup the environment */
      vm_args.version = JNI_VERSION_1_4;
      vm_args.options = options;
      vm_args.nOptions = 4;
      vm_args.ignoreUnrecognized = 1;
      JNI_GetDefaultJavaVMInitArgs(&vm_args);//REPLACE THIS
       res = JNI_CreateJavaVM(&jvm,(void **) &env, &vm_args );//REPLACE THIS
      cls = env->FindClass("MyWindow");
      if(cls)
        main_methodID = env->GetStaticMethodID(cls, "main", "([Ljava/lang/String;)V");//"([Ljava/lang/String;)V" indicates that the Java mehtod takes an array "[" pf Strings and returns void "V"
      if(main_methodID)
         jstring first_str = env->NewStringUTF("The First String");//create string
         jobjectArray args = (jobjectArray)env->NewObjectArray(2,env->FindClass("java/lang/String"), first_str);//new array with 2 elements
                                  env->SetObjectArrayElement(args, 1, first_str);//insert the second string into index 1 of the array
         jstring second_str = env->NewStringUTF("The Second String");//create string
                                  env->SetObjectArrayElement(args, 2, second_str);//insert the second string into index 1 of the array
                             env->CallStaticVoidMethod(cls, main_methodID, args);//pass the array to the Java main method
      jvm->DestroyJavaVM( );
        return 1;
    int main(int argc, char *argv[])
         MainNativeWindow *nativewin = new MainNativeWindow();
          return nativewin->InitJava();   
    }3. JAVA side
    import java.awt.*;
    import javax.swing.*;
    public class MyWindow extends Canvas {
         static {
              // Load the library that contains the paint code.
              System.loadLibrary("MyNativeWindow");
         // native entry point for Painting
         public native void paint(Graphics g);
         public static void main( String[] argv ){
              Frame f = new Frame();
              f.setSize(300,400);
              JWindow w = new JWindow(f);
              w.setBackground(new Color(0,0,0,255));
              w.getContentPane().setBackground(new Color(0,0,0,255));
              w.getContentPane().add(new MyWindow());
              w.setBounds(300,300,300,300);
              w.setVisible(true);
    }4. C++ AWT interface (doesn't get here with the JNI in the Java class)
    //AWT Native Interface
    #include <windows.h>
    #include <assert.h>
    #include "jawt_md.h"
    #include "MyWindow.h"
    void DrawSmiley(HWND hWnd, HDC hdc);
    HRGN hrgn = NULL;
    JNIEXPORT void JNICALL
    Java_MyWindow_paint(JNIEnv* env, jobject canvas, jobject graphics)
         JAWT awt;
         JAWT_DrawingSurface* ds;
         JAWT_DrawingSurfaceInfo* dsi;
         JAWT_Win32DrawingSurfaceInfo* dsi_win;
         jboolean result;
         jint lock;
         // Get the AWT
         awt.version = JAWT_VERSION_1_4;
         result = JAWT_GetAWT(env, &awt);
         assert(result != JNI_FALSE);
         // Get the drawing surface
         ds = awt.GetDrawingSurface(env, canvas);
         if(ds == NULL)
             return;
         // Lock the drawing surface
         lock = ds->Lock(ds);
         assert((lock & JAWT_LOCK_ERROR) == 0);
         // Get the drawing surface info
         dsi = ds->GetDrawingSurfaceInfo(ds);
         // Get the platform-specific drawing info
         dsi_win = (JAWT_Win32DrawingSurfaceInfo*)dsi->platformInfo;
         HDC hdc = dsi_win->hdc;
         HWND hWnd = dsi_win->hwnd;
         // !!! DO PAINTING HERE !!! //
         if(hrgn == NULL)
              RECT rcBounds;
              GetWindowRect(hWnd,&rcBounds);
              long xLeft = 0;         // Use with scaling macros
              long yTop = 0;
              long xScale = rcBounds.right-rcBounds.left;
              long yScale = rcBounds.bottom-rcBounds.top;
              hrgn = CreateEllipticRgn(X(10), Y(15), X(90), Y(95));
              SetWindowRgn(GetParent(hWnd),hrgn,TRUE);
              InvalidateRect(hWnd,NULL,TRUE);
         } else {
              DrawSmiley(hWnd,hdc);
         // Free the drawing surface info
         ds->FreeDrawingSurfaceInfo(dsi);
         // Unlock the drawing surface
         ds->Unlock(ds);
         // Free the drawing surface
         awt.FreeDrawingSurface(ds);
    }

    See http://codeproject.com/cpp/OOJNIUse.asp

  • How to move image in Java Awt.

    Hi ,
    I am developing a simple application using Java awt.
    I have created a application which displays a image. now i want it to move automatically using a timer or something.
    How can i do it. if i have to change the x and y position of the image in which function should i do it?
    Which is the function which is called for every frame?
    Thanks
    Glen.

    public void paint(Graphics g)?
    Are you making a game by any chance?

  • Can I build a GUI application with SWING only without [import java.awt.*;]

    I have seen several threads (in forums), books and tutorials about SWING and I see that they all mix SWING with AWT (I mean they import both Swing and AWT in their code).
    The conclusion that comes out is:
    It is good to learn about SWING and forget AWT as it won't be supported later. I have decided to do so, and I never include <<import java.awt.*;>> in my code.
    But I see that you cannot do much without <<import java.awt.*;>>. For example this line which changes the background color:
    <<frame.getContentPane().setBackground(Color.red)>>
    works only with <<import java.awt.*;>>. I have seen that codes in this and other forums import awt to change the background. Why is that?
    After all, I wonder, what can I do;
    My question is, can I change the background (and of course do all other things listener, buttons etc) without using <<import java.awt.*;>>.
    I would like to avoid using <<import java.awt.*;>> and using awt since my program will not work later.
    In addition, I believe there is no point to learn awt, which later will not exist.
    I know, I must have misunderstood something. I would appreceate it very much, if anyone could give me even a short answer.
    Thank you in advance,
    JMelsi

    Since swing is a layer on top of awt, AWT will exist for as long as swing does.
    If sun does ever remove AWT they will have to replace it something else swing can layer on to and you will probably only have to replace your import statements.
    The main difference is the way there drawn to the screen.
    You can do custom drawing on swing components but you can't on AWT.
    If your using a desktop PC system it's probably best to use swing just in case you wish to do some custom drawing.
    awt uses less memory than swing and is faster but swing can be extended. awt comes only as standard.
    Say for example you wish to implement a JButton with a ProgressBar below the button text, this can be done with swing!

  • Java.rmi.ConnectException using webstart Swing client with WL 8.1 SP2 in a

    Hi all,
    I'm receiving the following exception when invoking a remote method on
    a cached remote stub. This only happens if there are at least two
    nodes running in a cluster. It happens more often the more nodes are
    running.
    It seems that the exception occurs if for a call to a remote method a
    cached stub is used, and if that call is referred to a different node
    in the cluster by the load balancer than the one that the stub
    originally came from. But I'm not completely sure about that...
    Client side config:
    Webstart
    JDK 1.4.2_05
    weblogic.jar (we're experiencing other problems already discussed in
    this group when using wlclient.jar)
    Server side config:
    Weblogic 8.1 SP2
    cluster on Sun Solaris machines (two nodes, one manager)
    Here is the exception stacktrace:
    java.rmi.ConnectException: Could not establish a connection with
    2198062098923170717S:shebea219:[7001,7001,-1,-1,7001,-1,-1,0,0]:SHEBEA219,SHEBEA334:DaGama:DaGamaNode1,
    java.security.AccessControlException: access denied
    (java.net.SocketPermission shebea219 resolve)
    at weblogic.rjvm.RJVMImpl.getOutputStream(RJVMImpl.java:316)
    at weblogic.rjvm.RJVMImpl.getRequestStream(RJVMImpl.java:488)
    at weblogic.rjvm.RJVMImpl.getOutboundRequest(RJVMImpl.java:584)
    at
    weblogic.rmi.internal.BasicRemoteRef.getOutboundRequest(BasicRemoteRef.java:91)
    at
    weblogic.rmi.internal.activation.ActivatableRemoteRef.invoke(ActivatableRemoteRef.java:69)
    at
    de.conet.dagama.interesengine.nativesession.SBNativeSession_8da95c_EOImpl_812_WLStub.isConnected(Unknown
    Source)
    at
    de.conet.dagama.agent.flight.nativ.FlightNativeListener.doExitNativeSession(FlightNativeListener.java:244)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at
    de.objektpark.framework.command.CommandInvoker.invoke(CommandInvoker.java:132)
    at
    de.objektpark.framework.command.CommandProcessor.doService(CommandProcessor.java:169)
    at
    de.objektpark.framework.command.CommandProcessor.service(CommandProcessor.java:131)
    at
    de.objektpark.framework.command.CommandProcessor.execute(CommandProcessor.java:71)
    at
    de.conet.webactiv.swing.command.GUICommandProcessor.execute(GUICommandProcessor.java:87)
    at
    de.conet.webactiv.swing.controller.GUICommandController.execute(GUICommandController.java:98)
    at
    de.conet.webactiv.swing.controller.GUICommandController.execute(GUICommandController.java:124)
    at
    de.conet.dagama.agent.flight.nativ.FlightFreeNativeView.this_windowClosing(FlightFreeNativeView.java:84)
    at
    de.conet.dagama.agent.flight.nativ.FlightFreeNativeView$1.windowClosing(FlightFreeNativeView.java:73)
    at java.awt.AWTEventMulticaster.windowClosing(Unknown Source)
    at java.awt.Window.processWindowEvent(Unknown Source)
    at javax.swing.JFrame.processWindowEvent(Unknown Source)
    at java.awt.Window.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
    Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    Has anyone ever come across the same problem and possibly found a
    solution?
    Any help would be greatly appreciated.
    Thanks in advance
    Rolf

    Hi all,
    I'm receiving the following exception when invoking a remote method on
    a cached remote stub. This only happens if there are at least two
    nodes running in a cluster. It happens more often the more nodes are
    running.
    It seems that the exception occurs if for a call to a remote method a
    cached stub is used, and if that call is referred to a different node
    in the cluster by the load balancer than the one that the stub
    originally came from. But I'm not completely sure about that...
    Client side config:
    Webstart
    JDK 1.4.2_05
    weblogic.jar (we're experiencing other problems already discussed in
    this group when using wlclient.jar)
    Server side config:
    Weblogic 8.1 SP2
    cluster on Sun Solaris machines (two nodes, one manager)
    Here is the exception stacktrace:
    java.rmi.ConnectException: Could not establish a connection with
    2198062098923170717S:shebea219:[7001,7001,-1,-1,7001,-1,-1,0,0]:SHEBEA219,SHEBEA334:DaGama:DaGamaNode1,
    java.security.AccessControlException: access denied
    (java.net.SocketPermission shebea219 resolve)
    at weblogic.rjvm.RJVMImpl.getOutputStream(RJVMImpl.java:316)
    at weblogic.rjvm.RJVMImpl.getRequestStream(RJVMImpl.java:488)
    at weblogic.rjvm.RJVMImpl.getOutboundRequest(RJVMImpl.java:584)
    at
    weblogic.rmi.internal.BasicRemoteRef.getOutboundRequest(BasicRemoteRef.java:91)
    at
    weblogic.rmi.internal.activation.ActivatableRemoteRef.invoke(ActivatableRemoteRef.java:69)
    at
    de.conet.dagama.interesengine.nativesession.SBNativeSession_8da95c_EOImpl_812_WLStub.isConnected(Unknown
    Source)
    at
    de.conet.dagama.agent.flight.nativ.FlightNativeListener.doExitNativeSession(FlightNativeListener.java:244)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at
    de.objektpark.framework.command.CommandInvoker.invoke(CommandInvoker.java:132)
    at
    de.objektpark.framework.command.CommandProcessor.doService(CommandProcessor.java:169)
    at
    de.objektpark.framework.command.CommandProcessor.service(CommandProcessor.java:131)
    at
    de.objektpark.framework.command.CommandProcessor.execute(CommandProcessor.java:71)
    at
    de.conet.webactiv.swing.command.GUICommandProcessor.execute(GUICommandProcessor.java:87)
    at
    de.conet.webactiv.swing.controller.GUICommandController.execute(GUICommandController.java:98)
    at
    de.conet.webactiv.swing.controller.GUICommandController.execute(GUICommandController.java:124)
    at
    de.conet.dagama.agent.flight.nativ.FlightFreeNativeView.this_windowClosing(FlightFreeNativeView.java:84)
    at
    de.conet.dagama.agent.flight.nativ.FlightFreeNativeView$1.windowClosing(FlightFreeNativeView.java:73)
    at java.awt.AWTEventMulticaster.windowClosing(Unknown Source)
    at java.awt.Window.processWindowEvent(Unknown Source)
    at javax.swing.JFrame.processWindowEvent(Unknown Source)
    at java.awt.Window.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
    Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    Has anyone ever come across the same problem and possibly found a
    solution?
    Any help would be greatly appreciated.
    Thanks in advance
    Rolf

  • Quality of Cursors created with java.awt.Toolkit(createCutsomCursor)

    Hi -
    I encountered a small problem while creating my own cursors for my Java application , I used the java.awt.Toolkit Objects createCustomCursor method to use a .GIF image as a cursor ... it worked but the quality of that cursor is horrible, the outline is rough ... I tried the same with a transparent PNG file afterwards unfortunately the same result , does anyone know why the quality is that bad or may this just be a problem of the choosen color pool ?
    Help would be very appreciated since I have no clue how to use .cur files ... seems like a non supported format , in case someone knows how to import those it would help a lot if you would drop some lines of code.
    I am currently using Java 2 SDK 1.4.0_01 , newest version.
    Thanks for you time and thanks in advance for possible answers
    -- Harald Scheckenbacher

    I noticed this problem too. It looks like the routine is generating cursors which are scaled to to the maximum size of the system. On my win XP system,
    Dimension dim = toolkit.getBestCursorSize(256, 256);
    int maxColors = toolkit.getMaximumCursorColors();
    return 32,32 and 256 respectively
    If I provide a 16x16, all the pixels have been pixel doubled. If I specify a 32x32 image, then the cursor looks perfect. This looks like a bug for the java folks. Not sure why someone would ever want a cursor image to be pixel scaled.
              

  • Problem with Horizontal Scroll on java.awt.List

    I use the same code for a General Application as a CDC Application.
    I have no problem at all with the General Application but on the CDC I can't scroll to the right (horizontal).
    Why do I get this problem on the CDC application and not on a regular application?
    I use the PP-1.0 Profile for the CDC application. Does it not support horizontal scroll on java.awt.List?
    This is the code:
    * Main.java
    * Created on den 22 augusti 2007, 10:52
    package cdcapplication6;
    * @author  Erik Rothman
    public class Main extends java.awt.Frame {
        /** Creates new form Main */
        public Main() {
            initComponents();
              for (int i = 0; i < 10; i++) {
                   list1.add("Short text");
                   list1.add("Some very long text indeed. Some very long text indeed.");
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc=" Generated Code ">                         
        private void initComponents() {
            list1 = new java.awt.List();
            addWindowListener(new java.awt.event.WindowAdapter() {
                public void windowClosing(java.awt.event.WindowEvent evt) {
                    exitForm(evt);
            add(list1, java.awt.BorderLayout.CENTER);
            pack();
        }// </editor-fold>                       
        /** Exit the Application */
        private void exitForm(java.awt.event.WindowEvent evt) {                         
            System.exit(0);
         * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new Main().setVisible(true);
        // Variables declaration - do not modify                    
        private java.awt.List list1;
        // End of variables declaration                  
    }

    I use the same code for a General Application as a CDC Application.
    I have no problem at all with the General Application but on the CDC I can't scroll to the right (horizontal).
    Why do I get this problem on the CDC application and not on a regular application?
    I use the PP-1.0 Profile for the CDC application. Does it not support horizontal scroll on java.awt.List?
    This is the code:
    * Main.java
    * Created on den 22 augusti 2007, 10:52
    package cdcapplication6;
    * @author  Erik Rothman
    public class Main extends java.awt.Frame {
        /** Creates new form Main */
        public Main() {
            initComponents();
              for (int i = 0; i < 10; i++) {
                   list1.add("Short text");
                   list1.add("Some very long text indeed. Some very long text indeed.");
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc=" Generated Code ">                         
        private void initComponents() {
            list1 = new java.awt.List();
            addWindowListener(new java.awt.event.WindowAdapter() {
                public void windowClosing(java.awt.event.WindowEvent evt) {
                    exitForm(evt);
            add(list1, java.awt.BorderLayout.CENTER);
            pack();
        }// </editor-fold>                       
        /** Exit the Application */
        private void exitForm(java.awt.event.WindowEvent evt) {                         
            System.exit(0);
         * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new Main().setVisible(true);
        // Variables declaration - do not modify                    
        private java.awt.List list1;
        // End of variables declaration                  
    }

  • Failed to launch JavaFX application with native bundle exe

    Hi,
    I have created a JavaFX application, and created its native bundle using Ant. When I am trying to launch application using Jar from bundle created with double click, it successfully launching my application. But when I am trying double click on MyApplication.exe (say), it throwing JavaFX Launcher Error *"Exception while running Application"*.
    I have searched about this issue, I found about jre, so I did replace jre from *"C:\Program Files\Java\jdk1.7.0_10\jre"* to my application bundle folder -- *\bundles\MyApplication\runtime\jre*, then I tried to launch exe with double click, it successfully launched.
    I have compared both jre, there are many missing jar, exe, dll and some properties files I found.
    I have these environment settings -
    JAVA_HOME -- C:\Program Files\Java\jdk1.7.0_10
    JREFX_HOME -- C:\Program Files\Oracle\JavaFX 2.2 Runtime
    Path contains an entry of C:\Program Files\Java\jdk1.7.0_10\bin JAVA_HOME and JREFX_HOME are used as in my build.xml to take ant-javafx.jar and jfxrt.jar --
    ${env.JAVA_HOME}/lib/ant-javafx.jar
    ${env.JREFX_HOME}/lib/jfxrt.jarMy steps to create bundle are -
    <target name="CreatingExe" depends="SignedJar">
                 <fx:deploy width="800" height="600" nativeBundles="all" outdir="${OutputPath}" outfile="${app.name}">
                          <fx:info title="${app.title}"/>
                          <fx:application name="${app.title}" mainClass="${main.class}"/>
                          <fx:resources>
                               <fx:fileset dir="${OutputPath}" includes="*.jar"/>
                         <fx:fileset dir="${WorkingFolder}/temp"/>
                   </fx:resources>
               </fx:deploy>
    </target>What more needed in build.xml so that application launch correctly with exe ?
    Thanks

    You code is not dealing with the DACL access to Winsta0\Default.  Only the LocalSystem account will have full access and the interactively logged on user which is why regedit is not displaying properly.  You'll need to grant access to your user. 
    You also need to deal with UAC since that code is going to give you a non-elevated token via LogonUser().  You need to get the full token via a call to GetTokenInformation() + TokenLinkedToken.
    thanks
    Frank K [MSFT]
    Follow us on Twitter, www.twitter.com/WindowsSDK.

  • Problem with java.awt.MouseInfo or java.awt.event.*;

    I have a problem with the MouseInfo class. I think.. because in my mousePressed(MouseEvent event) method, I have this:
         public void mousePressed(MouseEvent event) {
              pInfo = mInfo.getPointerInfo();
              point = pInfo.getLocation();
              pointX = point.getX();
              pointY = point.getY();
              System.out.println("pointer is at: (" + (int)pointX + ", " + (int)pointY + ")");
         }I think you all could figure out what this does. I declared the variables at the top and I implemented MouseListener... when I click it doesnt tell me the X and Y coords.
    Alright, thanks. Any help appreciated.

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class MouseExample extends MouseAdapter implements Runnable {
        @Override
        public void mousePressed(MouseEvent event) {
            int x = event.getX();
            int y = event.getY();
            System.out.println("x=" + x + ", y=" + y);
        @Override
        public void run() {
            JLabel label = new JLabel("Click anywhere", SwingConstants.CENTER);
            label.setPreferredSize(new Dimension(300, 200));
            label.addMouseListener(this);
            JFrame f = new JFrame();
            f.getContentPane().add(label);
            f.pack();
            f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
            f.setLocationRelativeTo(null);
            f.setVisible(true);
        public static void main(String[] args) {
            EventQueue.invokeLater(new MouseExample());
    }

  • Running Java apllets with in C++ applications

    How can I run a Java applet in a C++ appliction? I need to make my application load and run a Java applet and communicate with it. Possibly use a little Java native so the Java applet can better communicate with the C++ application.
    So how would I dod this, if I can?

    Check out this part of the Java tutorial:
    http://java.sun.com/docs/books/tutorial/native1.1/invoking/index.html

  • I have built a android application using adobe flex, and i have exported it with native air. The application is working fine on samsung phones whereas it is getting crashed on Moto Phones, which runs on android kitkat, is there any compatibility issue ?,

    I have built a android application using adobe flex, and i have exported it with native air. The application is working fine on samsung phones whereas it is getting crashed on Moto Phones, which runs on android kitkat, is there any compatibility issue ?, I have built a android application using adobe flex, and i have exported it with native air. The application is working fine on samsung phones whereas it is getting crashed on Moto Phones, which runs on android kitkat, is there any compatibility issue ?, I have built a android application using adobe flex, and i have exported it with native air. The application is working fine on samsung phones whereas it is getting crashed on Moto Phones, which runs on android kitkat, is there any compatibility issue ?

    Thanks, Flex harUI, for the direction in regards to isolating build changes. That aside (still working on it), can you offer any direction in regards to my original question on SDK and AIR compatibility? I'm specifically looking for a version compatibility mapping or anything that definitively states, "Flex SDK x.y.z works with the following versions of AIR". This information is crucial for us in order to more specifically plan our own roadmap built upon these two frameworks as we consider both existing installations of our software and future distributions.

  • Rendering of an 8Bit-tiff with java.awt produces crap

    Hi Folks,
    i do a downsampling of tiff images. The source tiffs are colored 8 Bit greyscale with a 256 color-table. Now i have 2 possibilities to resample with java.awt:
    1. the target-tiff is of 24Bit true color:
    BufferedImage objDownsample = new BufferedImage(iTargetWidth, iTargetHeight, BufferedImage.TYPE_INT_RGB);The result is a perfect looking, but oversized tiff with 16 million colors each pixel.
    2. the target-tiff is of 8Bit like the source-tiff:
    BufferedImage objDownsample = new BufferedImage(iTargetWidth, iTargetHeight, BufferedImage.TYPE_BYTE_INDEXED,(IndexColorModel)image.getColorModel());The result is a small sized tiff image of 8Bit. Problem: it now has visible vertical stripes of two colors (which both composed result the source-color i assume).
    Does anybody know what's wrong here and how to retrieve the 8Bit color-image without stripes?
    Here comes the whole source:
        private BufferedImage resize(int newHeight, int newWidth, BufferedImage image) {
            int iTargetHeight = newHeight;
            int iTargetWidth = newWidth;
            //Create a BufferedImage that fits
            BufferedImage objDownsample = new BufferedImage(iTargetWidth, iTargetHeight, BufferedImage.TYPE_BYTE_INDEXED,(IndexColorModel)image.getColorModel());
            //A map with all necessary rendering hints to optimize the quality of the image
            Map<java.awt.RenderingHints.Key, java.lang.Object> obj_Map = new HashMap<java.awt.RenderingHints.Key, java.lang.Object>();       
            obj_Map.put(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE);
            obj_Map.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
            obj_Map.put(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
          // Draw the scaled image
          Graphics2D graphics2D = objDownsample.createGraphics();
            graphics2D.addRenderingHints(obj_Map);
            graphics2D.drawImage(image, 0, 0, iTargetWidth, iTargetHeight, null);
            return objDownsample;
        }Thanks
    Albrecht

    As far as I can tell, this solution only allows compositing within the component that is currently being painted. What would be nice is if I could add a custom composite to say .. a JLabel, which paints based on the colors of the underlying pixel data (ie. from its parent container). In this way you could make a JLabel that always inverts the color of what's underneath.
    Here, painting to the screen using a composite allows me to get the pixels underneath as the destination raster, the pixels in the JLabel as the source raster, and what actually gets painted which is the destination output raster.
    If I paint to a BufferedImage instead, the composite's 'destination raster' is the new BufferedImage's default values which are all black. Thus compositing over this would not have the desired effects described above (inverting the underlying image for instance). The missing piece when rendering to the BufferedImage is first copying the underlying screen data into a BufferedImage before painting to it. How do I do that? Something tells me it's very difficult.

Maybe you are looking for

  • VPN clients can connect via SSTP but not IKEv2 due to error 808

    I have a Windows Server 2012 R2 with RRAS configured to allow SSTP / IKEv2 VPN connections. I'm using an external certificate for server authentication and the client authentication is done via domain username/password (Protected EAP). The clients ca

  • How can i get itunes store to work?

    When I try to login to the iTunes store, nothing happens. How can I get iTunes store to work?

  • Neo2P 3500+ 90nm problem

    Have neo2plat and had everything going ok with 3500 130nm cpu. System was great - once I had all drivers/bios updated. Was like this for a few weeks. Then I got a new 90nm 3500+. Though it would be a simple swap, but boy was I wrong. Boot to windows

  • 2 SCM with single R/3

    Hi Gurus, What is the implication using two SCM systems with single R/3 system when both SCM systems using for different modules (say one for DP and other one for GATP). I know SAP recommends using multiple OLTP with single SCM. But this scenario opp

  • Required BAPI for Shipment Cost Document (VI01)

    Dear All,    I required BAPI for Shipment Cost Document (VI01), pls help on this. Regards Ranjit