applet

Java经典试题(一)

大城市里の小女人 提交于 2020-01-26 11:10:27
单选题 1:对成员的访问控制保护最强的是( )。( 2 分) A:public B:缺省 C:private D:protected 答案:C 2:对于临界区代码,必须使用( )关键字来限定。( 2 分) A:private B:protected C:synchronized D:critical 答案:C 3:Thread的方法resume()负责恢复哪些线程的执行?( 2 分) A:通过调用stop()方法而停止的线程。 B:通过调用sleep()方法而停止运行的线程。 C:通过调用wait()方法而停止运行的线程。 D:通过调用suspend()方法而停止运行的线程。 答案:D 4:关于for循环和while循环的说法哪个正确( )。( 2 分) A:while循环能实现的操作,for循环也能实现的 B:while循环判断条件一般是程序结果,for循环判断条件一般是非程序结果 C:两种循环任何时候都可替换,而且循环体、至少被执行一次 D:两种循环结构中都必须有循环体,循环体不能为空 答案:A 5:对成员的访问控制保护最强的是( )。( 2 分) A:public B:缺省 C:private D:protected 答案:C 6:Applet执行( )方法后,进入消亡态。( 2 分) A:start() B:init() C:stop() D:destroy() 答案:D

java的优点和误解 《java核心技术卷i》第一章

ⅰ亾dé卋堺 提交于 2020-01-26 00:22:54
《java核心技术卷i》第一章主要内容包括三点: 1: Java白皮书的关键术语:描述Java的十一个关键字: 2:Java applet 3 :关于Java的常见误解 1:第一章:Java白皮书的关键术语:描述Java的十一个关键字: 简单性,面向对象,分布式,健壮性,安全性,体系结构中立,可移植性,解释型,多线程,高性能,动态性 部分介绍如下: 简单性:Java语法相当于C++,为一个“纯净版本”, Java去掉了C++中的头文件,指针运算(指针语法),结构,联合,操作符重载,虚基类等。 总体来说,去掉这些相对复杂的语法是利大于弊的。 面向对象:Java是一门纯面向对象的语言,面向对象的重点在数据(对象)及对象接口上。 在Java中,“万物皆对象”,即所有的数据都是一个对象,包括数字,字母等,所有类的基类都直接或间接继承与Object,Java 没有C++中的多继承,但可通过接口来实现多继承的需求(Java中一个类只能继承一个class,但可以实现多个接口) 健壮性:Java对代码进行早期安全问题检测,后期动态(运行时)检测,采用的指针模型可以消除重写内存和损坏数据的可能性 Java通过指针模型 避免了C++出现野指针等一系列指针问题. 安全性:Java实用于网络/分布式环境,能够构建防病毒,防篡改的系统,包括: 运行时堆栈溢出,破坏自己的进程空间之外的内存,未经授权读写文件

Creating a super simple table applet in java

强颜欢笑 提交于 2020-01-25 13:12:08
问题 I'm trying to create an applet which displays a simple table with no headers or other decoration. Could anyone be so kind as to show me the code for this? All the examples I've found haven't compiled or have included extra features which I don't need. A simple 2 x 2 table with empty cells and no headers is what I'm looking for. Thanks to all in advance... Code for skaffman: import java.applet.*; import java.awt.*; import java.awt.event.*; public class danTeamProject extends Applet implements

Deploying a .jar into a html page

爷,独闯天下 提交于 2020-01-25 04:31:38
问题 So I have the following code in Java which deploys an applet into a html page. Due to security problems I'm trying to make it a .jar and then sign that .jar to see first how that will work. Unfortunately I'm not really sure what I should change in order to run it as a .jar , given that the main class in the .jar is the same: p.println(document+"<applet name=\"myApp\" codebase="+codebase+" code="+code+ " width='+(scnWid-30)+' height='+(scnHei-45)+'>');"); p.println(document+"<param name=user

Java applet behind proxy experiences temporary freezes when instantiating new classes

故事扮演 提交于 2020-01-24 10:07:34
问题 Introduction We have some problems with our Java applet at our customer's office. The applet is intended for recording the screen by taking screenshots at regular intervals. It's signed and it should run with elevated privileges. The problems we encounter are: The Java applet may sometimes not start at all. If the Java console shows up, it may disappear soon. It feels as if the whole JVM just crashes. If the Java applet starts, it sometimes crashes something like 10 seconds after startup. If

Java applet behind proxy experiences temporary freezes when instantiating new classes

时光毁灭记忆、已成空白 提交于 2020-01-24 10:07:20
问题 Introduction We have some problems with our Java applet at our customer's office. The applet is intended for recording the screen by taking screenshots at regular intervals. It's signed and it should run with elevated privileges. The problems we encounter are: The Java applet may sometimes not start at all. If the Java console shows up, it may disappear soon. It feels as if the whole JVM just crashes. If the Java applet starts, it sometimes crashes something like 10 seconds after startup. If

What is the alternatives for Java Applet to launch client programs using Chrome browsers?

点点圈 提交于 2020-01-23 06:47:06
问题 I am working in a web application using ASP.net and C#. My target is to check on a desktop application on the client machine .. If it was exist then I should launch it. Else if it wasn't exist, we should download, install and then launch it. I could develop this module using Java Applet but unfortunately, Google decided to disable NPAPI in September 2015, So the applet will not working on Chrome. My question is about the Applet alternatives to help me implementing the above scenario ? 回答1:

How to use ImageObserver in Graphics method drawImage()

夙愿已清 提交于 2020-01-23 05:42:17
问题 The method I am trying to use is the: drawImage(image, int, int, int, int, ImageObserver) method so that i can scale my image, on all the examples i've seen the ImageObserver should be this, but this doesn't seem to work(i.e. the only methods i have seen is: drawImage(image, int, int, ImageObserver), don't know if this makes a difference). Here is my main class that is the applet: import java.applet.*; import java.awt.*; public class Main extends Applet implements Runnable{ private Thread th;

Missing slash on Java 9’s LogManager.getLogger() / Logger.getHandlers() seems to cause an exception

放肆的年华 提交于 2020-01-23 03:20:08
问题 I am seeing a problem with an Applet on Windows, running Java 9, when I am trying to create a log file C:\Users\cardal\ApplicationLog.html. The code works fine on Java 8. The code does LogManager.readConfiguration () and LogManager.getLogger(). Then Logger.getHandlers() hits an exception. It looks like the first slash is getting removed by mistake: Can't load log handler "java.util.logging.FileHandler" java.nio.file.NoSuchFileException: C:Users\cardal\ApplicationLog.html.lck java.nio.file

Missing slash on Java 9’s LogManager.getLogger() / Logger.getHandlers() seems to cause an exception

纵然是瞬间 提交于 2020-01-23 03:20:07
问题 I am seeing a problem with an Applet on Windows, running Java 9, when I am trying to create a log file C:\Users\cardal\ApplicationLog.html. The code works fine on Java 8. The code does LogManager.readConfiguration () and LogManager.getLogger(). Then Logger.getHandlers() hits an exception. It looks like the first slash is getting removed by mistake: Can't load log handler "java.util.logging.FileHandler" java.nio.file.NoSuchFileException: C:Users\cardal\ApplicationLog.html.lck java.nio.file