11

I'm currently trying to create a GUI for a program I wrote that helps you save your passwords for sites into a file. As of right now the program will let you edit and provide those to you in a terminal/cmd. I want for it to have a GUI that would have 2 buttons in the beginning stating would you like to "See your passwords" or "Edit passwords". "See your passwords" would take you to another section of the GUI letting you see yours passwords, and "Edit passwords" would take you to a section of the GUI letting you add passwords and details into the file. Can somebody provide me good online tutorials that will allow me to accomplish this?

jmd_dk
13.2k11 gold badges71 silver badges104 bronze badges
asked Jul 18, 2012 at 15:06

5 Answers 5

18

If you want to do it the standard way, you can try out Swing as it comes with Java (JFC to be precise) and has good tutorials and support. Here is the official tutorial: Swing tutorial.

If you want to use something that uses the native OS components, then SWT is for you. Lars Vogel has zounds of tutorials in this topic: SWT tutorial.

If you want something new and shiny, then take a look at Java FX. It is meant to compete with FLEX and it is also an Oracle stuff: Java FX tutorial (edit: JavaFX is no longer part of the SDK).

There are other frameworks, but these are the most usable and well documented in my opinion.

One big plus for Swing and SWT is that you can use WindowBuilder to easily create UI-s with it. You can take a look at it here: WindowBuilder.

answered Jul 18, 2012 at 15:13
Sign up to request clarification or add additional context in comments.

3 Comments

SWT actually uses the native controls; they don't just look that way (or try to look as is the case with Swing).
Yes, indeed. Thanks for adding that, it was obvious for me.
As of today, "recommended" way of building UIs in Java is JavaFX
5

The Java Tutorials on Swing are a pretty good resource. If you don't like hand-coding your UI with Java code there are several GUI builders out there where you can lay out your UI visually and just fill in the behaviour in code-behind. E.g. Netbeans has such a thing and there is WindowBuilder for Eclipse.

answered Jul 18, 2012 at 15:08

Comments

3

If you don't have to use Swing, you can also try Java FX 2.x, which, I think, has a better look and feel. The latest version of Netbeans has a Java FX builder, but for what you describe it should be fairly easy to setup your frame programmatically.

answered Jul 18, 2012 at 15:10

5 Comments

JavaFX is still alive? Whoa, I can't say I ever saw it in the wild anywhere.
@Joey It is not Java FX 1.x but Java FX 2.x which is completely different (pure Java like Swing) and is actually supposed to replace Swing in the future.
Things have changed since 2012. Intellij 2019 has some fairly good javafx integration built in, and if you want a gui builder oracle still offers theirs
3

If you want to alleviate Java GUI programming then maybe you could consider using some framework, for example Griffon. I use it and it's pretty easier than pure Swing.

answered Jul 18, 2012 at 15:11

2 Comments

Here's a link to a very recent Griffon tutorial jaxenter.com/…
Griffon moved to a new location griffon-framework.org/index.html
3

1 Comment

Wow, that was fast! Thank you I will check that out.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.