Reputation: 311
I have a Java program that I have written in Eclipse running in jdk1.8.0_73 on Ubuntu 14.04
public class Vomit {
public static void main(String[] args) {
JFrame frame = new JFrame();
JLabel label = new JLabel();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Font font = new Font("Helvetica", 72, Font.BOLD);
label.setFont(font);
label.setText("Vomit!!");
frame.add(label);
frame.pack();
frame.setVisible(true);
}
}
Without any expiation, the frame is created at the minimum size and no text is displayed in the frame. Even stranger, my console output gets filled with a ton of font information.
Here is an example of a small segment of the output:
Font 244 Pattern has 17 elts (size 17)
family: "URW Palladio L"(w)
style: "Italic"(w)
slant: 100(i)(w)
weight: 80(i)(w)
width: 100(i)(w)
foundry: "urw"(w)
file: "/usr/share/fonts/type1/gsfonts/p052023l.pfb"(w)
index: 0(i)(w)
outline: True(w)
scalable: True(w)
charset:
0000: 00000000 ffffffff ffffffff 7fffffff 00000000 ffffffff ffffffff ffffffff
0001: ffffffff ffffffff fffff3ff ffffffff 00040000 00000000 00000000 00000000
0002: 0f000000 00000000 00000000 00000000 00000000 00000000 3f0002c0 00000000
0003: 00000000 00000000 00000000 00000000 00100000 10000000 00000000 00000000
0004: ffffffff ffffffff ffffffff 00000000 cf0ff000 0c0dcc00 faff0007 033ffffc
0020: 77180000 06010047 00000010 00000000 00000000 00001000 00000000 00000000
0021: 00400000 00000004 00000000 00000000 00000000 00000000 00000000 00000000
0022: 46260044 00000000 00000000 00000031 00000000 00000000 00000000 00000000
0025: 00000000 00000000 00000000 00000000 00000000 00000000 00000400 00000000
00f6: 00000000 00000000 00000000 00000000 00000000 00000000 000001f8 00000000
00fb: 00000006 00000000 00000000 00000000 00000000 00000000 00000000 00000000
(w)
lang: aa|af|av|ay|be|bg|bi|br|bs|bua|ca|ce|ch|co|cs|cv|da|de|en|eo|es|et|eu|fi|fj|fo|fr|fur|fy|gd|gl|gv|ho|hr|hu|ia|id|ie|ik|io|is|it|ki|kl|kum|kv|la|lb|lez|lt|lv|mg|mh|mk|mo|mt|nb|nds|nl|nn|no|nr|nso|ny|oc|om|os|pl|pt|rm|ro|ru|sel|sk|sl|sma|smj|so|sq|sr|ss|st|sv|sw|tk|tl|tn|tr|ts|uk|uz|vo|vot|wa|wen|xh|yap|zu|an|crh|csb|fil|hsb|ht|jv|kj|ku-tr|kwm|li|mn-mn|ms|na|ng|pap-an|pap-aw|rn|rw|sc|sg|sn|su|za(w)
fontversion: 0(i)(w)
fontformat: "Type 1"(w)
decorative: False(w)
hash: "sha256:64e4ba5bda2703d21a716b730570c3f401e75dcde74b23957de27bcab3f81680"(w)
postscriptname: "URWPalladioL-Ital"(w)
There are many more of these. When I pipe std out to a file there are almost 40,000 lines of this nonsense.
The exact same thing sometimes happens when I launch "xscreensaver-demo". Is this a problem with Java Swing (I don't even know that xscreensaver-demo uses Swing)? What is going on here?
Upvotes: 0
Views: 53
Reputation: 2667
For the JFrame showing it at minimum size, you have this line wrong:
Font font = new Font("Helvetica", 72, Font.BOLD);
Should be:
Font font = new Font("Helvetica", Font.BOLD, 72);
Upvotes: 2