Type mismatch error when adding JLabel/JPanel to Scala Swing Panel
问题 I'm trying to incorporate a java native JLabel (or a JPanel) to a scala swing application and I'm stuck with the compile error. The code I'm trying to run is the following. package com.david import javax.swing.JPanel import scala.swing._ object Hello extends SimpleSwingApplication { def top = new MainFrame { title = "First Swing App" contents = new JPanel() } } The compiler gives me the following error. $ sbt compile [info] Set current project to MyGui (in build file:/home/david/programming