\section{KJava\-Applet\-Widget Class Reference}
\label{classKJavaAppletWidget}\index{KJavaAppletWidget@{KJavaAppletWidget}}
A widget for displaying Java applets.  


{\tt \#include $<$kjavaappletwidget.h$>$}

Inheritance diagram for KJava\-Applet\-Widget:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=69pt]{classKJavaAppletWidget__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KJava\-Applet\-Widget:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=295pt]{classKJavaAppletWidget__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KJava\-Applet\-Widget} ({\bf QWidget} $\ast$parent=0, const char $\ast$name=0)\label{classKJavaAppletWidget_a0}

\item 
{\bf KJava\-Applet} $\ast$ {\bf applet} ()
\item 
void {\bf show\-Applet} ()
\item 
{\bf QSize} {\bf size\-Hint} () const \label{classKJavaAppletWidget_a4}

\item 
void {\bf resize} (int, int)\label{classKJavaAppletWidget_a5}

\end{CompactItemize}
\subsection*{Protected Slots}
\begin{CompactItemize}
\item 
void {\bf set\-Window} (WId w)
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
void {\bf show\-Event} ({\bf QShow\-Event} $\ast$)\label{classKJavaAppletWidget_b0}

\end{CompactItemize}
\subsection*{Static Protected Attributes}
\begin{CompactItemize}
\item 
static int {\bf applet\-Count} = 0\label{classKJavaAppletWidget_t0}

\end{CompactItemize}


\subsection{Detailed Description}
A widget for displaying Java applets. 

KJava\-Applet\-Widget provides support for the inclusion of Java applets in {\bf Qt} and {\bf KDE} applications. To create an applet, you must first create a context object in which it will run. There can be several applets and contexts in operation at a given time, for example in a web browser there would be one context object for each web page. Applets in the same context can communicate with each other, applets in different contexts cannot. Once you have created a {\bf KJava\-Applet\-Context}{\rm (p.\,\pageref{classKJavaAppletContext})}, you can create as many applets in it as you want.

Once you have created the applet widget, you should access the {\bf applet()}{\rm (p.\,\pageref{classKJavaAppletWidget_a2})} method to call the various set\-XXX methods to configure the applet, They correspond to the HTML tags used to embed applets in a web page. Once the applet is configured, call the {\bf create()} method to set things in motion. The applet is running when it first appears, but you can start or stop it when you like (for example if it scrolls off the screen).

This widget works by using the {\bf KJava\-Applet\-Server}{\rm (p.\,\pageref{classKJavaAppletServer})}, which fires off a Java server process with which it communicates using the {\bf KDE} Java Applet Server (KJAS) protocol over stdin and stdout. The applet windows are swallowed and attached to the {\bf QWidget}, but they are actually running in a different process. This has the advantage of robustness and reusability. The details of the communication are hidden from the user in the KJASApplet\-Server class. Normally only a single server process is used for all of the applets in a given application, this is all sorted automatically. The KJAS server is 100\% pure Java, and should also prove useful for people wishing to add java support to other systems (for example a perl/Tk binding is perfectly feasible). All you need to do is implement the protocol and (optionally) swallow the applet windows.

The applet support in {\bf KDE} is still dependent on the KWin Window Manager. The applet swallowing will not work under other Window Managers. Hopefully this will be fixed in the future.

For a description of the KJAS protocol, please see the KJAS\_\-GRAMMAR.txt file.

\begin{Desc}
\item[Author:]Richard J. Moore, {\tt rich@kde.org} 

Wynn Wilkes, {\tt wynnw@caldera.com} \end{Desc}




Definition at line 78 of file kjavaappletwidget.h.

\subsection{Member Function Documentation}
\index{KJavaAppletWidget@{KJava\-Applet\-Widget}!applet@{applet}}
\index{applet@{applet}!KJavaAppletWidget@{KJava\-Applet\-Widget}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KJava\-Applet}$\ast$ KJava\-Applet\-Widget::applet ()\hspace{0.3cm}{\tt  [inline]}}\label{classKJavaAppletWidget_a2}


Returns a pointer to the {\bf KJava\-Applet}{\rm (p.\,\pageref{classKJavaApplet})}. 

Use this to configure the applet's parameters. You can also use it to start and stop the Applet. 

Definition at line 91 of file kjavaappletwidget.h.\index{KJavaAppletWidget@{KJava\-Applet\-Widget}!showApplet@{showApplet}}
\index{showApplet@{showApplet}!KJavaAppletWidget@{KJava\-Applet\-Widget}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KJava\-Applet\-Widget::show\-Applet ()}\label{classKJavaAppletWidget_a3}


Tells the Applet\-Server to create, initialize, and show the Applet. 



Definition at line 67 of file kjavaappletwidget.cpp.

References KJava\-Applet::create(), KJava\-Applet::is\-Created(), and set\-Window().\index{KJavaAppletWidget@{KJava\-Applet\-Widget}!setWindow@{setWindow}}
\index{setWindow@{setWindow}!KJavaAppletWidget@{KJava\-Applet\-Widget}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KJava\-Applet\-Widget::set\-Window (WId {\em w})\hspace{0.3cm}{\tt  [protected, slot]}}\label{classKJavaAppletWidget_j0}


This slot is called by KWin when new windows are added. 

We check to see if the window has the title we set. If so we embed it. 

Definition at line 79 of file kjavaappletwidget.cpp.

References QXEmbed::embed(), endl(), kd\-Debug(), and QWidget::set\-Focus().

Referenced by show\-Applet().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kjavaappletwidget.h\item 
kjavaappletwidget.cpp\end{CompactItemize}
