Can I replace the query on a Display class screen?

Yes!

mywindow.setMetaSQLQuery("group", "query");