From: A B. <AB...@co...> - 2003-04-22 12:37:34
|
Hi Patrick, This doesn't seem to work in the context I've used it: (note: I found EXIT_ON_CLOSE an attribute of JFrame) ********************************************************* C:\jython-2.1>jython Jython 2.1 on java1.3.1_02 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> import javax.swing.JOptionPane as JOptionPane >>> import javax.swing.JFrame as JFrame >>> jf = JFrame() >>> jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) >>> JOptionPane.showMessageDialog(jf,"Hello") >>> jf.dispose() <hangs here: have to kill java.exe process to exit> ********************************************************* Ant -----Original Message----- From: Patrick Bielen [mailto:bi...@st...] Sent: 22 April 2003 11:59 To: A Bewes; jyt...@li... Subject: Re: [Jython-users] Dialog box hanging Hello, Use self.setDefaultCloseOperation(swing.WindowConstants.EXIT_ON_CLOSE) and self.dispose() to force it to close down the window and all threads. Cheers Patrick ----- Original Message ----- From: "A Bewes" <AB...@co...> To: <jyt...@li...> Sent: Tuesday, April 22, 2003 12:38 PM Subject: [Jython-users] Dialog box hanging > Hi, > > I'm displaying a dialog box using a Java Swing component, > (see script below) the trouble is I can't exit Jython after > I use it? > > Presumably there's still a thread running, but I don't know how to stop it! > > I've tried passing in a real JFrame (instead of None) as the > parent Component then finally setting it to None and even > applying del() but without success. > > Thanks, > > Ant > > > ********************************************************* > C:\jython-2.1>jython > Jython 2.1 on java1.3.1_02 (JIT: null) > Type "copyright", "credits" or "license" for more information. > >>> import javax.swing.JOptionPane as JOptionPane > >>> JOptionPane.showMessageDialog(None,"hello") > >>> ^Z > > > <hangs here: have to kill java.exe process to exit> > ********************************************************* > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Jython-users mailing list Jyt...@li... https://lists.sourceforge.net/lists/listinfo/jython-users |