| Код | import java.awt.*; import java.awt.event.*;
public class GrafikBeispiel extends Frame { public static void main(String[] args) { GrafikBeispiel wnd = new GrafikBeispiel(); } public GrafikBeispiel() { super("GrafikBeispiel"); addWindowListener(new WindowClosingAdapter(true)); setBackground(Color.lightGray); setSize(300,200); setVisible(true); } public void paint(Graphics g) { Font font; GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); String[] arfonts = ge.getAvailableFontFamilyNames(); for (int i = 0; i < arfonts.length; i++) { font = new Font(arfonts[i], Font.PLAIN, 36); g.setFont(font); g.drawString(arfonts[i], 10, (i+1)*(36+5)); } } }
|
Под вендой работает. Под линуксом выдает следующее:
| Код | # An unexpected error has been detected by HotSpot Virtual Machine: # SIGSEGV (0xb) at pc=0xa81ecbcd, pid=17571, tid=2815335328 # Java VM: Java HotSpot(TM) Client VM (1.5.0_06-b05 mixed mode) # Problematic frame: # C [libfontmanager.so+0x2ebcd] # An error report file with more information is saved as hs_err_pid17571.log
|
Как это заставить работать? |