FAQ
Cover
\
Build
\
Source
\
Bugs
\
Reference
\
Libraries
\
Tools
The bugs database has moved
here
.
Bug 1554 : Java swing no longer works in Processing 1.1
Last modified: 2010-05-02 06:13
P
roject:
processing
trash
Version:
unspecified
Co
m
ponent:
android
book
core
libraries
pde
reference
tools
web
Status:
RESOLVED
Resolution:
INVALID -
Pr
i
ority:
P2
Severity:
normal
Platform
All
O
S:
All
Windows
Mac OS
Linux
Other
Reporter:
Phillip M. Feldman
Assigned To:
fry
Attachment
Type
Created
Size
Actions
Description
: Opened: 2010-05-01 19:32
The following code worked fine with Processing 1.0.9, but fails with an
error message message
in 1.1:
import javax.swing.*;
import javax.swing.plaf.FontUIResource;
UIManager.put("OptionPane.messageFont", new FontUIResource(
new Font("Verdana", Font.BOLD, 24) ) );
UIManager.put("TextField.font", new FontUIResource(
new Font("Verdana", Font.BOLD, 20) ) );
Here's the error message:
"The constructor FontUIResource(Font) is undefined."
Additional Comment
#1 From fry 2010-05-02 06:13
add
import java.awt.Font;
to your sketch, and it'll work fine. from revisions.txt:
+ Changed how imports are handled in sketches. This may break some sketches
that use java.xxx packages that aren't covered in the Processing reference.