iT邦幫忙

0

applet跑.jar

想請問一下applet 與 .jar的運作作相關問題

目前用的是下列這個
https://www.tightvnc.com/download.php

載點
https://www.tightvnc.com/download/2.8.3/tvnjviewer-2.8.3-bin-gnugpl.zip
裡面提供了一個範例,基本上三個重點:

archive="tightvnc-jviewer.jar" 放jar路徑
code="com.glavsoft.viewer.Viewer" 放要跑哪個物件
width="1" height="1" 長寬設定
param name="Host" value="localhost" 放參數

已經安裝了JAVA但跑起來沒反應,畫面空白,想請問是還漏了什麼
一片空白只有a區塊顯示
https://ithelp.ithome.com.tw/upload/images/20180704/20102709bzbn0hwlL8.png

程式碼主結構如下
viewer-applet-example.html

<!--
  ~ Copyright (C) 2010 - 2014 GlavSoft LLC.
  ~ All rights reserved.
  ~
  ~ -----------------------------------------------------------------------
  ~ This file is part of the TightVNC software.  Please visit our Web site:
  ~
  ~                       http://www.tightvnc.com/
  ~
  ~ This program is free software; you can redistribute it and/or modify
  ~ it under the terms of the GNU General Public License as published by
  ~ the Free Software Foundation; either version 2 of the License, or
  ~ (at your option) any later version.
  ~
  ~ This program is distributed in the hope that it will be useful,
  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  ~ GNU General Public License for more details.
  ~
  ~ You should have received a copy of the GNU General Public License along
  ~ with this program; if not, write to the Free Software Foundation, Inc.,
  ~ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  ~ -----------------------------------------------------------------------
  ~
  -->

<html>
<head>
    <title>TightVNC desktop</title>
</head>
<body>
<applet archive="tightvnc-jviewer.jar"
        code="com.glavsoft.viewer.Viewer"
        width="100" height="100">
    <param name="Host" value="localhost"/>
    <!-- Host to connect. Default:  the host from which the applet was loaded. -->
    <param name="Port" value="5900"/>
    <!-- Port number to connect. Default: 5900 -->
    <!--param name="Password" value="" /--> <!-- Password to the server (not recommended to use this parameter here) -->
    <param name="OpenNewWindow" value="yes"/>
    <!-- yes/true or no/false. Default: yes/true -->
    <param name="ShowControls" value="yes"/>
    <!-- yes/true or no/false. Default: yes/true -->
    <param name="ViewOnly" value="no"/>
    <!-- yes/true or no/false. Default: no/false -->
    <param name="AllowClipboardTransfer" value="yes"/>
    <!-- yes/true or no/false. Default: yes/true -->
    <param name="RemoteCharset" value="standard"/>
    <!-- Charset encoding is used on remote system. Use this option to specify character encoding will be used for encoding clipboard text content to. Default value (when parameter is empty): local system default character encoding. Set the value to 'standard' for using 'Latin-1' charset which is only specified by rfb standard for clipboard transfers. -->

    <param name="ShareDesktop" value="yes"/>
    <!-- yes/true or no/false. Default: yes/true -->
    <param name="AllowCopyRect" value="yes"/>
    <!-- yes/true or no/false. Default: yes/true -->
    <param name="Encoding" value="Tight"/>
    <!-- Possible values: "Tight", "Hextile", "ZRLE", and "Raw". Default: Tight -->
    <param name="CompressionLevel" value=""/>
    <!-- 1-9 or empty. Empty means server default -->
    <param name="JpegImageQuality" value=""/>
    <!-- 1-9, Lossless or empty. When param is set to "Lossless" no jpeg compression used. Empty means server default -->
    <param name="LocalPointer" value="On"/>
    <!-- Possible values: on/yes/true (draw pointer locally), off/no/false (let server draw pointer), hide). Default: "On"-->
    <param name="ConvertToASCII" value="no"/>
    <!-- Whether to convert keyboard input to ASCII ignoring locale. Possible values: yes/true, no/false). Default: "No"-->

    <param name="Tunneling" value="auto"/>
    <!-- Tunneling. Possible values:
        auto - allow viewer to choose tunneling mode,
        none/no - no tunneling use,
        SSL - choose SSL tunneling when available.
        Default: "auto" -->

    <param name="colorDepth" value=""/>
    <!-- Reserved for future. Possible values: 6, 8, 16, 24, 32 (equals to 24). Only 24/32 is supported now -->
    <param name="ScalingFactor" value="100"/>
    <!-- Scale local representation of the remote desktop on startup. Default is 100 means 100% -->
    <!--param name="showConnectionDialog" value="yes" /-->
    <!-- Set to "No" if you want not to show initial connection dialog. Default: "Yes". -->
    <param name="AppletGoodbyeURL" value="about:blank"/>
    <!-- URL to be redirected on applet stopping. When blank or absent stop applet and do nothing. -->
    <!-- SSH tunneling options -->
    <param name="sshHost" value=""/>
    <!-- SSH host name. -->
    <param name="sshUser" value=""/>
    <!-- SSH port number. When empty, standard SSH port number (22) is used -->
    <param name="sshPort" value=""/>
    <!-- SSH user name. -->

</applet>
<br/>
<a href="http://www.tightvnc.com/">TightVNC Web Site</a>
</body>
</html>

1 個回答

0
darwin0616
iT邦新手 2 級 ‧ 2018-07-05 09:05:25

請參考下面龜甲文官方提供各種瀏覽器開啟applet的設定頁面:
How do I enable Java in my web browser?

我要發表回答

立即登入回答