Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Other Java > Java GUI
Java GUI Discussions specific to programming Java GUI.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java GUI section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old December 5th, 2008, 07:04 AM
Registered User
Join Date: Mar 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Aurgent needed(VB convert to Java)

All,this is a Urgent requirement,
I want to know how to convert the below Vb Coding into Java.

Private Sub optRegister_Click()
If optRegister.Value = True Then
    lblStatus.Caption = "Before Putting finger on the sensor - Enter user details "
    txtUserCode = "": txtUserName = "": picFingerprint.Picture = Nothing
    txtUserCode.Enabled = True: txtUserName.Enabled = True
    Set fpGet = Nothing
    Set fpRegister = Nothing
    Set fpRegister = New FPRegisterTemplate

    lblStatus.Caption = "Register: Press your finger in the device"
    lblStatus.Caption = "Press your finger in the device... "
    txtUserCode = "": txtUserName = "": picFingerprint.Picture = Nothing
    txtUserCode.Enabled = False: txtUserName.Enabled = False
    Set fpRegister = Nothing
    Set fpGet = Nothing
    Set fpGet = New FPGetTemplate

    lblStatus.Caption = "Verify: Press your finger in the device"
End If
End Sub

Private Sub SaveDetails()
    Dim rsUser As New ADODB.Recordset
    Dim bVariant As Variant
' blob_write = Null
    bVariant = Null

    If Template Is Nothing Then
        lblEvents.Caption = ""
        MsgBox "Nothing Registered !!"
        Exit Sub
    End If
    If txtUserCode = "" Then
        MsgBox "Please enter UserCode", vbInformation
        Exit Sub
    End If
    If txtUserName = "" Then
        MsgBox "Please enter Username", vbInformation
        Exit Sub
    End If
    Template.Export bVariant
    blob_write = bVariant
    rsUser.Open "select * from users where usercode='" & Trim(txtUserCode) & "'", cn, adOpenKeyset, adLockOptimistic
    If rsUser.EOF Then
    End If
    rsUser!usercode = txtUserCode
    rsUser!Name = txtUserName
    rsUser!Fingerprint = blob_write
    If MsgBox("Want to do more registerations !! ? ", vbYesNo, "More Registrations ?") = vbYes Then
        Call optRegister_Click
        optRegister.Value = False
    End If
    Set rsUser = Nothing
End Sub

If AnyBody Knows,Then plz help me.

Thanks in Advance


Old December 5th, 2008, 10:01 PM
Friend of Wrox
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts

That code is part of a STANDALONE executable program, written in VB.

That is, it is designed to be part of an ".exe" executable that some user would install and run on their own PC.

As such, even if we did know what FPRegisterTemplate and FPGetTemplate are, I don't see how it would do any good to just translate these two subroutines to Java. You would *STILL* need *ALL* of the rest of the executable program that is driving all this to be translated and working.

Just for example, many of the variables used in there are, presumably, related to form fields (e.g., txtUserName, txtUserCode). And you don't show the code for the form or anything related to it.

So while it's conceptually easy enough to translate that code line by line from VB to Java, the result would never actually work or do anything until you had all the other supporting code in place.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help needed regarding Java classes sadz123 Java Basics 2 February 11th, 2009 08:49 AM
Jsp 1.2-----Chat Example Very Aurgent kotaiah JSP Basics 1 October 11th, 2006 01:38 PM
Convert a .java to a .exe Geo121 Java Basics 2 February 1st, 2006 05:30 AM
Java Book Needed Wheelz All Other Wrox Books 0 September 1st, 2004 02:22 AM
Convert Java to C# justdavid77 C# 0 November 21st, 2003 09:01 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.