Scala.swing How does one scala components to current window size -


i'm trying display image in simpleswingapplication. make image change size when window changes size (i.e. manually dragging cursor adjust size).

i think done listening something, reacting uielementresized.

but i'm not sure how it.

i've tried:

        listento(top) \\ or window/frame/uievent         reactions += {             // case uielementresized=>             case class uielementresized(source: uielement); => // or without semicolon, without "source: uielement", without "class", , few other permutations.                println(size)          } 

i asked similar question yesterday, narrow. want make more broad question entire problem.

i'm not familiar swing, looks reactions use partial functions callbacks. issue in pattern matching syntax, try

reactions += {     case uielementresized(source) => println(source.size) } 

you can find more detailed examples here: listeners , reactions in scala swing


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -