0

i'm looking at some example code that is erroring out in scala 2.9.1:

import javax.swing.JFrame import javax.swing.JMenuBar import javax.swing.JButton import javax.swing._ import com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel import javax.swing.{UIManager} object UI extends SimpleSwingApplication { UIManager.setLookAndFeel(new NimbusLookAndFeel) } 

error: /some/path/Cls.scala:25: error: not found: type SimpleSwingApplication

1 Answer 1

1

turns out i had to run my code like so:

scala -classpath /usr/share/java/scala-swing.jar Cls.scala

the code base that was successful is:

import javax.swing.JFrame import javax.swing.JMenuBar import javax.swing.JButton import javax.swing._ import scala.swing.SimpleSwingApplication import scala.swing._ object UI extends SimpleSwingApplication { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()) def top = new MainFrame { title = "First Swing App" contents = new Button { text = "Click me" } } def main() { println("hi") } } 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.