On to my sad tale:
I am finding it impossible to run even the simplest of apps
with the JDK1.1_Final. Upon executing the demo code recommended
inthe README file, the error message appears like this:
% bin/appletviewer demo/GraphLayout/example1.html
java.lang.NullPointerException
at sun.awt.motif.MFramePeer.<init>(MFramePeer.java:59)
at sun.awt.motif.MToolkit.createFrame(MToolkit.java:153)
at java.awt.Frame.addNotify(Frame.java)
at java.awt.Window.pack(Window.java)
at sun.applet.AppletViewer.<init>(AppletViewer.java:192)
at
sun.applet.StdAppletViewerFactory.createAppletViewer(AppletViewer.java:88)
at sun.applet.AppletViewer.parse(AppletViewer.java:887)
at sun.applet.AppletViewer.parse(AppletViewer.java:858)
at sun.applet.AppletViewer.main(AppletViewer.java:1030)
I've checked my CLASSPATH variables, etc.. I get the same message when
I attempt to instantiate a simple extension-of-Frame class. The show()
(or setVisible, that is) triggers an addNotify() which then crashes at the
same point in MFramePeer.java.
I've been to http://java.sun.com/JDK/1.1/knownbugs/, and my two questions
are:
1) Is my problem the same one described in item 4033523 of the known bugs?
and
2a) If so, is there a workaround?
or
2b) If not, am I doing something wrong? It's *their* demo code, so
even if my simple Frame extension class were wrong, what's up with
my demo viewing attempt?
Email me personally if this is something I alone need to rectify.
Thanks in advance,
Aaron
--
__ Aaron Krebs __ terminal Nebraska fan _______ hus...@laser.net __
"Lighten up, Francis."
-
Randomquote9: "Whoa whoa, a fat sarcastic Star Trek fan. You must
be a devil with the ladies."
-dave
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
David A. Thurman da...@chmsr.gatech.edu
Research Engineer, PhD Candidate Phone: (404) 894-2318
Center for Human-Machine Systems Research FAX: (404) 894-2301
Georgia Institute of Technology www.isye.gatech.edu/~dave
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> java.lang.NullPointerException
> at sun.awt.motif.MFramePeer.<init>(MFramePeer.java:59)
> at sun.awt.motif.MToolkit.createFrame(MToolkit.java:153)
> at java.awt.Frame.addNotify(Frame.java)
Here are the answers to your questions:
> 1) Is my problem the same one described in item 4033523 of the known
> bugs?
Yes.
> 2a) If so, is there a workaround?
Yes. There are in fact two workarounds. The simple one is to
remove the file $JAVA_HOME/lib/font.properties. This will however
prevent the use of multifonts, so if you need to use these (in
a Japanese or Chinese environment, for example), then you need to
customize the font.properties file to include fonts which you know
are available on your system.
The reason that this problem happens is that the code for choosing
a default font was not as tolerant of fonts not being available as
the non-multifont code had been.
This has already been fixed for the next release.
Hope this helps,
Georges Saab
AWT Team, JavaSoft
//% bin/appletviewer demo/GraphLayout/example1.html
//java.lang.NullPointerException
// at sun.awt.motif.MFramePeer.<init>(MFramePeer.java:59)
// at sun.awt.motif.MToolkit.createFrame(MToolkit.java:153)
// at java.awt.Frame.addNotify(Frame.java)
// at java.awt.Window.pack(Window.java)
// at sun.applet.AppletViewer.<init>(AppletViewer.java:192)
//
//Email me personally if this is something I alone need to rectify.
No, please post. This is happening to me as well -- on Solaris 2.4 -- and I
don't get it.
Code:
public class myFrame
{
public static void main (String args[])
{
java.awt.Frame f = new java.awt.Frame("xxx");
f.setLayout(new java.awt.GridLayout(1,2));
f.add(new java.awt.Button("Button 1"));
f.add(new java.awt.Button("Button 2"));
f.resize(20,20);
f.validate();
f.show();
}
}
Results:
java.lang.NullPointerException
at sun.awt.motif.MFramePeer.<init>(MFramePeer.java:59)
at sun.awt.motif.MToolkit.createFrame(MToolkit.java:153)
at java.awt.Frame.addNotify(Frame.java)
at java.awt.Window.show(Window.java)
at myFrame.main(myFrame.java:11)
Btw, text-only java programs are working fine. (Yes, I know, who would want
to write a text-only Java app? To test, of course!)
-Steve :)
Steve Morgan s...@lurch.corp.harris.com
-------------- This .signature contains no humor whatsoever. --------------
-dave
--
___________________________________________________
Jay Lieske Jr. <lie...@princeton.edu>
Science and Engineering Specialist (609)258-6050
Computer and Information Technology fax 258-3943
Princeton University, Princeton, NJ 08544
# @(#)font.properties 1.3 97/01/16
#
# Copyright (c) 1994-1996 by Sun Microsystems Inc
#
# AWT Font default Properties for Solaris
# Modified by Jay Lieske Jr., Princeton University, 97.02.28
#
# Serif font definition
#
serif.plain.0=-*-times-medium-r-normal-*-*-%d-*-*-*-*-iso8859-1
serif.1=-*-itc zapfdingbats-medium-r-normal--*-%d-*-*-*-*-*-fontspecific
serif.2=-*-symbol-medium-r-normal-*-*-%d-*-*-*-*-*-fontspecific
serif.italic.0=-*-times-medium-i-normal-*-*-%d-*-*-*-*-iso8859-1
serif.bold.0=-*-times-bold-r-normal-*-*-%d-*-*-*-*-iso8859-1
serif.bolditalic.0=-*-times-bold-i-normal-*-*-%d-*-*-*-*-iso8859-1
# SansSerif font definition
#
sansserif.plain.0=-*-helvetica-medium-r-normal-*-*-%d-*-*-*-*-iso8859-1
sansserif.1=-*-itc
zapfdingbats-medium-r-normal--*-%d-*-*-*-*-*-fontspecific
sansserif.2=-*-symbol-medium-r-normal-*-*-%d-*-*-*-*-*-fontspecific
sansserif.italic.0=-*-helvetica-medium-o-normal--*-%d-*-*-*-*-iso8859-1
sansserif.bold.0=-*-helvetica-bold-r-normal-*-*-%d-*-*-*-*-iso8859-1
sansserif.bolditalic.0=-*-helvetica-bold-o-normal-*-*-%d-*-*-*-*-iso8859-1
# Monospaced font definition
#
monospaced.plain.0=-*-courier-medium-r-normal-*-*-%d-*-*-*-*-iso8859-1
monospaced.1=-*-itc
zapfdingbats-medium-r-normal--*-%d-*-*-*-*-*-fontspecific
monospaced.2=-*-symbol-medium-r-normal-*-*-%d-*-*-*-*-*-fontspecific
monospaced.italic.0=-*-courier-medium-o-normal-*-*-%d-*-*-*-*-iso8859-1
monospaced.bold.0=-*-courier-bold-r-normal-*-*-%d-*-*-*-*-iso8859-1
monospaced.bolditalic.0=-*-courier-bold-o-normal-*-*-%d-*-*-*-*-iso8859-1
# Dialog font definition
#
dialog.plain.0=-*-helvetica-medium-r-normal-*-*-%d-*-*-*-*-iso8859-1
dialog.1=-*-itc
zapfdingbats-medium-r-normal--*-%d-*-*-*-*-*-fontspecific
dialog.2=-*-symbol-medium-r-normal--*-%d-*-*-*-*-*-fontspecific
dialog.italic.0=-*-helvetica-medium-o-normal-*-*-%d-*-*-*-*-iso8859-1
dialog.bold.0=-*-helvetica-bold-r-normal-*-*-%d-*-*-*-*-iso8859-1
dialog.bolditalic.0=-*-helvetica-bold-o-normal-*-*-%d-*-*-*-*-iso8859-1
# DialogInput font definition
#
dialoginput.plain.0=-*-courier-medium-r-normal-*-*-%d-*-*-*-*-iso8859-1
dialoginput.1=-*-itc
zapfdingbats-medium-r-normal--*-%d-*-*-*-*-*-fontspecific
dialoginput.2=-*-symbol-medium-r-normal--*-%d-*-*-*-*-*-fontspecific
dialoginput.italic.0=-*-courier-medium-o-normal-*-*-%d-*-*-*-*-iso8859-1
dialoginput.bold.0=-*-courier-bold-r-normal-*-*-%d-*-*-*-*-iso8859-1
dialoginput.bolditalic.0=-*-courier-bold-o-normal-*-*-%d-*-*-*-*-iso8859-1
# for backward compatibility
zapfdingbats.0=-*-itc
zapfdingbats-medium-r-normal--*-%d-*-*-*-*-*-fontspecific
# Default font definition
#
default.char=274f
# name aliases
#
alias.timesroman=serif
alias.helvetica=sansserif
alias.courier=monospaced
# Static FontCharset info.
#
# This information is used by the font which is not indexed by Unicode.
# Such fonts can use their own subclass of FontCharset.
#
# This information can be overriden by describing more specific style.
# For example
#
# fontcharset.serif.plain.3=SpecialSymbols
# means serif.plain.3 font's index can be retrieved with the convert()
method
# of instance of SpecialSymbols and what kind of characters
serif.plain.3 font
# has can be judged with the isCovered() method of instance of
SpecialSymbols.
#
fontcharset.serif.0=sun.io.CharToByte8859_1
fontcharset.serif.1=sun.awt.motif.CharToByteX11Dingbats
fontcharset.serif.2=sun.awt.CharToByteSymbol
fontcharset.sansserif.0=sun.io.CharToByte8859_1
fontcharset.sansserif.1=sun.awt.motif.CharToByteX11Dingbats
fontcharset.sansserif.2=sun.awt.CharToByteSymbol
fontcharset.monospaced.0=sun.io.CharToByte8859_1
fontcharset.monospaced.1=sun.awt.motif.CharToByteX11Dingbats
fontcharset.monospaced.2=sun.awt.CharToByteSymbol
fontcharset.dialog.0=sun.io.CharToByte8859_1
fontcharset.dialog.1=sun.awt.motif.CharToByteX11Dingbats
fontcharset.dialog.2=sun.awt.CharToByteSymbol
fontcharset.dialoginput.0=sun.io.CharToByte8859_1
fontcharset.dialoginput.1=sun.awt.motif.CharToByteX11Dingbats
fontcharset.dialoginput.2=sun.awt.CharToByteSymbol
fontcharset.zapfdingbats.0=CharToByte8859_1
# exclusion info.
#
# This information describe exclusion ranges for each fonts.
#
# 'exclusion.serif.plain.0' overrides 'exclusion.serif.0', and
# 'exclusion.serif.0' overrides exclusion.0, and so on.
#
# XFontSet string
# X11 only properties
#
fontset.serif.plain=\
-*-times-medium-r-normal-*-*-%d-*-*-*-*-iso8859-1
fontset.serif.italic=\
-*-times-medium-i-normal-*-*-%d-*-*-*-*-iso8859-1
fontset.serif.bold=\
-*-times-bold-r-normal-*-*-%d-*-*-*-*-iso8859-1
fontset.serif.bolditalic=\
-*-times-bold-i-normal-*-*-%d-*-*-*-*-iso8859-1
fontset.sansserif.italic=\
-*-helvetica-medium-o-normal-*-*-%d-*-*-*-*-iso8859-1
fontset.sansserif.bold=\
-*-helvetica-bold-r-normal-*-*-%d-*-*-*-*-iso8859-1
fontset.sansserif.bolditalic=\
-*-helvetica-bold-o-normal-*-*-%d-*-*-*-*-iso8859-1
fontset.sansserif.plain=\
-*-helvetica-medium-r-normal-*-*-%d-*-*-*-*-iso8859-1
fontset.monospaced.italic=\
-*-courier-medium-o-normal-*-*-%d-*-*-*-*-iso8859-1
fontset.monospaced.bold=\
-*-courier-bold-r-normal-*-*-%d-*-*-*-*-iso8859-1
fontset.monospaced.bolditalic=\
-*-courier-bold-o-normal-*-*-%d-*-*-*-*-iso8859-1
fontset.monospaced.plain=\
-*-courier-medium-r-normal-*-*-%d-*-*-*-*-iso8859-1
fontset.dialog.italic=\
-*-helvetica-medium-o-normal-*-*-%d-*-*-*-*-iso8859-1
fontset.dialog.bold=\
-*-helvetica-bold-r-normal-*-*-%d-*-*-*-*-iso8859-1
fontset.dialog.bolditalic=\
-*-helvetica-medium-o-normal-*-*-%d-*-*-*-*-iso8859-1
fontset.dialog.plain=\
-*-helvetica-medium-r-normal-*-*-%d-*-*-*-*-iso8859-1
fontset.dialoginput.italic=\
-*-courier-medium-o-normal-*-*-%d-*-*-*-*-iso8859-1
fontset.dialoginput.bold=\
-*-courier-bold-r-normal-*-*-%d-*-*-*-*-iso8859-1
fontset.dialoginput.bolditalic=\
-*-courier-bold-o-normal-*-*-%d-*-*-*-*-iso8859-1
fontset.dialoginput.plain=\
-*-courier-medium-r-normal-*-*-%d-*-*-*-*-iso8859-1
fontset.zapfdingbats=\
-*-itc zapfdingbats-medium-r-normal--*-%d-*-*-*-*-*-fontspecific
#
fontset.default=\
-*-helvetica-medium-r-normal-*-*-%d-*-*-*-*-iso8859-1
#
Geoff Gibbs
--
UK-Human Genome Mapping Project-Resource Centre,
Hinxton, Cambridge, CB10 1SB, UK
Tel: +44 1223 494530 Fax: +44 1223 494512 E-mail: G.G...@hgmp.mrc.ac.uk