jQuery in Action, 3rd edition
The moose likes JDBC and Relational Databases and the fly likes Listing fonts is a problem here Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Listing fonts is a problem here" Watch "Listing fonts is a problem here" New topic

Listing fonts is a problem here

Maki Jav
Ranch Hand

Joined: May 09, 2002
Posts: 439
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 =
String fontList[] = env.getAvailableFontFamilyNames();
list = new List(5, false);
for (int i = 0; i < fontList.length; i++)
add(list, BorderLayout.CENTER);
// register the current applet with the List instance
tf = new TextField();
add(tf, BorderLayout.SOUTH);
// implement the method(s) prescribed in ItemListener

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

Help gets you when you need it!
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

This has nothing to do with JDBC, I'm sending it to the Swing / JFC / AWT forum.
I agree. Here's the link: http://aspose.com/file-tools
subject: Listing fonts is a problem here
It's not a secret anymore!