jfr
jfr

Reputation: 407

How to specify maximum/minimum size for JavaFX Dialog

If my experience is representative then surprised this hasn't been asked before, I DID look.

I need to specify maximum and minimum size for a JFX Dialog, which does not have max/min/pref width/height properties .. BUT .. does have read only width and height properties together with standard get/set methods. I'm able to add an InvalidationListener to these properties, but nothing happens in the listener when I change the size by clicking and dragging on the dialog's edge. Tried using a ChangeListener, again nothing happens.

This is easy to test, just create a Dialog and basic listener and run System.out.println("dlg size changed") in listener implementation.

Lastly I tried the same with the dialog's DialogPane with same results.

Would be grateful to know if (i) what I'm attempting is possible, (ii) if so, then HOW, and (iii) if not, then why not?

Thanks!

Upvotes: 4

Views: 1813

Answers (0)

Related Questions