Skip to content

Instantly share code, notes, and snippets.

@Sciss
Created February 20, 2014 19:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sciss/9121802 to your computer and use it in GitHub Desktop.
Save Sciss/9121802 to your computer and use it in GitHub Desktop.
import java.awt._
import javax.swing._
import image.BufferedImage
val f = new JFrame("Foo")
val img = new BufferedImage(256, 256, BufferedImage.TYPE_INT_ARGB)
val g = img.createGraphics
g.setPaint(new LinearGradientPaint(0f, 0f, 256f, 256, Array(0f, 1f), Array(Color.red, Color.blue)))
g.fillOval(0, 0, 256, 256)
g.dispose()
f.setIconImage(img) // !
f.setSize(200, 200)
f.setVisible(true)
// f.setName("FOO BAR") // no effect...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment