Question

This might be a bit of a wide question. I have a couple of classes in Java that take input a String which is a mathematical expression and evaluates it.

I want to implement a desktop GUI for this. The user inputs the equation in a textfield and a couple of rectangles should be displayed under the textfield if the equation is not written correctly pointing at the syntax errors?

This is the closest thing I've come to what I want and it's not related to a GUI in Java http://web.cortland.edu/flteach/mm-course/glossPopupDiv.html

I use NetBeans. What can I use/How can I create a GUI for the application other than JFrame? Is there any way I could create the GUI in Javascript? Anything that can point me someplace is appreciated.

Était-ce utile?

La solution

JavaFX is a good (great? I'm biased...) way to develop GUIs for Java applications. It has officially split from the core of Java as of JDK11, so maintenance should improve moving forward. It also has many improvements over the older Swing GUI classes in Java. There is a comprehensive document covering it here: https://docs.oracle.com/javase/8/javafx/get-started-tutorial/index.html

There are plenty of tutorials out there, find one that looks fun and go for it.

There is also a GUI builder for JavaFX, SceneBuilder. It is now maintained by Gluon, and I find it works very well for simple GUIs.

I would recommend using at least Java 8 update 40, there were some significant improvements like stock dialogs added then.

Licencié sous: CC-BY-SA avec attribution
scroll top