EMBED IE in JAVA

hi guru's
I wanted to embed IE browser as part of my Application to show the user a Preview screen of an javascript , i dont have any other option to excute and show the script to the user so i thought to embed a IE browser into my java application and display the output to the user .
I am not able to ge the solution to achieve it.Pls could some one guid on the right one

* Method 1:
<disclaimer>i never tried it myself</disclaimer>
I've read a few days ago, that it is possible to force IE to render itself in a java application using Java 2 AWT Native Interface.
Basically you would have to get the windows HWND of the Canva you want IE to be in using some dirty & deprecated hack. (@see getPeer())
Then in your jni dll there should be a way to attach an IE control to your canva. (Solution to that part must be in the msdn somewhere...)
The link to the article is somewhere on that page : http://www.jguru.com/faq/topicindex.jsp?topic=JNI but it seems to be dead right now. It was working a few days ago so i guess it will be back soon.
* Method 2
<disclaimer>I've done it, it works like a charm.</disclaimer>
Write a small application which embed IE, and use either TCP/IP or CORBA to send control to it.
The only drawback is that the IE application will open in another window, which might be ugly if your application has an MDI design, but at least you'll have "full" control over the application. (if you write the corba interface or design the tcp/ip protocol to pilot your app of course.)
* Method 3
http://ostermiller.org/utils/Browser.html this page has a class that can open a browser on most platform.
good luck to you.

Similar Messages

  • How to embed/perform a Java Swing form into webased Swing form

    How to embed/perform a Java Swing form into webased Swing form or any alternative.
    Suppose i have 2 or more swing forms which are desktop applications but i want those forms to be now webbased..so how can i do this.Will i need to change the swing coding or will have to keep the swing design same.what can be the best Solution.

    You can launch your existing desktop app via the web using [Java Web Start|http://java.sun.com/javase/technologies/desktop/javawebstart/index.jsp]

  • How to embed excel in java bean area on oracle forms 9i?

    Hi,
    I am trying to embed excel in oracle forms 9i using java bean. I want to open excel sheet in the bean area not as seprate application. Means i donot want to excel running separately from forms on the machine.
    If any body knows the solution please reply.
    Best regrads,
    Shiraz

    Hi
    Is it possible to create a java bean, with a click event which populates data from database table to an excel sheet.
    The data(can be obtained in a string format with delimiters, but can anyone help me in exporting this into an excel sheet). and also to provide user to take prints of the data in the excel sheet.
    If Print of the JTable could be done(by settin printable as this), but this involves unwanted buttons to be printed, and entire table is not available in the spread sheet format.
    Thanks in Advance
    Deepa

  • Embed Flash into Java Application

    Hello Friends,
    I need to develop a Java Swing application which can display the menus using Flash. So basically I want to embed flash in the Java swing application such that when the user clicks a button in the flash menu, the menu will pass a command to the Java Swing application and vice-versa.
    I am looking to use Flash this way, because using Flash we can create really good looking and smooth menus as opposed to Java Swing. I also want a solution which will be platform independent.
    Please let me know how to do this. Atleast give me some pointers or website tutorial which will guide me in this.
    Thanks a ton.
    S

    moshegym wrote:
    como puedo visualizar archivos swf en javaSer?a mejor hacer un "thread" (?hilo?) nuevo aqu?, y escribir en ingl?s.
    Tambi?n, T? debe mirar aqu?:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=695658
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=605662
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=686514
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=749760
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=682919
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=580785
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=628218
    http://forum.java.sun.com/thread.jspa?threadID=637018&messageID=3719465
    (I found this information in this link: http://forum.java.sun.com/thread.jspa?forumID=57&threadID=768376)
    Edited by: Encephalopathic on Mar 25, 2008 2:40 PM

  • Unable to Embed ActiveX in Java

    Hi,
    We are trying to embed an activex control (ocx control) in java using third party tool JacoZoom. We are not able to create an instance of com.inzoom.axjni.ActiveX class using
    ActiveX w = new ActiveX("DTDLG.DTDlgCtrl.1");
    System.out.println(" W : " + w);
    While printing the value of this object it displays
    the following:
    com.inzoom.axjni.ActiveX[canvas0,0,0,0x0,invalid]
    We are not able to find out why it is invalidating the object?
    Please guide us.........
    Thanks,
    Vimal

    The object for com.inzoom.axjni.ActiveX seems to have been created ok. The print out shows that you have an instance of the class.
    After creation, you will need to add the object to a visual component. Since you are using ActiveX (not JActiveX), you should use an AWT container to add the instance. Once added and once the parent is visible on screen, it will get validated in the sense that it can paint itself on screen.
    If you use Swing, you should use JActiveX instead of ActiveX.
    As far as I understand how JacoZoom sets up ActiveX, the "invalid" only means that the component does not yet have a device (screen) to paint itself on.
    Good luck, Sylvia

  • How to Embbed Tomcat in Java Application

    Hi
    At the moment i have the basic setup of applicatoin like this
    first i run the file "Tomcat.bat" that start the tomcat server, in a specific directory and also the webservice is enabled.
    Secondly then i run the Program.java that uses the web service started in the first step.
    However, now i want to start the webservice (Apache Tomcat) from with in the Java Application. So that whenever, i need to i can start it. I also need the control over ports, so as to which port should the tomcat run on...
    So at the end of the my simple question is how to run tomcat from with in a java application. At the moment i can not use the Runtime.exec() since this is a real time application and using Runtime.exec() causes some problems over the locking of threads...
    Any Help would be greatly appreciated.
    Thanks for looking.

    i looked at the my catalina.sh script file and see that java runs "org.apache.catalina.startup.Bootstrap" class first so that i think by instaitating that class and preparing the parameters that needed will start the tomcats "org.apache.catalina.startup.Bootstrap" class and that class will load all the needed parts and start serving request.
    and how to change starting port ? i thought that you can generate the server.xml on fly and after creating that file you can start tomcat.
    these are my opinion but i think these are true,i have no time to try this if i can i will write here.or if somebody can try write here.

  • Embed ActiveX in Java GUI

    i need embed Internet Explorer or Flash Macromedia into mi application make in java

    get API at http://www.simtel.net/product.php?url_fb_product_page=60701
    and read example with MS IE. Example sources are packed with binaries in proper JARs.

  • How to view excel spreadsheet in java

    Hello
    Is there a way to open an excel spreadsheet in java? I don't mean reading and writing from an excel file, but instead embedding excel in java. For example instead of launching excel using the Desktop class and opening a new excel window, Java would open an instance of excel and add it to Jframe or Jpanel. Sort of like what Eclipse does when you Open a file with In_Place Editor. Google returns results on how to use some windows dll file and using active x control or whatnot.. Was wondering if there is a better and simpler way..
    Thank you.

    oplead wrote:
    Hello
    Is there a way to open an excel spreadsheet in java? I don't mean reading and writing from an excel file, but instead embedding excel in java.Ah yes, "embed" is the word you want as your google keyword, not "open". My first try with "embed excel in Java" returned as the first link a page from a company named JIntegra for which this seems to be their main business. Here's the link I found, just for information:
    [http://j-integra.intrinsyc.com/support/kb/Article.aspx?id=30421|http://j-integra.intrinsyc.com/support/kb/Article.aspx?id=30421]

  • Java APP inside a Win32 Window

    Hello,
    Q1: I need to embed a complete java swing application inside an existing win32 application window (I have the HWND of it).
    How to do this ?
    Q2: Is it possible to set the native Win32 parent window of a JFrame with JNI ?
    Cheers,
    Mik

    This can be done, but is a little complicated.
    Firstly create a subclass of Canvas, with the following native method
    JNIEXPORT jlong JNICALL MyCanvas_getWindowInfo( JNIEnv *env, jobject canvas )
         JAWT      awt;
         jlong   handle      = 0;
         // Get the AWT
         awt.version = JAWT_VERSION_1_3;
         if( JAWT_GetAWT( env, &awt ) == JNI_TRUE )
              // Get the drawing surface
              JAWT_DrawingSurface     *ds = awt.GetDrawingSurface( env, canvas );
              if( ds )
                   // Lock the drawing surface
                   jint lock = ds->Lock( ds );
                   if( (lock & JAWT_LOCK_ERROR) == 0 )
                        // Get the drawing surface info
                        JAWT_DrawingSurfaceInfo     *dsi = ds->GetDrawingSurfaceInfo( ds );
                        if( dsi )
    #if WIN32
                             JAWT_Win32DrawingSurfaceInfo *info   = (JAWT_Win32DrawingSurfaceInfo *)dsi->platformInfo;
                             handle = (jlong)GetParent( info->hwnd );
    #endif
                             // Free the drawing surface info
                             ds->FreeDrawingSurfaceInfo( dsi );
                        // Unlock the drawing surface
                        ds->Unlock( ds );
                   // Free the drawing surface
                   awt.FreeDrawingSurface( ds );
         return handle;
    }Next in C, do the following
    1. Create a JWindow.
    2. Make it visible.
    3. Add an instance of MyCanvas to the JWindow.
    4. Call the getWindowInfo method, which will return the window handle of the frame.
    5. Remove the instance of MyCanvas, of make it invisible.
    6. Reparent the frame window using SetParent( handleOfApp, frameHandle );7. Change the style of the frame so it doesn't think its a top level window SetWindowLong( frameWindow, GWL_STYLE, WS_CHILD );The last step is to simply add you java frame (or whatever) to this newly created window.

  • Embedding Microsoft Word in Java

    Hi,
    i want to embed Microsoft word in my java application. Can anyone one tell me how to embed word in java. By embedding, I don't mean to invoke word from java. I want to use word as an editor in java.
    Thanks,
    Ashu

    COM-JAVA bi-directional bridge can be used to transfer calls between Java-COM-Java. Almost all the MS products come as COM Components which by COM specifications can be reused or upgraded with out any need for recompilation.
    By using bi-directionaly bridge we can make such a way that Word is extended from Canvas and add to any java component. All the connection points (In COM Tech, Connection points are used for event firing) can be converted as events and methods calls can be directed thru bridge.
    I checked out JIntegra. Its good and working fine. They give u a limited time evaluation version and after that you have to pay. Check out JIntegra at linar.com
    Check this thread for a sample code. It shows how I can use IE in panel.
    http://forum.java.sun.com/thread.jsp?forum=57&thread=143800
    Good luck,
    Mohan

  • Can java studio creator import MIME?

    HI , i have 2 question
    1.> i am tring to make a page that stream music .wma usually in normal html
    <object id="mediaPlayer"
    classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
    codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715"
    type = "application/x-oleobject">
    <param name="autostart" value="true">
    <param name="showcontrols" value="true">
    <param name="filename" value="here ... music...name">
    <param name="ShowStatusBar" value="true">
    <embed type="application/x-mplayer2"pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="question.wma" autostart="0" showcontrols="1" showstatusbar="1">
    </embed> </object>
    in java studio creator can i use that ? on the place to put music name can i gain control so i can put what ever name i want depend on user?
    2.> I make a class use File myFile = new File ("C:\\Music"); last time it's work but now it said source cannot be found? how do i fix that?
    thank you for advise

    Here comes your help;-) Or at least I hope so;-)
    The problem is, that you really want components in order to be able to change parameters etc from your application.
    http://blogs.sun.com/roller/page/marcoscorner#my_adventure_in_component_land
    Have fun;-)
    -- Marco

  • Java fx text editor

    Hi guys,
    I'm new of Java Fx technology, that I find fantastic!
    What I want know is to embed in my java fx application a rich text editor (like a smart word processor).
    What I need is this:
    1) open a document format in text editor
    2) perform formatting operation, like spacing, bolding, change fonts and other
    3) save / print document
    Do you have any idea is does exists some free for commercial use project?
    Thanks, Regards

    I think javafx not contains such component yet, but you can try to use editor written with standard java. You can use standard java components and packages in your javafx projects.

  • My users cannot see my java applets

    I have a few java applets on my web page, but most of the users cannot see them.
    I have changed my html's with the HTML Converter, hoping to overcome the problem, and got the following codes in my html's:
    In the <OBJECT> tag:
    http://java.sun.com/products/plugin/autodl/jinstall-1_4-windows-i586.cab#Version=1,4,0,0
    In the <EMBED> tag:
    http://java.sun.com/products/plugin/index.html#download
    Questions:
    1. Will these URL's in the html automatically download, or tell the user about the java installations he needs?
    2. Is it the Java-Plugin or the Java Virtual Machine users have to download to view java programs?
    Even if you don't have the answer I would be grateful if you can tell me if you are able see my java applet. If you can, you should see a flashing text reading "Mixed" in the middle of this page:
    http://medlem.spray.se/kungsgarden/mixed_e.htm
    Best regards,
    Mona

    Questions:
    1. Will these URL's in the html automatically
    download, or tell the user about the java
    installations he needs?Yes, on most browsers, the URLs and html you have written will automatically download the plugin or tell them where to go to get it. As a rule of thumb, if your users are on IE the plugin will automaitcally be downloaded. If your users are on Netscape they will be directed to the url in the embed tag. Your page looks right. It could be the code has an error in it and it is not the html. See my previous reply. Looks for errors and post them for me to see.
    2. Is it the Java-Plugin or the Java Virtual Machine
    users have to download to view java programs?The Java plugin run the Java Virtual Machine. So, they have to download both to view applets, but they come together since the Java Virtual Machine is inside the Java Plugin.

  • Unable to add java files with package statement

    Hi all,
    I have the following problem. I add to my project(JBuilder8) a set of java files that
    they have in their headers the statement...
    package jp.gr.java_conf.tame.swing.table;except one with statement...
    package jp.gr.java_conf.tame.swing.colorchooser;If i try to compile the project i get the following message many times for
    each file...
    "AttributiveCellRenderer.java": Error #: 901 : package
    jp.gr.java_conf.tame.swing.table stated in source
    C:\Development\JBProjects\cellspan\AttributiveCellRenderer.java does not
    match directory . at line 4, column 36What i have to do to embed correctly the java files?
    Thank you for advance, kostas.

    Sounds like your source file is in the wrong directory. The directory the file's in has to match the package.

  • Convert strings to executable java code

    Hey,
    I'm not sure how easy or hard this is to accomplish, but I am looking for a way to take a string from a JTextField and use it as a control structure for an IF block.
    For example, the user inputs 'keyword=="test" || keyword=="test2"' I want to use it in an if block to control it.
    Is there a way to do this? I realize the java file is already compiled in a class, so the string would probably be incapable of doing such a thing.
    Any thoughts would be appreciated!

    Basically this is impossible, because Java is a compiled language, but there are ways around it.
    Actually the ways are all basically one way: use an interpreted language. You can embed one into Java. You can write your own, new language (it could be a small simple mini-language, for example one that only evaluates boolean expressions; this is easier than it sounds), or you can use one that already exists.
    There already is an interpreted language for Java. It's called BeanShell. Also I'm told that someone has written a javascript interpreter for Java, but I don't know the details.
    I'd suggest Googling for BeanShell. It sounds like the quickest, easiest solution.
    But be careful: letting users execute arbitrary code can be a huge security hole.

Maybe you are looking for