fork download
  1. import scala.swing._
  2. import scala.swing.event.MouseClicked
  3. import java.awt.Point
  4.  
  5. object MouseTest extends SimpleSwingApplication {
  6. def top = new MainFrame {
  7. title = "Window Title"
  8. minimumSize = new Dimension( 300, 300 )
  9. location = new Point(500,500)
  10.  
  11. contents = new BoxPanel( Orientation.Vertical ) {
  12. contents += new Label("TEXT") {
  13. listenTo(this.mouse.clicks)
  14. reactions += {
  15. case MouseClicked(source, point, modifiers, clicks, triggersPopup) => {
  16. var los = top.locationOnScreen
  17. println(los)
  18. }
  19. }
  20. }
  21. }
  22. }
  23. }
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty