Does Jython support Tkinter

Does Jython support Tkinter? If I code a program in Python and put the GUI on it with Tkinter, how hard would it be to make the same program in Jython? Or is there a better Jython GUI solution?

When I try java -jar "jarname" It shows an error like: import Tkinter, tkFileDialog, tkMessageBox, tempfile, shutil ImportError: There is no module named Tkinter

How can I solve this problem ............ Thanks in advance ..... :)

+6
jython tkinter
source share
3 answers

No, it is not. You will need to rewrite your application with swt, swing, etc. There is no Jython-CPython gui compatible unless you are coding for the web.

+4
source share

There is an old (last modified 2000-01-30) project for running Tkinter in Jython (then JPython) using the Java Native: JTkinter interface . I would be shocked if it still worked with modern JVM and Jython, but for anyone interested in porting Tkinter looking at its code would be a good starting point.

0
source share

The JyNI project aims to support native CPython extensions in Jython. Although it is still far from maturity, especially Tkinter has already said that it is supported. However, JyNI only works on Linux. In its current version, JyNI does not do garbage collection, so a memory leak may occur. However, I believe that this should not be a problem for Tkinter, but it should be used with caution anyway.

Just by chance - if you have to try, despite these shortcomings: Since I am involved in this project, I would appreciate if you could give feedback to the contact letter of the project and if it does not work with your Tkinter code, send an unsuccessful fragment Tkinter code.

0
source share

All Articles