A Question of JTextField in applet(using plug-in 1.4)
With java plug-in 1.4, when we add a JTextField in an applet, and use some Chinese input method to input some text, a "input window" will pop out to preview the word what you inputed. But after you refresh the page and input again, that "input window" dispearred, and we can find this exception in console:
java.lang.NullPointerException
at sun.awt.im.CompositionArea.setText(CompositionArea.java:163)
at sun.awt.im.CompositionAreaHandler.inputMethodTextChanged(CompositionAreaHandler.java:183)
at sun.awt.im.CompositionAreaHandler.processInputMethodEvent(CompositionAreaHandler.java:144)
at sun.awt.im.InputMethodContext.dispatchEvent(InputMethodContext.java:175)
at java.awt.Component.dispatchEventImpl(Component.java:3476)
at java.awt.Container.dispatchEventImpl(Container.java:1437)
at java.awt.Component.dispatchEvent(Component.java:3367)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:445)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)
How to solve this problem? or can I shut off the "input window" when use Chinese input method?
As this class extends ArrayList the size() refers to the method in ArrayList. In ArrayList size() returns the size of the ArrayList funnily enough. See the API for ArrayList for more info.
BTW I wouldn't have extended ArrayList but used an ArrayList attribute because I feel that the class TextFile fails the
TextFile "is a" ArrayList
test for inheritence.
Richard
Similar Messages
-
Writing new HTML to a page from an applet using LiveConnect, 1.3.1 Plug-i
Has anyone been able to successfully replace a page with an applet with the dynamically generated HTML from an applet using LiveConnect and Plugin 1.3.1 in Netscape 6.2 or IE?
The following works fine without plugin or with 1.4.0 beta3 plugin.
Here is the code that I use without plugin:
JSObject windowObject = JSObject.getWindow(this);
JSObject documentObject = (JSObject) windowObject.getMember("document");
documentObject.call("close",null);
documentObject.call("open",null);
String anArray1[] = {null};
anArray1[0] ="some HTML here";
documentObject.call("write", anArray1);
documentObject.call("close",null);
Here is the code that I use with 1.4.0 plugin:
JSObject windowObject = JSObject.getWindow(this);
JSObject documentObject = (JSObject) windowObject.getMember("document");
String anArray1[] = {null};
anArray1[0] ="some HTML here";
documentObject.call("write", anArray1);
When I try to use anyone of the above using plugin 1.3.1, the browser either hangs or plugin generates runtime error. What is the correct way of writing to a document object? Or what is the way that works for 1.3.1 plugin?Hi,
I am doing this in my applet to replace the page containing the applet with the new content. I tested that extensively with Netscape 4.7 and IE 5.5+. Definitely works if you are using Java Plug-In 1.3.1_02. Does not work well in Netscape 6.2.
protected void setPageContent(final String newContent) {
final JSObject window = JSObject.getWindow(this);
final JSObject document = (JSObject) window.getMember("document");
new Thread( new Runnable() {
public void run() {
document.call("clear", null);
document.call("write", new String[]{newContent});
try {
document.call("close", null);
} catch (JSException ignored) {
} ).start(); -
Question - applet using JMF for playing .mov
I develop an applet using JMF for playing .mov. It works fine, and the applet starts normally. Even my applet works fine from other computers in our LAN (The applet runs ok without JMF). But only on one PC it doesn't work and I get the following message
Failed to configure: com.sun.media.PlaybackEngine@a7c45e
Bad header in the media: moov atom not present
Error: Unable to realize com.sun.media.PlaybackEngine@a7c45e
FATAL ERROR: Failed to realize: failed to parse the input media.
Exception in thread "JMF thread: SendEventQueue: com.sun.media.content.unknown.Handler" java.lang.Error: Failed to realize: failed to parse the input media.
at PlayerApplet.Fatal(PlayerApplet.java:201)
at PlayerApplet.controllerUpdate(PlayerApplet.java:191)
at com.sun.media.BasicController.dispatchEvent(BasicController.java:1254)
at com.sun.media.SendEventQueue.processEvent(BasicController.java:1286)
at com.sun.media.util.ThreadedEventQueue.dispatchEvents(ThreadedEventQueue.java:65)
at com.sun.media.util.ThreadedEventQueue.run(ThreadedEventQueue.java:92)
My html:
<html>
<head><title>PlayerApplet</title></head>
<body>
<applet code="PlayerApplet.class" archive="fobs4jmf.jar, customizer.jar, jmf.jar, mp3plugin.jar, sound.jar, multiplayer.jar, mediaplayer.jar" width=640 height=510>
<param name=file value="safexmas.mov">
</applet>
</body>
</html>
Anyone can help me?
Thanks for your timeIt started to work but I had to install fobs4jmf on the client computer.
And put .dll to windows/system33 directory. But how can I play video using applet in browser without installing any software on the client machine? -
Problem Launching Java Applet with Plug-in: Version 1.4.2_01
Hello out there:
I recently installed j2re-1.4.2_01 on my home computer but have been unable to access Web sites emmploying JAva applets. The following is an email exchange with Jeff Hall of Lowell Observatory, manager of an educational site hosted by Lowell, trying to resolve my problem. The messages are better understood if read in reverse order.
I'm hoping that someone will recognize the source of my problem and can recommmend a solution. I would appreciate any help offered.
Thanks,
Mike Coucke
Hi Jeff:
Well, I guess the problem lies with me somewhere. Here's my answer/status to your questions/suggestions:
1) I'm using MS Windows Me version 4.90.3000
2) I do have the directory C:\Windows\.jpi_cache\jar\, but the only thing in it is an empty folder labeled "1.0". The file LP.jar does not exist anywhere on my hard drive.
3) I tried several game sites that utilized Java applets and got the same results: the Java cup in the upper left corner followed a few seconds later by the red "X". So, evidently the problem is somewhere on my end.
I'm going to post our email exchanges in a Java Users Forum managed by Sun to see if anyone out there can solve my problem. However, if you have any more suggestions, I'll be glad to try them.
Thanks for the help.
Mike Coucke
[email protected]
----- Original Message -----
From: "Jeffrey Hall" <[email protected]>
To: "'Mike Coucke'" <[email protected]>
Sent: Friday, September 05, 2003 1:02 PM
Subject: RE: Registration with Lowell Education Online
Mike,
Rats! What version of Windows are you using? It's a little strange to
see the user directory set to C:\Windows; if you're using XP, I'd expect
it to be something like C:\Documents and Settings\Mike Coucke. In any
event, the output that is of concern is these two lines:
java.lang.ClassNotFoundException: LPRemote.class
Caused by: java.net.UnknownHostException: proxy
It looks like your browser is not finding our server's IP when it comes
time to download the necessary Java code.
LPRemote.class is the fundamental code that runs LOPARC, and your
browser should be downloading it automatically when you click connect.
LPRemote.class is stored along with a bunch of other classes in a file
called "LP.jar" that you download from our server. So, if you go to C:
in Windows Explorer and do a file search for LP.jar, you should find it.
On my machine, it's stored in a directory called ".jpi_cache\jar\" in my
user home directory. Let me know if you have this file, or the
jpi-cache directory.
One other thing you might try is going to a different site that you know
uses Java applets -- I think some of the online game rooms at Yahoo use
Java. See if other sites that use Java load correctly. Then we'll know
if it's our server specifically, or a more general problem on your end.
Jeff Hall
Lowell Observatory
Hello Jeff:
I still have the Java "blues". I followed your instructions, but am still unable to launch a LOPARC session. After an initial failure, I uninstalled all three Java versions I had (1.4.0, 1.4.1, 1.4.2), then reinstalled 1.4.2_01 from the Sun website.
Now, when I try to launch LOPARC, I initially get a blank window with the Java cup in the upper left corner. After about 20 seconds, the cup changes to a red "X". During those 20 seconds, the following appear in the IE message bar at the bottom of the window: "Applet LPRemote notinited" (their spelling) which changes to "Loading Java Applet Failed..." when the red "X" appears.
Following is a copy of the log from my Java Console during all of this:
Java(TM) Plug-in: Version 1.4.2_01
Using JRE version 1.4.2_01 Java HotSpot(TM) Client VM
User home directory = C:\WINDOWS
Proxy Configuration: Manual Configuration
Proxy: http=proxy,https=proxy,ftp=proxy,gopher=proxy
Proxy Overrides:
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
p: reload proxy configuration
q: hide console
r: reload policy configuration
s: dump system properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
load: class LPRemote.class not found.
java.lang.ClassNotFoundException: LPRemote.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.net.UnknownHostException: proxy
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.plugin.net.protocol.http.HttpClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.http.HttpClient.privilegedOpenServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.plugin.net.protocol.http.HttpClient.<init>(Unknown Source)
at sun.plugin.net.protocol.http.HttpClient.New(Unknown Source)
at sun.plugin.net.protocol.http.HttpURLConnection.createConnection(Unknown Source)
at sun.plugin.net.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.plugin.net.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 10 more
I followed this up by executing the following three console commands:
"dump system properties"
"dump classholder list"
"dump thread list"
and obtained the following listings:
Dump system properties ...
acl.read = +
acl.read.default =
acl.write = +
acl.write.default =
application.home = C:\PROGRA~1\JAVA\J2RE14~1.2_0
awt.toolkit = sun.awt.windows.WToolkit
browser = sun.plugin
browser.vendor = Sun Microsystems, Inc.
browser.version = 1.1
deployment.javaws.cache.dir = C:\WINDOWS\.javaws\cache
deployment.javaws.jre.0.enabled = true
deployment.javaws.jre.0.location = http://java.sun.com/products/autodl/j2se
deployment.javaws.jre.0.osarch = x86
deployment.javaws.jre.0.osname = Windows
deployment.javaws.jre.0.path = C:\Program Files\Java\j2re1.4.2_01\bin\javaw.exe
deployment.javaws.jre.0.platform = 1.4
deployment.javaws.jre.0.product = 1.4.2_01
deployment.javaws.jre.0.registered = true
deployment.javaws.version = javaws-1.4.2_01
deployment.system.cacerts = C:\PROGRA~1\JAVA\J2RE14~1.2_0\lib\security\cacerts
deployment.system.home = C:\WINDOWS\Sun\Java\Deployment
deployment.system.jssecacerts = C:\PROGRA~1\JAVA\J2RE14~1.2_0\lib\security\cacerts
deployment.system.profile = C:\WINDOWS
deployment.system.security.policy = file:/C:/WINDOWS/Sun/Java/Deployment/security/java.policy
deployment.user.cachedir = C:\WINDOWS\Application Data\Sun\Java\Deployment\cache
deployment.user.certs = C:\WINDOWS\Application Data\Sun\Java\Deployment\security\deployment.certs
deployment.user.extdir = C:\WINDOWS\Application Data\Sun\Java\Deployment\ext
deployment.user.home = C:\WINDOWS\Application Data\Sun\Java\Deployment
deployment.user.jssecerts = C:\WINDOWS\Application Data\Sun\Java\Deployment\security\deployment.jssecerts
deployment.user.logdir = C:\WINDOWS\Application Data\Sun\Java\Deployment\log
deployment.user.profile = C:\WINDOWS\Application Data
deployment.user.security.policy = file:/C:/WINDOWS/Application%20Data/Sun/Java/Deployment/security/java.policy
deployment.user.tmpdir = C:\WINDOWS\Application Data\Sun\Java\Deployment\cache\tmp
file.encoding = Cp1252
file.encoding.pkg = sun.io
file.separator = \
file.separator.applet = true
http.agent = Mozilla/4.0 (Windows Me 4.90)
http.auth.serializeRequests = true
https.protocols = SSLv3,SSLv2Hello
java.awt.graphicsenv = sun.awt.Win32GraphicsEnvironment
java.awt.printerjob = sun.awt.windows.WPrinterJob
java.class.path = C:\PROGRA~1\JAVA\J2RE14~1.2_0\classes
java.class.version = 48.0
java.class.version.applet = true
java.endorsed.dirs = C:\PROGRAM FILES\JAVA\J2RE1.4.2_01\lib\endorsed
java.ext.dirs = C:\PROGRAM FILES\JAVA\J2RE1.4.2_01\lib\ext
java.home = C:\PROGRA~1\JAVA\J2RE14~1.2_0
java.io.tmpdir = C:\WINDOWS\TEMP\
java.library.path = D:\PROGRAM FILES\INTERNET EXPLORER 6;.;C:\WINDOWS\SYSTEM;C:\WINDOWS;D:\PROGRA~1\INTERN~1;;C:\WINDOWS;C:\WINDOWS\COMMAND
java.protocol.handler.pkgs = sun.plugin.net.protocol|sun.plugin.net.protocol
java.runtime.name = Java(TM) 2 Runtime Environment, Standard Edition
java.runtime.version = 1.4.2_01-b06
java.specification.name = Java Platform API Specification
java.specification.vendor = Sun Microsystems Inc.
java.specification.version = 1.4
java.util.prefs.PreferencesFactory = java.util.prefs.WindowsPreferencesFactory
java.vendor = Sun Microsystems Inc.
java.vendor.applet = true
java.vendor.url = http://java.sun.com/
java.vendor.url.applet = true
java.vendor.url.bug = http://java.sun.com/cgi-bin/bugreport.cgi
java.version = 1.4.2_01
java.version.applet = true
java.vm.info = mixed mode
java.vm.name = Java HotSpot(TM) Client VM
java.vm.specification.name = Java Virtual Machine Specification
java.vm.specification.vendor = Sun Microsystems Inc.
java.vm.specification.version = 1.0
java.vm.vendor = Sun Microsystems Inc.
java.vm.version = 1.4.2_01-b06
javaplugin.maxHeapSize = 96m
javaplugin.nodotversion = 142_01
javaplugin.proxy.config.list = http=proxy,https=proxy,ftp=proxy,gopher=proxy
javaplugin.proxy.config.type = manual
javaplugin.version = 1.4.2_01
javaplugin.vm.options = -Djava.class.path=C:\PROGRA~1\JAVA\J2RE14~1.2_0\classes -Xbootclasspath/a:C:\PROGRA~1\JAVA\J2RE14~1.2_0\lib\plugin.jar -Xmx96m -Djavaplugin.maxHeapSize=96m -Xverify:remote -Djavaplugin.version=1.4.2_01 -Djavaplugin.nodotversion=142_01 -Dbrowser=sun.plugin -DtrustProxy=true -Dapplication.home=C:\PROGRA~1\JAVA\J2RE14~1.2_0 -Djava.protocol.handler.pkgs=sun.plugin.net.protocol
line.separator = \r\n
line.separator.applet = true
os.arch = x86
os.arch.applet = true
os.name = Windows Me
os.name.applet = true
os.version = 4.90
os.version.applet = true
package.restrict.access.netscape = false
package.restrict.access.sun = true
package.restrict.definition.java = true
package.restrict.definition.netscape = true
package.restrict.definition.sun = true
path.separator = ;
path.separator.applet = true
sun.arch.data.model = 32
sun.boot.class.path = C:\PROGRAM FILES\JAVA\J2RE1.4.2_01\lib\rt.jar;C:\PROGRAM FILES\JAVA\J2RE1.4.2_01\lib\i18n.jar;C:\PROGRAM FILES\JAVA\J2RE1.4.2_01\lib\sunrsasign.jar;C:\PROGRAM FILES\JAVA\J2RE1.4.2_01\lib\jsse.jar;C:\PROGRAM FILES\JAVA\J2RE1.4.2_01\lib\jce.jar;C:\PROGRAM FILES\JAVA\J2RE1.4.2_01\lib\charsets.jar;C:\PROGRAM FILES\JAVA\J2RE1.4.2_01\classes;C:\PROGRA~1\JAVA\J2RE14~1.2_0\lib\plugin.jar
sun.boot.library.path = C:\PROGRAM FILES\JAVA\J2RE1.4.2_01\bin
sun.cpu.endian = little
sun.cpu.isalist = pentium i486 i386
sun.io.unicode.encoding = UnicodeLittle
sun.java2d.fontpath =
sun.net.client.defaultConnectTimeout = 120000
sun.os.patch.level =
trustProxy = true
user.country = US
user.dir = C:\WINDOWS\Desktop
user.home = C:\WINDOWS
user.language = en
user.name = Michael G. Coucke
user.timezone =
user.variant =
Done.
Dump classloader list ...
codebase=http://kraken.lowell.edu/, key=http://kraken.lowell.edu/,IONJava/classes/ion_16.jar,IONJava/classes/LP.jar, zombie=false, cache=true, refcount=1, info=sun.plugin.ClassLoaderInfo@109de5b
Done.
Dump thread list ...
Group main,ac=11,agc=2,pri=10
main,5,alive
AWT-Windows,6,alive,dameon
AWT-Shutdown,5,alive
Java2D Disposer,10,alive,dameon
AWT-EventQueue-0,6,alive
Group Plugin Thread Group,ac=3,agc=0,pri=10
Main Console Writer,6,alive
AWT-EventQueue-1,6,alive
TimerQueue,5,alive,dameon
Group http://kraken.lowell.edu/-threadGroup,ac=2,agc=0,pri=4
thread applet-LPRemote.class,4,alive
AWT-EventQueue-2,4,alive
Done.
I'm not a Java expert, so this may be more information than you ever wanted to see.
Once again, I hope that you can help. My experience has been that I usually have some obscure option set incorrectly and that causes me great grief.
Thanks fo your help,
Mike Coucke
[email protected]
----- Original Message -----
From: "Jeffrey Hall" <[email protected]>
To: "'Mike Coucke'" <[email protected]>
Sent: Thursday, September 04, 2003 11:48 AM
Subject: RE: Registration with Lowell Education Online
Hi Mike,
Try it now. I think this problem has arisen because Sun just
released a new version of the Plug-in (1.4.2), and when we released the
public beta of LOPARC, only one relevant version (1.4.0) was available
and the LOPARC code was written to look for that by default. I have
just recoded the relevant routines so they should now cause your browser
to simply pick up the latest 1.4 version of the Plug-in you have
installed, whatever it is. I "broke" Java on my machine to replicate
your problem, and the code I inserted today did fix it. Hopefully it
will have the same effect for you. I am running IE 6 and plugin
1.4.2_01 (as accessed via Tools->Sun Java Console).
One broader problem: some (non-LOPARC-specific) users on the Sun
forums have reported the "JRE collision" you are seeing when multiple
versions of the Plug-in are installed on the same machine. So if the
fix I made to our code doesn't work, one option would be to uninstall
all Java components from your computer and do a fresh install of the
latest runtime environment.
Let me know how/if this works. Thanks for the feedback and for your
patience.
Best regards,
Jeff Hall
Lowell Observatory
-----Original Message-----
From: Mike Coucke [mailto:[email protected]]
Sent: Wednesday, September 03, 2003 6:30 PM
To: [email protected]
Subject: Re: Registration with Lowell Education Online
Hello Jeff:
So far, I have been unable to launch a LOPARC session. I repeatedly
get the following error message:
"Exception: java.lang.ClassNotFoundException: LPRemote.class"
My browser is MS Internet Explorer version 6.0.2800.1106 Initially I was
using Java Plug-In version 1.4.1 and received the error message. I went
to the Sun website and downloaded/installed Java Plug-In version 1.4.2
and still get the message.
Before I try to launch LOPARC, I can select Tools->Sun Java Console from
IE's pull down menu to check my Java Plug-In version. When I try to
launch LOPARC, I get the following message:
"Applet(s) in this HTML page requires a version of Java different from
the one the browser is currently using. In order to run the applet(s)
in this HTML page, a new browser session is required, press 'Yes' to
start a new browser session." If I select 'No', I get the following
message: "Java Plug-in detected JRE collission"
If I select 'Yes', a new browser window opens and then I get the first
message above.
Can you help?
Mike Coucke
[email protected]
----- Original Message -----
From: <[email protected]>
To: <[email protected]>
Sent: Monday, September 01, 2003 5:30 PM
Subject: Registration with Lowell Education Online
September 1, 2003
Dear Michael Coucke:
Thank you for registering with Lowell Observatory's online education
site. We hope you enjoy using it and visit regularly as we continue to
expand its features and capabilities. This is a one-time welcoming
email.
For your records, your user ID is xxxxx, and your password is #########.
You'll need to supply these each time you log in.
This site gives you access to research-grade equipment including a 16"
telescope, CCD detector, and image processing software. Our online
archive of data is now available 24/7. The telescope will be opening to
our onsite users in May, and on select nights to the Internet at large
in June.
We have designed this site so you don't need a huge monitor or a
supercomputer to use it. All pages are viewable on screens running at
800x600 resolution or higher. To use LOPARC, you'll need a Java-enabled
browser with the Java 1.4 plug-in installed. If you don't have the
plug-in, you'll be prompted to download it the first time you attempt to
connect. This is an admittedly large (9 MB) but one-time-only download.
This site works correctly under Internet Explorer version 5 or higher.
If you use Netscape, you must be running version 6 or higher, and
display or applet behavior anomalies may occur.
If at any time you can't connect to our server, simply try again later.
We do experience several power outages each year, particularly during
Flagstaff's summer thunderstorm season. Our server is fully protected
and backed up, and can be quickly brought back on line, but any active
user sessions will be lost. Thanks for your patience during these
inevitable downtimes.
Your questions, comments, suggestions, and bug reports about this site
are always welcome. On behalf of the LOPARC development team, thanks
for signing up!
Jeffrey Hall
Assistant Research Scientist
Associate Director, Education and Special Programs
Lowell Observatory
Flagstaff, ArizonaHi Mike,
I see this in your logs:
Java(TM) Plug-in: Version 1.4.2_01
Using JRE version 1.4.2_01 Java HotSpot(TM) Client VM
User home directory = C:\WINDOWS
Proxy Configuration: Manual Configuration
Proxy: http=proxy,https=proxy,ftp=proxy,gopher=proxy
Proxy Overrides:
I just helped my Dad set up his computer with a new
cable modem, and had the situation where we couldn't
access any secure Web sites. The cable folks had us
disable the proxy. It looks like the error message is
saying it can't find your proxy server, and the logs
you posted say that you've decided to configure your
proxy manually, rather than using the settings from
IE (which is how mine is set up in the plugin
control panel.)
Could that be the problem?
--Steve -
Html file to run an Applet using swings in 1.4.1 or 1.3.1
Can anyone send me an html document to launch the applet in a browser. I have very basic html, but I need one that uses the appropriate plug-in and that has parameters such as height, width, etc. My applet uses tabbed panes, dialog boxes and comboboxes. It works well with appletviewer, but does not work in IE or Netscape.
Thank you for your help
here is what I am using which does does show anything but a grey screen
<HTML>
<HEAD>
<TITLE>
CIS 602 Semister Project
</TITLE>
</HEAD>
<BODY>
<BR>
<H3>
<CENTER>
Swing
</CENTER>
</H3>
<H3>
<BR><BR>
<P><H3>
<CENTER>
<BR><BR>
<P><h2>
Structured Problem Solving Strategy
</h2>
<blockquote>
<!--"CONVERTED_APPLET"-->
<!-- CONVERTER VERSION 1.1 -->
<SCRIPT LANGUAGE="JavaScript"><!--
var info = navigator.userAgent; var ns = false;
var ie = (info.indexOf("MSIE") > 0 && info.indexOf("Win") > 0 && info.indexOf("Windows 3.1") < 0);
//--></SCRIPT>
<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!--
var ns = (navigator.appName.indexOf("Netscape") >= 0 && ((info.indexOf("Win") > 0 && info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0)));
//--></SCRIPT></COMMENT>
<SCRIPT LANGUAGE="JavaScript"><!--
if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = "570" HEIGHT = "500" codebase="http://java.sun.com/products/plugin/1.1.2/jinstall-112-win32.cab#Version=1,1,2,0"><NOEMBED><XMP>');
else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.4.2" java_CODE = "semiclient.class" WIDTH = "570" HEIGHT = "500" pluginspage="http://java.sun.com/products/plugin/1.1.2/plugin-install.html"><NOEMBED><XMP>');
//--></SCRIPT>
<APPLET CODE = "semiclient.class" WIDTH = "570" HEIGHT = "500" ></XMP>
<PARAM NAME = CODE VALUE = "semiclient.class" >
<PARAM NAME="type" VALUE="application/x-java-applet;version=1.4.2">
</APPLET>
</NOEMBED></EMBED></OBJECT>
<!--
<APPLET CODE = "semiclient.class" WIDTH = "570" HEIGHT = "500" >
</APPLET>
-->
<!--"END_CONVERTED_APPLET"-->
</Center>
<BLOCKQUOTE><PRE>
</PRE></BLOCKQUOTE>
</H3>
<BLOCKQUOTE><PRE>
</PRE></BLOCKQUOTE>
</H3>
</BODY></HTML>Try this:
<HTML>
<HEAD>
<TITLE>CIS 602 Semister Project</TITLE>
</HEAD>
<BODY>
<CENTER><H3>Swing</H3></CENTER><CENTER><H2>Structured Problem Solving Strategy</H2></CENTER>
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
width="750"
height="575"
align="baseline"
codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_4_0-win.cab">
<PARAM NAME="code" VALUE="full.qualified.ClassName">
<PARAM NAME="codebase" VALUE="path/to/your/class/files/or/archive/">
<PARAM NAME="archive" VALUE="nameOfJarWhichContainsClassFiles.jar">
<PARAM NAME="type" VALUE="application/x-java-applet;version=1.4">
<PARAM NAME="scriptable" VALUE="false">
<COMMENT>
<EMBED type="application/x-java-applet;version=1.4"
width="750"
height="575"
align="baseline"
code="full.qualified.ClassName"
codebase="path/to/your/class/files/or/archive/"
archive="nameOfJarWhichContainsClassFiles.jar"
pluginspage="http://java.sun.com/products/plugin/1.4/plugin-install.html">
<NOEMBED>
No Java 2 SDK, Standard Edition v 1.4 support for APPLET!!
</noembed>
</embed>
</COMMENT>
</OBJECT>
</BODY>
</HTML> -
Please give me an exemple of an applet using a swing object.
Please give me an exemple of an applet using a swing object.thank you.
My problen is that the swing object do not appear in
my applet. They appear only if i invoque the repaint
methode.use JApplet, since awt components are heavyweight, and swing components are lightwieght, then your swing components get over painted with aplets background or something.
anyhow, in your applet you may create JFrame, that would be swing component and if you set it visible, then it will be even visible.
they say that mixing swing and awt is not good idea, especially when you don't know what you're doing (which might be true in your case)
so try to migrate your app from AWT based stuff to SWING based stuff, or write your own AWT components that do the job whih you needed swing component for at the first place.
but if you need to mix awt and swing, then i thing that you should not paint the fole area of applet in applets paint method -- but here i'm not sure, never mixed 'em.
so you might try to create an applet which paint() method you leave empty and to which you add some JComponent*.
and see what happens, maybe this JComponent will be visible.
* -- JComponent is most likely just gray, you might want to add some subclass of it -- JButton, JTextField, JSomethingElse. -
Can you please tell me how can i change the parameter of Applet using Aspec
Respect Members
Can we apply Aspectwerkz on Applet? In our project we have to
change the method parameters before its execution(Around Advice) , can we do this in applet using Aspectwerkz?
Can you please tell me how can i change the parameter of Applet using Aspectwerkz or AspectJ ?
I did it by for Java Application using the AspectJ And Aspectwerkz But not able to do for Applet.
For Applet I Am setting the parameter in JAVA plug in for Aspectwerkz e.g. -Xdebug -Xrunaspectwerkz -Xbootclasspath & path for xml file in which pointcut is defined.
If you any Friend working on it or any author who might be helpfull for me please Forward this mail to him/her
THANKs in Advance
[email protected]hello rodale, what you're seeing is probably a side effect of firefox not being able to save certain preferences into its profile folder.
go to ''firefox > help > troubleshooting information'', click on ''profile folder/show folder'' and close all firefox windows afterwards. a windows explorer window should open up - in there delete the file named '''user.js'''.
in case this didn't solve the issue yet please also refer to [[How to fix preferences that won't save]]. -
Memory leak with 1.6.0_07 in applet using Swing
Java Plug-in 1.6.0_07
Using JRE version 1.6.0_07 Java HotSpot(TM) Client VM
Windows XP - SP2
I have a commercial application that has developed a memory leak with the introduction of the latest plugin. The applets chew up memory and eventually freeze. They did not before. Using jvisualm I see a build up of native arrays, primarily int[][] and char[]. I'm still investigating. Anyone have a similar experience?
The Applet uses a swing interface, uses buffered images and swing timers, and regularly performs http connections to the server which result in actions via the SwingUtil.invokeLater() method.I am Using Internet Explorer Browser Version 6.0.Huge security hole.
Its not throwing Error / Exception Wrap a try/catch at the highest level possible.
Catch 'Throwable'. And log/display it somewhere. -
I have an 27 inch apple iMac 2010. Can I upgrade by buying a Mac book pro and use plug in and use the iMac as a screen only?
Yes your 2010 supports Target Display Mode using MiniDisplay Port input.
check out FAQ #4 > Target Display Mode: Frequently Asked Questions (FAQ) -
Newbie question - Drawing objects in applet
Hi,
I'm pretty new to java, and I have a small problem involving drawing a rectangle on a java applet.Firstly this is not a plea for someone to help me with this peice of work, I just need pointing in the right direction.
Ok the problem.
I am creating a program that ask the user to input a height value, the program will then do a calculation and create a golden ratio width. The type of both the height and the width are double.
This is where the problem starts. The next thing I need to do is make the program draw the rectangle using the user inputted height and the calculated width.
I have a feeling that the problem has occured because I haven't converted the type double into a int type.
Here is my code
import java.awt.*;
import javax.swing.*;
import java.applet.Applet;
import java.awt.Graphics;
* Class Test - write a description of the class here
* @author (your name)
* @version (a version number)
public class Test extends JApplet
// instance variables - replace the example below with your own
double sum, number1;
int height;
int width;
* Called by the browser or applet viewer to inform this JApplet that it
* has been loaded into the system. It is always called before the first
* time that the start method is called.
public void init()
String firstNumber;
double sum1;
firstNumber = JOptionPane.showInputDialog("Please enter the height" );
number1 = Double.parseDouble( firstNumber );
sum1 = (Math.sqrt(5) + 1) / 2;
sum = number1 * sum1;
int height = (int)number1;
int width = (int)sum;
// this is a workaround for a security conflict with some browsers
// including some versions of Netscape & Internet Explorer which do
// not allow access to the AWT system event queue which JApplets do
// on startup to check access. May not be necessary with your browser.
JRootPane rootPane = this.getRootPane();
rootPane.putClientProperty("defeatSystemEventQueueCheck", Boolean.TRUE);
// provide any initialisation necessary for your JApplet
* Called by the browser or applet viewer to inform this JApplet that it
* should start its execution. It is called after the init method and
* each time the JApplet is revisited in a Web page.
public void start()
// provide any code requred to run each time
// web page is visited
* Called by the browser or applet viewer to inform this JApplet that
* it should stop its execution. It is called when the Web page that
* contains this JApplet has been replaced by another page, and also
* just before the JApplet is to be destroyed.
public void stop()
// provide any code that needs to be run when page
// is replaced by another page or before JApplet is destroyed
* Paint method for applet.
* @param g the Graphics object for this applet
public void paint(Graphics g)
// simple text displayed on applet
g.drawRect( 15, 10, 270, 20 );
g.drawString("The sum is " + number1, 25, 25 );
g.drawRect( 100, 100, height, width);
* Called by the browser or applet viewer to inform this JApplet that it
* is being reclaimed and that it should destroy any resources that it
* has allocated. The stop method will always be called before destroy.
public void destroy()
// provide code to be run when JApplet is about to be destroyed.
* Returns information about this applet.
* An applet should override this method to return a String containing
* information about the author, version, and copyright of the JApplet.
* @return a String representation of information about this JApplet
public String getAppletInfo()
// provide information about the applet
return "Title: \nAuthor: \nA simple applet example description. ";
* Returns parameter information about this JApplet.
* Returns information about the parameters than are understood by this JApplet.
* An applet should override this method to return an array of Strings
* describing these parameters.
* Each element of the array should be a set of three Strings containing
* the name, the type, and a description.
* @return a String[] representation of parameter information about this JApplet
public String[][] getParameterInfo()
// provide parameter information about the applet
String paramInfo[][] = {
{"firstParameter", "1-10", "description of first parameter"},
{"status", "boolean", "description of second parameter"},
{"images", "url", "description of third parameter"}
return paramInfo;
}Thanks for any suggestions.Hey ProjectMoon, I had to re-register because it wouldn't let me log back in for some reason.Anyway thanks for the information, i'm trying to get my head around what you said, also I tried printing the height in the drawstring,and as you predicted I got a value of 0. I just wanted to know wjat you mean by:
"You want to store your height and width in the instance variables you have declared."
Because I thought I had declared them at the top of the page
public class Test extends JApplet
// instance variables - replace the example below with your own
double sum, number1;
int height;
int width;One further question, is the method I used to convert double to int correct?
int height = (int)number1;
int width = (int)sum;Thanks again for the time you have spend answering the questions. -
Applet using NetBeans 3.6
I have just started using NetBeans 3.6, and I'm new to applets. I have a sample applet which runs OK with all browsers when I use the .class file already supplied by the creator of the applet.
However, after compiling within NetBeans 3.6 (J2SE 1.4), it runs only when using the AppletViewer within the NetBeans. It does not execute when I shift the browser to Internet Explorer within NetBeans, or when I try to do it through a HTML file outside NetBeans.
I noticed that this behaviour starts after creating the .class file with NetBeans. If I create the .class file using the javac compiler in a Solaris computer I have access to, it executes both in the Solaris machine (Netscape browser) and in a PC.
Does anybody have an idea of what is going on? Thanks.In the package (folder) which the applet Java exists there is an HTML of the same name. This is used by the AppletViewer to define parameters and settings for the applet when it's loaded. Try viewing the applet using that HTML page.
Right mouse click on your applet Java file and make sure your properties in NetBeans for the debug is set to Applet Debugging. By defailt NetBeans will assume a Java file is not an applet and will try to debug it as a java application.
However, after compiling within NetBeans 3.6 (J2SE
1.4), it runs only when using the AppletViewer within
the NetBeans. It does not execute when I shift the
browser to Internet Explorer within NetBeans, or when
I try to do it through a HTML file outside NetBeans.You can enable the displaying of the Java console for the Explorer Java plug-in. This will allow you to see any exceptions happening which might be causing your problem. If no exceptions are happening, then it's likely the class path in the packages don't match where your running it from.
I noticed that this behaviour starts after creating
the .class file with NetBeans. If I create the .class
file using the javac compiler in a Solaris computer I
have access to, it executes both in the Solaris
machine (Netscape browser) and in a PC.Try building a JAR file, and running your applet from the jar in Explorer. Running from classes can cause problems if the folders they exist in don't map out the same as the packages. -
Using plug-in automation in Piano rol ?
Hi can I use plug-in automation in the piano rol window?
I want to automate the pitch of a saxophone and the pianorol is the easiest way to do precise automation. Now I have to open both arrange -window and piano rol window to do the automation in arrange window and look at the exact position of the notes in the piano rol window . Which is a bit of weird way of doing it.Caramby - you're confused here between Automation (which is nothing to do with MIDI or region-based events), and MIDI controller editing, which is nothing to do with Automation and is tied to the region.
You cannot edit Automation in the piano roll, but you certainly can edit MIDI controller data by enabling the hyperlane on the controller you want.
Remember, Track Based Automation is not Region Based MIDI Controler Data - two completely different things and different concepts in Logic.
You can use some of the editors to edit automation, rather than the main arrange automation edit lanes - you can open up the Automation Event List for one. And you can also convert Automation to MIDI controller events and back again, if you really want to edit stuff as regular MIDI controllers.
You can also do some more clever stuff like use the environment to map MIDI controllers into plugin parameter events, but that's really advanced stuff and uber-geeky.
But the answer to your question is no, you can't directly edit Automation in the piano roll. -
My wife and I have a family account at Verizon and are thinking of both getting the IPhone 4S. My question is can we both use all of the features of Icloud with one account at Verizon or do we need to have separate accounts?
If Mail in Mavericks is the same as earlier versions you can select accounts in the sidebar, so that you can either display the inboxes for individual accounts, or the contents of all the account inboxes. (If the accounts don't show click the disclosure triangle next to 'INBOX'). The layout may have changed since the version I have - Snow Leopard - but you should be able to do the same thing.
-
My form has a list of yes or no questions. I want to use either cheboxes or radio buttons. Unfortunatly I can't make it work. When I check yes for one question, it marks all yes answers for all other questions. If I mark some radio buttons to answer, it unmarks later. Need immediate help!!!
Is it that you are using a PDF-based form? Did you copy and paste the Yes/No fields all the way down your form? If so, then all of the yes/no boxes are copies of each other and have the same name and properties in the PDF.
For example, if you had:
Question 1 and Question 1 Yes/No checkboxes
Question 2 and Question 1 Yes/No checkboxes
Question 3 and Question 1 Yes/No checkboxes
Question 4 and Question 1 Yes/No checkboxes
Then whatever answer you selected in Question 1 would populate down through the rest of the form.
Changing the Yes/No field properties in questions two through four would eliminate the problem.
I hope that helps,
Brian -
Problem in loading an applet using JRE 1.5
Hi,
I have an applet which is working fine under JRE 1.4, but the same applet failing to load by using JRE 1.5
Problem Description:
1. The images in the applet fails to load using JRE 1.5
2. The Username and Password text box are also failing to initialize.
Can anyone help me out in this.
Is there any code changes required ?I wonder if you have the same problem as me... Maybe we can find a solution for us both, no need for me to open a new thread for this topic then...
I wrote an applet using Swing and compiled it using JavaSDK 1.4.x. I also installed the 1.4.x JRE for both of my test browsers. In Mozilla 1.1 the applet displays properly all the time. In IE6 SP1 it sometimes works as intended but sometimes the applet simply stops working, as per my Java Console somewhere after invoking the "start" method. Parts of the applet simply become gray and when I resize it - I have a JFrame in my applet - the whole JFrame becomes gray and does not respond to input nor it redraws itself. Shutting down IE does not close the JFrame(although the java console reports normal program termination and cleanup) and the only way to close it is through the task manager. I am using Windows 98SE btw.
Does it sound similiar to your problem? It happens ONLY with IE, not with Mozilla. Anybody has an idea on what it could be? I doubt there's an error in my code...
Maybe you are looking for
-
SAP Cookies does not have secure attribute
Cookies remain without Secure Attribute after changing ticket_only_by_https = 1, SystemCookiesHTTPSProtection=true, and ume.logon.security.enforce_secure_cookie=True. 1.)ABAP: sap-appcontext cookies 2.)Portal: com.sap.engine.security.authentication.o
-
Error in transaction code S_ALR_87013611
Hi All while running the transaction code S_ALR_87013611 For - Cost Centers: Actual/Plan/Variance Its not running and flashing a ERROR Message - Library 1VK does not exist. Please Help
-
Forward PO as pdf attachment from Services for Object to external emails.
Hi, I am trying to forward PO to external email address from PO services for objects. I could not send as pdf document to external email address. SAP users are receving as SAP object in inbox. I can achieve this trough Message Determination for v
-
Please help mee!! my iphone 4 FREEZE..!!
Please help mee!! my iphone 4 is freeze on apple logo..i holded the home button and the lock button , and it turns off,but when i try to start it again, it freeze again..please help me.
-
Slideshow settings not 'sticking'
Hi All, Have a lot trouble with newly downloaded iPhoto 9.1.1. Specifically, when working with slideshow, settings for individual photos are not being saved. For example: I select specific 'Ken Burns' settings-zoom settings for instance-for an indivi