Created
August 22, 2009 23:35
-
-
Save randrews/173045 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
importClass(Packages.javax.swing.JComponent); | |
importClass(Packages.javax.swing.JFrame); | |
importClass(Packages.javax.swing.JLabel); | |
importClass(Packages.java.awt.Color); | |
var frame=new JFrame('Foo!'); | |
var comp=new JComponent(){ | |
paintComponent:function(g){ | |
print('painted'); | |
g.setColor(Color.RED); | |
g.drawLine(0,0,100,100); | |
} | |
}; | |
//frame.getContentPane().add(new JLabel('foo')); | |
frame.getContentPane().add(comp); | |
frame.pack(); | |
frame.setVisible(true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment