applet

如何实现报表直接打印需求

若如初见. 提交于 2019-12-17 09:41:44
直接打印是常见的报表打印需求,即点击打印按钮后直接把结果输出到打印机,使用户的操作更加简便。润乾报表提供了三种不同的打印方式,都可以实现直接打印功能,下面我们就来看一下每一种方式的具体实现方法。 一、 直接打印效果 1、applet 打印 Applet 打印目前只支持 IE 内核浏览器,且需要客户端至少正确安装配置了 jre 环境。 在 IE 内核浏览器进行直接打印时,会直接把报表结果输出到默认打印机。 2、Flash 打印 常用浏览器中均可进行 flash 打印, IE 内核浏览器和火狐浏览器下进行 flash 直接打印时,会弹出打印机选择页面,选择打印机后可直接输出到打印机,如下图所示: 谷歌内核浏览器下进行 flash 直接打印时,会弹出带报表结果的打印页面,如下图所示: 3、PDF 打印 IE 内核浏览器进行 PDF 直接打印时,需要安装 adobe reader 插件,而谷歌火狐浏览器则没有此要求。 IE 内核浏览器和火狐浏览下进行 PDF 直接打印时,会弹出打印机选择页面,选择打印机后可直接输出到打印机,如下图所示: 谷歌内核浏览器进行 PDF 直接打印时会弹出带报表结果的打印页面,如下图所示: 二、 标签属性实现方式 润乾报表提供了标签属性配置方式,可以在报表结果显示上方进行直接打印操作,如下图所示: 目前标签属性方式只提供了 applet 直接打印的配置:

Get the correct local IP address from java applet

为君一笑 提交于 2019-12-17 07:39:58
问题 I would like to determine the local IP address from my java applet. The problem is when there are several IP adresses on the same machine, which has LAN and internet connections (palm, VMWare...). Here is my test : public static void main(String[] args) { try { String hostName = InetAddress.getLocalHost().getHostName(); System.out.println("HostName = " + hostName); System.out.println("HostAddressLocal = " + InetAddress.getLocalHost().getHostAddress()); InetAddress[] inetAddresses =

getClassLoader().getResource() returns null

☆樱花仙子☆ 提交于 2019-12-17 06:51:34
问题 I have this test app: import java.applet.*; import java.awt.*; import java.net.URL; public class Test extends Applet { public void init() { URL some=Test.class.getClass().getClassLoader().getResource("/assets/pacman.png"); System.out.println(some.toString()); System.out.println(some.getFile()); System.out.println(some.getPath()); } } When I run it from Eclipse, I get the error: java.lang.NullPointerException at Test.init(Test.java:9) at sun.applet.AppletPanel.run(Unknown Source) at java.lang

Embed a 3rd-party JApplet in a Swing GUI & pass it parameters

笑着哭i 提交于 2019-12-17 06:51:27
问题 There's a third-party applet that I'd like to embed in my Swing application. Basically, I'd like it to be just another panel. This applet makes use of many parameters, e.g. final String config_filename = getParameter(XXX); I've seen lots of documentation about how to send parameters values via HTML, but how do you do it via code (or perhaps property files)? Any help would be appreciated! 回答1: Implement an AppletStub & set it as the stub of the applet instance. E.G. /* <applet code=

web 如何实现精准打印

无人久伴 提交于 2019-12-17 06:09:10
在 WEB 系统中,打印是必不可少的一个功能,但也是一个比较棘手的问题。如果完全自己开发,由于涉及浏览器的局限性、js 兼容性、稳定性等因素,往往耗时长、工作量大,最终严重影响项目周期。特别地,在 WEB 环境下,套打需求的实现时难度更大,此时需要将浏览器中呈现的 HTML 精确地打印到票据中,实现对分页位置的控制。 常用的 WEB 打印实现方式有哪些呢? 1、 利用浏览器自带的打印控件来实现 web 打印 实现方法:直接调用 IE 的打印功能或者在程序中调用 window.print() 来实现 web 打印 优势:不需要对浏览器作任何扩充 缺点: 1) 不能精确分页。 浏览器一般是根据用户设置的页面大小、web 页面的内容多少来自行决定分页位置,程序员很难控制,因为会有页脚页眉干扰。 2) 不能准确对齐边边距及打印文字。 3)不能解决连续打印 2、 使用 pdf 文件 实现原理:从服务器端下载一个 pdf 文件流,在 IE 中用 adobe 插件打开,然后用 adobe 的打印菜单进行打印 优点:可以实现精确套打 缺点:需要下载 adobe 插件 3、 采用 Applet 方式 优点:可以实现分页和精准打印 缺点:1)安装 Applet 成本巨大,一般需要下载十几 M 的文件。 2)打印报表时,需要重新向服务器检索数据,效率低。 上面的三种实现方法虽然可以解决部分 web

Java unsupported major minor version 52.0 [duplicate]

人盡茶涼 提交于 2019-12-17 04:58:50
问题 This question already has answers here : How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version (48 answers) Closed 5 years ago . I can not launch my java application as a web applet in HTML (I am using HTML 4.01, I know it doesn't work in html5). The error message it returns is: java : Unsupported major.minor version 52.0 I have tried downgrading my java JRE/JDK/SDK but I still get the same error message. The current version of java I am now using is 1.8.0_05. 回答1

Java ball object doesn't bounce off of drawn rectangles like it's supposed to.

孤街醉人 提交于 2019-12-17 04:07:22
问题 Sorry for the awful title. The purpose of the Java applet is as such: A ball is bouncing around the screen. The size and speed of this ball can be changed via scrollbars. The user can press and drag the mouse on the screen to draw rectangles. The ball will bounce off of these rectangles as well. The bounds of these rectangles are stored in a vector. When a rectangle is clicked, it (and all other rectangles at that point) are removed from the vector (and the screen). The problem I'm having is

socket programming multiple client to one server

大憨熊 提交于 2019-12-17 02:34:09
问题 How do you handle multiple client to connect to one server? I have this LogServer.java import javax.net.ssl.*; import javax.net.*; import java.io.*; import java.net.*; public class LogServer { private static final int PORT_NUM = 5000; public static void main(String args[]) { ServerSocketFactory serverSocketFactory = ServerSocketFactory.getDefault(); ServerSocket serverSocket = null; try { serverSocket = serverSocketFactory.createServerSocket(PORT_NUM); } catch (IOException ignored) { System

Incompatible magic value 1008813135

泄露秘密 提交于 2019-12-17 02:24:20
问题 I am writing a Java applet and embedding it in a web page. It used to run Mac and Windows in different browsers without problem. I was using NetBeans on the Mac to build the .jar file the applet used. For some reason or another I decided to load the project on the Windows' NetBeans - I started getting the following error on the Windows machine when accessing the web page from any browser: java.lang.ClassFormatError: Incompatible magic value 1008813135 in class file Fearing that it must have

Why were applets deprecated in JDK 9?

走远了吗. 提交于 2019-12-17 02:24:18
问题 I have recently read in an article posted by Oracle that they are going to mark the Applet class as deprecated in JDK 9. I have little experience with applets; I have only written some to understand the basics. Why are they unpopular, and what is the main reason for their deprecation? 回答1: Applets were very popular a couple of years ago, but now the browser world changed and security is becoming a major focus for all major browser vendors. The Java team gave its complete set or reasons,