Re: Help with broken code
"Stefan Richthofer" <[email protected]> Fri, 19 Feb 2016 01:03:08 +0100
| Newsgroups | gmane.comp.lang.jython.user |
|---|---|
| Message-ID | <trinity-06371e82-410f-47c2-a437-d852ab9bd0a2-1455840187999@3capp-gmx-bs48> |
Rafael, sorry, I had read your email too quickly and had misconcepted the issue in the sense that the window would not display at all. (That's why I suggested to call frame.show and try the JOptionPane-based test program.) Given that the window actually *does* display makes my suggestions rather irrelevant I suppose. However, I can also not reproduce the *actual* issue on my system - here the button causes the console to print "Clicked!" as expected (using Jython 2.7.1 beta 3 and Java 7). Maybe you can first check that it's not a console issue: Let the click change the button- or frame capture instead. Does ordinary console printing work? What Jython- and Java version are you using? -Stefan > Gesendet: Donnerstag, 18. Februar 2016 um 17:27 Uhr > Von: "Bejarano, Rafael P." <[email protected]> > An: "Stefan Richthofer" <[email protected]> > Cc: "[email protected]" <[email protected]> > Betreff: RE: [Jython-users] Help with broken code > > Thank you for your prompt reply. I'll give your suggestions a try. > > Rafael > ________________________________________ > From: Stefan Richthofer [[email protected]] > Sent: Wednesday, February 17, 2016 2:52 PM > To: Bejarano, Rafael P. > Cc: [email protected] > Subject: Re: [Jython-users] Help with broken code > > Hello Rafael, > > trying your program on linux, it works like expected. > However, did you try to call frame.show()? > (maybe instead of frame.visible = True) > > If this also fails, can you confirm that the equivalent Java-program would work? > Given that it works on my setup, it is possible that on your system > something with Java is broken rather than with Jython. > > In case you don't speak Java, try the trivial swing program: > > from javax.swing import JOptionPane > JOptionPane.showInputDialog("Hello Jython"); > > in Java: > > public static class TestSwing { > public static void main(String[] args) { > javax.swing.JOptionPane.showInputDialog("Hello Jython"); > } > } > > If this works in Java, but not in Jython, I'd suggest to file an issue on bugs.jython.org. > Also helpful: Did you apply some specific change that broke the program? Some update of > Java or Jython, or some System update? Every information about what caused the breakage > is helpful. > > Best > > Stefan > > > > Gesendet: Mittwoch, 17. Februar 2016 um 19:07 Uhr > > Von: "Rafael Bejarano" <[email protected]> > > An: [email protected] > > Betreff: [Jython-users] Help with broken code > > > > Hello, > > > > The demo program below used to work, but now, when the button is clicked, nothing happens, although the window displaying the button does open just fine. I run it in the Macintosh Unix terminal. Any assistance with this problem would be greatly appreciated. > > > > Rafael Bejarano > > > > from javax.swing import JButton, JFrame > > frame = JFrame('Hello, Jython!', defaultCloseOperation = JFrame.EXIT_ON_CLOSE, size = (300,300)) > > def change_text(event): > > print "Clicked!" > > > > button = JButton('Click Me!', actionPerformed=change_text) > > frame.add(button) > > frame.visible = True > > ------------------------------------------------------------------------------ > > Site24x7 APM Insight: Get Deep Visibility into Application Performance > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > > Monitor end-to-end web transactions and take corrective actions now > > Troubleshoot faster and improve end-user experience. Signup Now! > > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 > > _______________________________________________ > > Jython-users mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/jython-users > > ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140