MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

MathJFrame, MathGraphicsJPanel question

  • To: mathgroup at
  • Subject: [mg47699] MathJFrame, MathGraphicsJPanel question
  • From: "J. McKenzie Alexander" <jalex at>
  • Date: Thu, 22 Apr 2004 02:38:57 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

I have two questions concerning the use of MathJFrame and 
MathGraphicsJPanel, which basically arose while writing the graphic 
viewer at  (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 

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 

(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,


  • Prev by Date: Goldbach partition points plot; "Close; but no cigar" (still):
  • Next by Date: RE: Undo and Plot3D
  • Previous by thread: Goldbach partition points plot; "Close; but no cigar" (still):
  • Next by thread: Re: MathJFrame, MathGraphicsJPanel question