Problem with setting Fonts with the latest CVS

Willy Heineman wheineman@uconect.net
Fri Jun 2 07:18:00 GMT 2000


Hi,
	I'm getting an error when I attempt to set fonts for swing components
with the lasest CVS version that I don't get with 1.6.6. The following
code:

;; Create a JTextArea object
(define textarea (make <javax.swing.JTextArea>))
(invoke (as <javax.swing.JTextArea> textarea) 
    'setLineWrap #f)
(invoke (as <javax.swing.JTextArea> textarea) 
    'setEditable #f)
(define myfont (make <java.awt.Font> 
                (as <java.lang.String> "Monospaced")
                (static-field <java.awt.Font> 'PLAIN) 12))
(display myfont)
(newline)
(invoke (as <javax.swing.JTextArea> textarea) 
    'setFont (as <java.awt.Font> myfont))



yields the following:


java.awt.Font[family=monospaced,name=Monospaced,style=plain,size=12]
Argument  to `javax.swing.JTextArea.setFont' has wrong type
	at gnu.expr.GenericProc.applyN(GenericProc.java:67)
	at gnu.kawa.reflect.Invoke.applyN(Invoke.java, Compiled Code)
	at gnu.kawa.reflect.Invoke.applyN(Invoke.java, Compiled Code)
	at gnu.expr.ApplyExp.eval(ApplyExp.java, Compiled Code)
	at gnu.expr.ModuleExp.evalModule(ModuleExp.java, Compiled Code)
	at kawa.Shell.run(Shell.java:85)
	at kawa.standard.load.loadSource(load.java:124)
	at kawa.standard.load.loadSource(load.java:102)
	at kawa.standard.load.apply(load.java:173)
	at kawa.Shell.runFile(Shell.java:124)
	at kawa.repl.main(repl.java:350)



Hope this is helpful,


Willy Heineman


More information about the Kawa mailing list