SBT - 缺少依赖

SBT - missing dependency

好吧,我的合作者 运行 在 build.sbt 下显示的代码没有任何问题,而我得到:

[error] /.../GameMap.scala:91: value revalidate is not a member of javax.swing.JFrame
[error]     frame.revalidate()
[error]           ^
[error] /.../GameMap.scala:92: value revalidate is not a member of java.awt.Container
[error]     frame.getContentPane.revalidate()
[error]                          ^

我怀疑 build.sbt 中缺少某些内容:

scalaVersion := "2.10.4"

resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/"

// scalacOptions ++= Seq("-feature")                                                                                                                                    

libraryDependencies ++= Seq(
  "com.typesafe.akka" %% "akka-actor" % "2.3.8",
  "com.typesafe.akka" %% "akka-cluster" % "2.3.8",
  "org.scala-lang" % "scala-swing" % "2.10.4"
)

这是什么?

我猜你的 运行 Java 6 和你的合作者是 运行 Java 7

This is the Container documentation for java 6,它没有列出从 Component 继承的 revalidate 方法。

And here is the java 7 documentation,其中确实列出了从 Component

继承的 revalidate 方法

*swing

也可以这样说