Hello,

I've got a problem using some swing classes in tcljava - called from an
event handling procedure a dialog object does not work correct.

As long as a Dialog object is created and shown within a 'normal' procedure
everything works fine - as shown with the call to  'testProc" from the last
line of the sample program below. As soon as I bind it to an event (button
pressed) and the user presses the button  the dialog window still shows up,
but no components in this window are shown (no buttons, no text - just an
empty window).

Anyone knows anything about this behaviour? Is it a java or a jaclsh
problem?

using:
        jacl 1.2.6
         HP-UX Java C.01.18.03

Thanks,
Thoralf
        
###########################################
##                    Sample code
###########################################

# load the java package
   package require java

# proc testProc
#   is called everytime the user pushes the button
proc testProc { } {

   global jf
   
   set reponse [java::call javax.swing.JOptionPane showConfirmDialog \
     $jf "Can you see me?"]
}   

# generate all the GUI elements
   global jf
   set jf [java::new javax.swing.JFrame]
   set jb1 [java::new javax.swing.JButton]
   set content [$jf getContentPane]
   $jf setSize 200 100
   $jb1 setText "Click me"
   $content setLayout [java::null]
   $content add $jb1
   $jb1 setBounds 10 10 170 30 
   $jf setVisible true

# bind the actionPerformed event to testProc
   java::bind $jb1 actionPerformed testProc
   
# just to show you that a simple call to testProc works
   testProc   

--
Thoralf Czichy
[EMAIL PROTECTED]

----------------------------------------------------------------
The TclJava mailing list is sponsored by Scriptics Corporation.
To subscribe:    send mail to [EMAIL PROTECTED]  
                 with the word SUBSCRIBE as the subject.
To unsubscribe:  send mail to [EMAIL PROTECTED] 
                 with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'. 
An archive is available at http://www.mail-archive.com/tcljava@scriptics.com

Reply via email to