MathJFrame, MathGraphicsJPanel question
- To: mathgroup at smc.vnet.net
- Subject: [mg47699] MathJFrame, MathGraphicsJPanel question
- From: "J. McKenzie Alexander" <jalex at lse.ac.uk>
- Date: Thu, 22 Apr 2004 02:38:57 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
I have two questions concerning the use of MathJFrame and MathGraphicsJPanel, which basically arose while writing the graphic viewer at http://evolve.lse.ac.uk/jalex/misc/GraphicViewer.nb. (That notebook uses JLink to define a function called GraphicViewer which, when passed a list of graphics objects, allows one to view the graphics one at a time, using "Next" and "Previous" buttons to page through the list, or to jump to a specific point by typing an index into a text box.) If you download that notebook and try it out, you'll notice two problems: first, the MathJFrame doesn't open at the right size... you have to resize it at first. Second, the MathGraphicsJPanel doesn't automatically resize when the containing MathJFrame is resized. (1) How does one set a MathJFrame to open at a specific size? I've tried calling setSize on a MathJFrame and haven't had any success in getting it to actually cause the MathJFrame to open at the specified size. (2) How might one configure a MathGraphicsJPanel to be notified when its containing JFrame is resized (but only at the *end* of the resize process) so that recompute() can be called? One often needs to call recompute() on the MathGraphicsJPanel so that it is the right size. Many thanks, Jason