java swing – dremi.INFO https://www.dremi.info Software Development, Digital Marketing and News Mon, 21 Mar 2011 17:02:20 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.2 https://www.dremi.info/wp-content/uploads/2020/12/cropped-icon-32x32.png java swing – dremi.INFO https://www.dremi.info 32 32 Simple Swing Login Form And getText() https://www.dremi.info/tutorials/java/simple-swing-login-form-and-gettext.html https://www.dremi.info/tutorials/java/simple-swing-login-form-and-gettext.html#comments Mon, 21 Mar 2011 17:02:20 +0000 https://www.dremi.info/?p=1260 […]]]> Simple Swing Login Form And getText()
Just say hello to my favourite IDE : NETBEANS!! At previous time, I still use PHP Designer as Main IDE, but since I worked under few of the other language such as RoR and JAVA, NETBEANS is the best IDE for me.
Well, this is my simple and short JAVA tutorial about how to create login form using SWING.

Ok, let’s open your Netbeans IDE, and chose New Java Application Project

Right click on your package of project to create new jFrame from

And then create 3 jLabel from swing control at the right panel, consist of Login title, User ID and Password

Create 1 jTextField for User ID and 1 jPasswordField for Password

The last is create a jButton into form

Right click on jButton to perform an action when button clicked

and add this code:

JOptionPane.showMessageDialog(this, "Selamat Datang" +  jTextField1.getText() + "Password Anda adalah: " +  jPasswordField1.getText(), "", JOptionPane.INFORMATION_MESSAGE);

simple isn’t it??
Now press F6 to run and build your project

]]>
https://www.dremi.info/tutorials/java/simple-swing-login-form-and-gettext.html/feed 2