I think Mitch Christensen wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> The following code snippet taken directly from chapter 13 

Well, not -exactly- taken directly.  Up until the setVisible call, the
code is leading up to one screen shot, and the second snippet is
leading up to the next screen shot. So this is really to chunks I
carved out of the actual program (in the examples code that you can
download from manning.com .)

> of JIA displays an *empty* JFrame.  If I resize the window (JFrame),
> the text magically appears. 
> 
> (defglobal ?*frame* = (new JFrame "Diagnostic Assistant"))
> (defglobal ?*qfield* = (new JTextArea 5 40))
> 
> (?*frame* setSize 520 140)
> (?*frame* setVisible TRUE)
> 
> (bind ?scroll (new JScrollPane ?*qfield*))
> ((?*frame* getContentPane) add ?scroll)
> (?*qfield* setText "Please wait...")
> (?*frame* repaint)

So here's the problem: I've added components to an already-visible
frame. These components won't show up until you call validate() on the
frame. The call to validate is in listing 13.2 on the bottom of page
207, after more of the GUI is set up. So I apologize -- when I broke
the program into pieces for this discussion, I should have added extra
validate() calls at each step, but I didn't. Change the repaint call
to a validate call and you'll see it works as advertised.

Thanks, this is one for the nascent errata page.

---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550         http://herzberg.ca.sandia.gov

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to