Embedding Applet in native Windows Application

Hi!
I need to integrate applet into my windows application (MSVC).
The problem is displaying applet(s) within the application's main window (just like in browser).
Is there a way to do it? Using WebBrowser (IE) ActiveX component is unacceptable.
Perhaps there is documentation how to use JRE browser plugin, but googling yielded no results :(

<offtopic>Apparently my login no longer working, re-registered</offtopic>
ActiveX bridge won't do, I have to load an applet from any .jar
The idea is to write kind of applet loader, which may be able to load jar and display applet.
To start with, I need to know the way of paiting Java application GUI (i.e. JFrame) inside the native window.
There is one way I've found. First, create borderless JFrame with some unique title, then use FindWindow in C++ Application to obtain HWND (window handle), and then call SetParent. I know there is more elegant way using JAWT to obtain HWND, the main problem is that Java window is rendered separately and only then becomes a part of native window, because HWND could be get on visible window only. This results unneccessary mess and flicking on screen for user.
So, how can I render Java GUI directly to native window?
I used search and haven't found solution.
Thank you!
PS found http://forum.java.sun.com/thread.jspa?forumID=52&threadID=5124062
but this guy haven't said how he ded that :(
Edited by: deniska25 on Oct 15, 2007 1:52 PM

Similar Messages

  • Getting (WHND) of windows applications

    Hi,
    I am trying to develop an application that on windows retrives the handles of a couple of native windows applications, to see if I can remote controll them using the message quea. I am not sure this is the right forum, but the one that seems to match most. I have unsuccesfully tried a couple of other forums.
    Does some one know how to retrieve a handle from another application please?
    Even without using J/Direct please?
    Thanks in advance.
    Michael (fairly inexperienced)

    Getting the HWND of a Win32 application depends largely on your understanding of the Windows architecture. There are two main approaches from a total-solution perspective. BOTH perspectives rely on Java Native Interface API, but they use it differently. After you decide which of these two options to choose, you need to ask yourself, What input parameters can I provide to determine which Window's HWND I need?
    1. Use the JNI, or a third-party library based upon it, to map individual Win32 API calls (like EnumWindows) into a Java class. Then write a Java program that calls these Win32 methods tagged as native in Java. This is the strategy used to implement the Standard Widget Toolkit, by the way...
    2. Use the JNI, but in a different way, to call a more complicated Win32 procedure (rather than just the basics of JNI, which allow you to call a DLL which was written in C.) You could use Njawin, for example, to call into a COM DLL (like a Visual Basic application) which itself provides a more complete solution to the problem. APIs like Jawin, JIntegra, Njawin, and JacobGen will take a complicated Win32 binary module (a DLL, TLB, etc. depending upon which solution we're talking about) and interoperate it with Java, allowing you to retrieve Pure Java return types, call methods synchronously or asynchronously, etc.
    If you are going to be invoking further native functionality after you get the HWND (as you hinted with the message queue), you will probably want to go with Solution 2; coding directly to the Win32 API is not necessary in many situations. If you need to use JAVA as the front end to your program, but you want a lot of native functionality, then:
    1. Write all your native functionality in a high-level, object-oriented, COM-enabled Win32 programming language like Delphi, VB, C++, etc.
    2. Code the main native procedure into a public object inside a COM DLL, and use JacobGen or Njawin to be able to call that method from inside Java.

  • How to call Java methods from a Windows application?

    Hello all,
    At our company, we need to integrate our product which is a Java Swing application with a Windows application. Specifically, we are trying to call Java methods that reside in our application from the Lotus Notes email client application, which is a native Windows application. Such that when a user clicks a button in the Lotus Notes email client, it will trigger an event in our Swing application. Is this possible using JNI? Do you know of any resources or references relating to this kind of a project?
    Thanks,
    Mete Kural

    If there is some dll interface that lets Lotus Notes load up and use a DLL, then yes, this should be possible.

  • Newest UltraNav driver brakes native windows middle-click scrolling

    I just want to report that the newest touchpad driver brakes native windows middle-click scrolling.
    What I'm talking is this:
    1. Swich off all advanced features in the TouchPoint setting to get back a middle button. BTW, how on earth it is possible that the default setting "steals" the middle button. Going for the Nr. 1. PC maker and forgetting a stupid default settings in a Synaptics driver is a joke. 
    2. Now, try scrolling in any native windows application like Chrome, Firefox, etc. 
    The quick way of scrolling is to push the middle button while scrolling. It had always worked before.
    Now this way is broken.
    Now, the only way for scrolling is to the:
    1. push middle button to enter scolling mode
    2. move mouse
    3. push again to exit scrolling mode
    This scolling mode has never been a good way to scroll, but the quick way is broken with the latest driver.
    I'm using a W520 with Windows 7, 64-bit. Broken driver: Version 16.2.5.0

    ColonelONeill wrote:
    Personally, I never do the BIOS update with any other updates. I always do it by itself to avoid issues.
    same for me.
    in addition, i never do BIOS updates from within a running Windows session. i always use the bootable CD method, following the instructions explicitly, and i've never had a bricked machine.
    cheers.
    English Community   Deutsche Community   Comunidad en Español   Русскоязычное Сообщество
    Community Resources: Participation Rules • Images in posts • Search (Advanced) • Private Messaging
    PM requests for individual support are not answered. If a post solves your issue, please mark it so.
    X1C3 Helix X220 X301 X200T T61p T60p Y3P • T520 T420 T510 T400 R400 T61 Y2P Y13
    I am not a Lenovo employee.

  • Incorrect functionality of Embedded tag in html page, displaying object on top of all layers of Adobe air application native window

    Title
    Incorrect functionality of embed tag in html loader for adobe air development
    Description
    Problem Description: If we had loaded youtube.com video url in a view stack and navigate to other index of stack or away from we UI screen within the same native window video or embeded tag of flash player or any other embed object will be displayed on top of all screens layer in same position of where the object should be placed in side of html loader only.
    Steps to Reproduce:
    1) go to http://get.straweb.com/StraWebBrowser/StraWebBrowser.air download and install
    2) load 2 tabs and in the 3 tab load video player of youtube.com which will a sample video
    before completing the load of 3 tab which trying to load video from youtube.com, navigate to other tabs 1 or 2 in few second once the flash player of youtube.com video player is load it will display in the current tab or UI screen.
    3) Try navigating to other tabs than youtube.com loaded tab you see the flash player is on top it stable.
    4) navigate to 3 tab and try to navigate to other tab you can observe that so how it will not show that flash player and only visible in that 3 tab which is fine.
    Actual Result: Embedded tag of html page displaying on top of all layers of Adobe air application native window
    Expected Result: Embedded tag of html page should only displayed in side htmlloader
    This you can replicate in any adobe air plugin update and on any Hardware and Environment.
    Applicable to all sdk versions of adobe air.

    Adobe Bugbase: Bug 3823839 Incorrect functionality of embed tag in html loader for adobe air development

  • Windows 7 Manifest file embedded in native AIR application exe created by ADT

    i have executed string utility to extract all the strings in an AIR application exe and found windows 7 manifest file is embedded with level set to invoker (standard user). We want to change the level to "require administrator" so that exe will automatically launched with administrative privileges but we are unable to find how the manifest file get embedded.
    Help appreciated
    Thanks

    Found out the manifest file get embedded when building native installer. Still don't how the manifest file is added and how to change level to "require administrator" in manifest file.
    Help Appreciated
    Thanks

  • FLV Playback and Seekbar on different native windows in one Air application

    Hello Everyone.  I'm trying to make a simple video playback AIR application that utilizes the initial native window to house a transport control with a seekbar on it.  Once the application launches, it creates a second (new) window on my second screen and places a FLVPlayback instance on that new window.  Everything works just like it want it to except for one thing.  When the seekbar and FLVplayback instance are not located on the same window stage, the seekbar handle sticks to the mouse when trying to scrub through the video.
    I've added both the transport control and the FLVPlayback instance to the original native window as children and I have also added both of them to the new window as children and everything works just fine.  It's only when they are separated and located on different stages that the seekbar acts up.  When they are on the same stage, I can click on a point on the seekbar and the video jumps to that spot and continues to play and I can also scrub the seekbar, the video updates as I scrub, and when I release the mouse, the seekbar handle stays where I released the mouse.  When they on separate stages, the seekbar handle continues to follow the mouse movement without releasing it.  The video updates as the seekbar handle is moved due to it sticking to the mouse, but if I release the mouse, the handle is still moving with the mouse and the video is still being scrubbed.  Like I said, everything works great except for this and I have reached my limit with time spent on this issue.  Does anyone have any insight into this?
    Here's my code for the project.  This is my first AIR application, so I am coding it as I am learning, please be kind.
    import fl.video.*;
    import flash.display.*;
    import flash.desktop.*;
    import flash.events.*;
    import fl.video.MetadataEvent;
    import flash.geom.*;
    import flash.ui.Mouse;
    import flash.text.*;
    GLOBAL SETUP
    var flvControl:FLVPlayback;
    var MasterWindow = stage.nativeWindow;
    var screen1:Screen = Screen.screens[0];
    var screen2:Screen = Screen.screens[1];
    MASTER WINDOW SETUP
    this.loaderInfo.addEventListener(Event.COMPLETE,maximize);
    transControl.playPauseButt2.addEventListener(MouseEvent.CLICK, PlayButton);
    if (Screen.screens.length > 1){
              createVideoBKG();
              createVideoPlayer();
    GENERAL FUNCTIONS
    //Maximize the initial screen
    function maximize(e:Event) {
              MasterWindow.x = screen1.bounds.left
              MasterWindow.maximize();
              MasterWindow.stage.scaleMode = StageScaleMode.EXACT_FIT;
    //Hide Mouse Behind Video Window On Roll-Over
    function MouseRollOver(e:MouseEvent):void
              {          Mouse.hide()          }
    function MouseRollOut(e:MouseEvent):void
              {          Mouse.show()          }
    //Play-Pause Button Control
    function PlayButton(event:MouseEvent):void
                        if(transControl.playPauseButt2.currentFrame==1 ){
                                  transControl.playPauseButt2.gotoAndPlay(2);
                                  flvControl.play();
                        else {
                                  transControl.playPauseButt2.gotoAndPlay(1);
                                  flvControl.pause();
    function CloseWindow(e:MouseEvent):void
                        NativeApplication.nativeApplication.openedWindows[2].close();
    VIDEO BKG SETUP
    function createVideoBKG(e:Event = null):void{
              var newOptions:NativeWindowInitOptions = new NativeWindowInitOptions();
              newOptions.type = NativeWindowType.LIGHTWEIGHT;
              newOptions.systemChrome = NativeWindowSystemChrome.NONE;
              newOptions.transparent = true;
              var videoBKG:NativeWindow = new NativeWindow(newOptions);
              if (Screen.screens.length > 1){
                        videoBKG.x = screen2.bounds.left;
              videoBKG.maximize();
              chromeSetup(videoBKG);
              videoBKG.activate();
    //Video BKG Chrome Setup
    function chromeSetup(currentWindow):void {
              var vidBKG = new video_bkg();
              vidBKG.name = "video_bkg2";
              vidBKG.addEventListener(MouseEvent.ROLL_OVER, MouseRollOver);
              vidBKG.addEventListener(MouseEvent.ROLL_OUT, MouseRollOut);
              currentWindow.stage.addChild(vidBKG);
    VIDEO Player SETUP
    function createVideoPlayer(e:Event = null):void{
              var newOptions:NativeWindowInitOptions = new NativeWindowInitOptions();
              newOptions.type = NativeWindowType.LIGHTWEIGHT;
              newOptions.systemChrome = NativeWindowSystemChrome.NONE;
              newOptions.transparent = true;
              var videoPlayer:NativeWindow = new NativeWindow(newOptions);
              if (Screen.screens.length > 1){
                        videoPlayer.x = screen2.bounds.left;
                        videoPlayer.y = screen2.bounds.top;
                        videoPlayer.width = screen2.bounds.width;
                        videoPlayer.height = screen2.bounds.height;
                        videoPlayer.stage.scaleMode = StageScaleMode.NO_SCALE;
              videoPlayer.alwaysInFront = true;
              var DVR = new DVR_Player();
              DVR.name = "DVR";
              DVR.x = 0;
              DVR.y = 0;
              DVR.addEventListener(MouseEvent.ROLL_OVER, MouseRollOver);
              DVR.addEventListener(MouseEvent.ROLL_OUT, MouseRollOut);
              videoPlayer.stage.addChild(DVR);
                flvControl = DVR.display2;
              flvControl.width = 1280;
              flvControl.height = 720;
              flvControl.skin = null;
              flvControl.autoPlay=false;   
              flvControl.isLive=false;
              flvControl.fullScreenTakeOver = false;
              flvControl.align = VideoAlign.CENTER;
              flvControl.scaleMode = VideoScaleMode.NO_SCALE;
              flvControl.source = "olympics.f4v";
              flvControl.seekBar = transControl.seekbarContainer2.seeker;
              videoPlayer.activate();

    Does anyone have any ideas about this?

  • I am on a Windows 7 OS attempting to reduce pdf size with my Adobe Acrobat Standard XI & Pro.  The application keeps timing out and  at the Subsetting embedded fonts portion and the application gives "Adobe Acrobat has stopped working" and then closes.  T

    I am on a Windows 7 OS attempting to reduce pdf size with my Adobe Acrobat Standard XI & Pro.  The application keeps timing out and  at the Subsetting embedded fonts portion and the application gives "Adobe Acrobat has stopped working" and then closes.  The document is 275 pages.  Is there something I can do to stop this?

    Hi Ricci,
    Since when are you facing this issue? Did you tried system restore to a date before this problem occured.
    Does acrobat stop working when you open this specific pdf file or with any pdf file that you open?
    Regards,
    Rahul

  • Applet execution in a native window

    Hi,
    How can i send a native window handle (win32 HWND) to a java class using JNI. I am trying to embed my applet in the native window.

    Hi,
    Its giving me some trouble. But this concept is used by the plugin for some browsers to render applets in thier native window. I am trying similar approach.
    thanks

  • 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!

  • How to ivoke Java within native window

    The JNI tutorial says that JNI can be used (for example)to add applet support to a browser.
    Whenever I invoke classes via JNI they create their own top-level windows. How can you invoke java so that the application runs within a native window?

    Yes, that would certainly be onme way of doing it. I am sure that there is another way using native methods only that would be more efficient

  • Unable to load php file into native window..

    Hi Guys,
    Im using flash cs3 as my development environment. what i was trying to do is creating a small login application using Air. I must say im still a newbie to flash air. as far as my login system concern i have managed following tasks,
    1. send username ans password using post and validate through php
    2. get the result back to flash application and open up a new native air window if the login is success.
    3. close the login window.
    now what i want to do is load my PHP application inside that newly open native window. How can i do it. I tried using Loader() method but it only worked for images not for php or html files.
    heres how I tried to use the loader method,
    var url:String = "http://localhost/Flash/login/welcome.php";
    var fileLoader:Loader = new Loader();
    fileLoader.load(new URLRequest(url));
    win.stage.addChild(fileLoader);
    This failed.
    Does anyone know how to load a PHP file into a Native window? Your help highly appreciate it.
    Just in case for the people who wants to know who I did the above mentioned tasks heres the code,
    Posting data to PHP server
    function sendLoginData() {
         if(txtUserName.text=='')
              txtBox.text = 'Username is empty';
         else if(txtPassword.text=='')
              txtBox.text = 'Password is empty';
         else
              var variables:URLVariables = new URLVariables();
              variables.UserName = txtUserName.text;
              variables.Password = txtPassword.text;
              var request:URLRequest = new URLRequest("http://localhost/Flash/login/login.php"); 
              var loader:URLLoader = new URLLoader(); 
              loader.dataFormat = URLLoaderDataFormat.TEXT; 
              request.data = variables; 
              request.method = URLRequestMethod.POST; 
              loader.addEventListener(Event.COMPLETE, handleComplete); 
              loader.addEventListener(IOErrorEvent.IO_ERROR, onIOError); 
              loader.load(request);
    Handdle the returned data
    function handleComplete(event:Event):void
         var variables:URLVariables = new URLVariables(event.target.data); 
         if(variables.errorcode==0)
              var url:String = "http://localhost/Flash/login/welcome.php";
              try {                             
                   //Native window
                   var options:NativeWindowInitOptions = new NativeWindowInitOptions();
                   options.systemChrome = NativeWindowSystemChrome.STANDARD;
                   options.transparent = false;
                   options.maximizable=false;
                   var win:NativeWindow = new NativeWindow(options);
                   win.title = 'welcome page';
                   //win.width = 900;
                   //win.height = 900;
                   /*var fileLoader:Loader = new Loader();
                   fileLoader.load(new URLRequest(url));
                   win.stage.addChild(fileLoader);*/
                   win.maximize();
                   win.activate();
                   stage.nativeWindow.close();
              } catch (e:Error) {
                trace("Error occurred!");
         else
              txtBox.text = 'Invalid logins';
    function onIOError(event:IOErrorEvent):void
         trace("Error loading URL."); 
    PHP code
    <?php
    $username = addslashes($_POST['UserName']);
    $password = addslashes($_POST['Password']);
    //do your database checking here. this is an example
    if($username=='niroshan' && $password=='123456')
         echo "errorcode=0"; 
    else
         echo "errorcode=1"; 
    ?>
    Call the function when pressing the submit
    cmdButton.addEventListener(MouseEvent.CLICK,readySendLoginData);
    function readySendLoginData(evt:MouseEvent){    
      sendLoginData();
    Thanks,
    best regards,
    Niroshan

    Thats right, HTMLLoader should solve the issue as Loader used for JPEG, PNG OR GIF files loading as per my knowledge

  • Can Bootcamp and Parallels share the same Windows applications and data?

    I'm looking at getting an Intel iMac which will let me throw away my old PC - Yeah!
    I will have a couple of Win apps that I will need to hang on to (Quicken - Quicken for Mac is horrible, but that's another tghread). Anyway, can Bootcamp and Parallels share the same Windows applications and data?
    My thought would be to allow my wife to access Quicken from Parallels and not have to reboot. She will only need lightweight access and the overhead of running virtualization wouldn't impact her. I, on the other hand, would want to occasionally boot natively into Windows and run the same application with the same datafile. Is this possible?
    Thanks and looking forward to joining the MacIntel world!

    Thanks for all of the freplies. I suspected that BootCamp and Parallels could not shar ethe same partition, but wanted to verify. To address some of the other posts:
    Re: Quicken vs MoneyDance - I looked at MoneyDance a while back and while it is comparable to Quicken for Mac, it isn't comparable to Quicken for Windows (ergo, Quicken for Mac isn't comparable to Quicken for Windows!). But, as I said, that is a topic for another thread!
    Re: Using Bootcamp/Parallels for only one app: I actually have several apps that I still need access to on Windows. I work with many business applications than only run/are supported on Windows as well as receive some complex Office documents which Office for Mac cannot handle. Quicken (for Windows 2007) was just the best example of a consumer app where I could see wanting access from both OS X and Windows.

  • Resolution 1440 x 900 for Windows applications?

    I am attempting to use MacBook Pro (15") to run Windows applications. Some of these are written for a screen resolution of 1280 x 1050, but the max available on the MBP is seemingly 1440 x 900. Is there any way around this, short of buying an external monitor or the 17" MBP?

    I was thinking of a solution along the lines of, maybe the device handlers could reduce the Windows app image to the lower native resolution, which could then be displayed.

  • How To open a PDF in New Native Window in Air

    Hi All,
    I have a Air application.I want to open an pdf located in desktop in new native window.
    Thanks,
    Amol.

    There is no easy way to implement this. Its better to instruct users the shortcut to open the link in new window.
    --Cheers

Maybe you are looking for

  • Animated Gif files in Captivate

    I have created an animated GIF file in Photoshop that i want to use in my captivate file. The file wont preview in any of the preview modes other than the HTML5 output preview. All other previews just show the first frame of the GIF file. If i chose

  • CC: Selecting slices in "save for web"

    Hi, today, I tried to use the export function "save for web" in Illustrator CC 17.1.0 for the first time in many weeks. I created a document with some slices. Strangely, in the dialogue of "save for web", the image preview isn't shown in the original

  • How to upgade to 4.1.1?

    I've got 3.0.5 on my computer and when I do a version check, it says that is the latest. I'm running OSX 10.5. Am I missing something? Thanks in advance!

  • After downloading the new Firefox 9.0.1 and trying to execute the file, I get a message "File Corrupt" and cannot install the new version.

    I always update Firefox and have the latest 8.0. This had never happened before. I tried to execute it twice, but still got the same message. I have Windows XP.

  • Issue regarding fb60

    Hi: When I am trying to post in fb60,it said that "enter rate rmb/usd rate type M for 2009/09/14 in the system settings,but the currence of g/l account and the currency of company code are all rmb,what's wrong is it ?