Forums Register Login

Listing fonts is a problem here

+Pie Number of slices to send: Send
Hi,
The following code is giving me a hard time finding fonts on my list. I have tried Ivor Horton's example too. The same problem occurs either the code is in an application or in an applet. The code is...
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
// implement Item Listener
public class ListFonts2 extends Applet {
List list;
TextField tf;
public void init() {
setLayout(new BorderLayout());
GraphicsEnvironment env =
GraphicsEnvironment.getLocalGraphicsEnvironment();
String fontList[] = env.getAvailableFontFamilyNames();
list = new List(5, false);
for (int i = 0; i < fontList.length; i++)
list.add(fontList[i]);
add(list, BorderLayout.CENTER);
// register the current applet with the List instance
tf = new TextField();
tf.setEditable(false);
add(tf, BorderLayout.SOUTH);
}
// implement the method(s) prescribed in ItemListener
}

Result:
D:\jdk1.3\bin>java FontList
Assertion failed: offset < fFileSize, file ..\..\..\..\src\share\native\sun\awt\
font\fontmanager\fontobjects\fontObject.cpp, line 240
abnormal program termination.
Can anybody help??
Thanks in advance
+Pie Number of slices to send: Send
This has nothing to do with JDBC, I'm sending it to the Swing / JFC / AWT forum.
Dave
She'll be back. I'm just gonna wait here. With this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 922 times.
Similar Threads
Problem invoking servlet using applet
Listing fonts is a problem here
Please help me for Applet Communications!
CALLING RAUKAUTAM SANDEEP,ANGELA
Listing fonts is a problem here
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 16:13:30.