Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scala Swing: missing JComponent methods on Component

I want to use the setComponentPopupMenu(). But Scala.Swing.Component doesn't seem to have all the JComponent methods although javax.swing.JComponent is referenced in the documentation. So I'm a bit confused.

like image 815
Rich Oliver Avatar asked Aug 17 '12 08:08

Rich Oliver


1 Answers

The ScalaSwing api is rather incomplete, but it gives you access to the underlying swing object, with peer. So you can do

 yourScalaSwingComponent.peer.setComponentPopupMenu(...)

You're back in java (swing) land then.

like image 64
Didier Dupont Avatar answered Oct 24 '22 23:10

Didier Dupont