Yongzhong embedded browser programming guide

Source: Internet
Author: User

Yongzhong office is an office software developed in Java and can be used across platforms. This article briefly describes how to embed yongzhong office into a browser (including Internet Explorer in windows and Mozilla in Linux.

The yongzhong office embedded browser is implemented by using an applet. The yongzhong office applet embedded in the webpage is referred to as "eio_applet ". Before starting programming, check the following Configuration:

For Windows:

  • Open the Java Plug-in Control Panel through "Control Panel"-"Java Plug-in;
  • Go to the "Java" Page and click "View" in "Java small application runtime Settings ", in the pop-up "Java runtime Settings", the JRE version used by yongzhong office is 1.5.0 _ 01. When yongzhong office is installed, the "Java runtime parameter" is set to "-djava. class. path = c: \ eioffice. jar "(based on the actual installation path ).

For Linux:

  • Enter the j2re installation directory, for example:

    CD/usr/Java/j2sdk1.5.0 _ 01
  • Enter the JRE installation path and run controlpanel. For example:

    ./Usr/Java/j2sdk1.5.0 _ 01/bin/controlpanel

    The javaplug-in control panel is displayed, as shown below.

    • On the "advanced" Page, check and set the "Java runtime parameter". This parameter is automatically configured when yongzhong office is installed.
    • Some browsers in Linux do not support javaplug-in by default, so you need to configure it manually. You can find its plug-in java_home/JRE/plugin/i386/ns610/, and then use the ln command to link it to mozilla_home/plugins.

      Ln-s java_home/JRE/plugin/i386/ns610/libjavaplugin_oji.so using illa_home/plugins

      Note: Use the ln link command. Do not copy it.

      Ln-s java_home/JRE/plugin/i386/ns610/libjavaplugin_oji.so ~ /. Mozilla/plugins

      NOTE: If there is no plugins directory, create one first.

  Compile yongzhong office Applet

The following program demonstrates how to obtain the yongzhong office instance and display it in the applet.

/**

* @ Author evermore

*/

Import Application. application; // import the yongzhong office class

Import java. AWT. container;

Public class eioapplet extends javax. Swing. japplet

{

/** Creates a new instance of EIO applet */

Private void createinstance ()

{

Application. createinstance (this); // create a permanent office applet instance

Getcontentpane (). Add ("center", application. getinstance (); // obtain the applet instance

Application. settoolbarvisible (barconstants. menubar_index, false); // hide the permanent office menu bar

}

Public void start ()

{

Createinstance ();

}

Public void createwordprocess ()

{

Workbooks workbooks = application. getworkbooks (); // obtain the workbook set

Workbooks. addworkbook (globalconstants. wordprocessor); // create a blank text processing document

}

}

Use the following command on the command line to compile the Java file (ensure that yongzhong office has been installed)

Javac-classpath % eio_home %/eioffice. jar;. eioapplet. Java

Here, eio_home is the path of the permanent office automatically set when the system installs the permanent office. If the java_home environment variable is not set, the specific path of JRE is filled in before the javac command.

  Compile webpage files

To embed yongzhong office in a webpage, you only need to add the <APPLET> identifier to the webpage code, as shown below:

<HTML>

<Head>

<Meta http-equiv = "Content-Type" content = "text/html; charset = gb18030">

<Title> example of embedded browser </title>

</Head>

<Script language = JavaScript>

Function createwordprocess ()

{

Document. eioapplet. createwordprocess ();

}

</SCRIPT>

<Body>

<APPLET width = "800" Height = "600" code = "eioapplet. Class" name = "eioapplet">

</APPLET>

<P> <input type = "button" value = "New Text Processing document" name = "B3" onclick = "createwordprocess ();"> </P>

</Body>

</Html>

Make sure that the webpage file and the eioapplet. Class file are in the same directory.

Open webpage files

Double-click to open the webpage and click "create text processing document". The EIO applet creates a blank text processing document.

Note: This is the runtime diagram of yongzhong office embedded with Red Flag Linux 4.0. You may notice that yongzhong office does not have a menu bar in the browser. You can use application. settoolbarvisible (100, false) to hide the permanent office menu bar.

In the yongzhong office embedded in a webpage, the functions provided by yongzhong office can be the same as those of yongzhong office running on the desktop. The vast majority of functions also apply to eio_applet.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.