# Look up the classes use JPL::Class "java::awt::Frame"; use JPL::Class "java::awt::Label"; |
# Create a new Frame and Label my $new = getmeth("new", ["java.lang.String"], []); my $f = java::awt::Frame->$new("Test"); my $label = java::awt::Label->$new("Hello, world!"); |
# Add the Label to the Frame my $add = getmeth("add", ["java.awt.Component"], ["java.awt.Component"]); $f->$add($label); |
$f->pack; $f->show; |
Forward to JavaBeans and ActiveX
Back to Calling Perl from Java with JPL: Example Up to PerlInside section index Up to Perl Inside course index |
Perl Inside: PerlInside - 35
Copyright © 1999, Brian Jepson
|