A very simple gui(form) application with ruby

include Java
import javax.swing.JButton
import javax.swing.JFrame
import javax.swing.JPanel
import javax.swing.JLabel
import javax.swing.JTextField
import javax.swing.JPasswordField
import java.lang.System

class MainProgram  < JFrame 
        def startGUI
          jf = JFrame.new 
          cntr = jf.getContentPane
          jf.setVisible true
          jf.setDefaultCloseOperation JFrame::EXIT_ON_CLOSE
          jf.setSize 500,500
          jf.setLayout nil 
          fname = JLabel.new "FirstName"
          lname = JLabel.new " Lastname "
          email = JLabel.new " Email"
          password = JLabel.new " Password"
          address = JLabel.new " Address"


          fnametext = JTextField.new
          lnametext = JTextField.new
          emailtext = JTextField.new
          passwordtext = JPasswordField.new
          addresstext = JTextField.new


          cntr.add fname
          cntr.add lname
          cntr.add email
          cntr.add password
          cntr.add address
          cntr.add fnametext
          cntr.add lnametext
          cntr.add emailtext
          cntr.add passwordtext
          cntr.add addresstext 


          fname.setBounds 50,20,300,300
          lname.setBounds 50,70,300,300
          email.setBounds 50,120,300,300
          password.setBounds 50,170,300,300
          address.setBounds 50,220,300,300


          fnametext.setBounds 150,150,150,40
          lnametext.setBounds 150,200,150,40
          emailtext.setBounds 150,250,150,40
          passwordtext.setBounds 150,300,150,40
          addresstext.setBounds 150,350,150,40

          button = JButton.new "Submit"
          cntr.add button
          button.setBounds 150,400,150,20

        end
end 

hello = MainProgram.new 
hello.startGUI

Update comming soon with Event Handling…….