p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > Java > Other Java > Java GUI
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 5th, 2008, 07:04 AM
Registered User
Points: 4, Level: 1
Points: 4, Level: 1 Points: 4, Level: 1 Points: 4, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2007
Location: bangalore, karnataka, India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Aurgent needed(VB convert to Java)

Hiiiii,
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

    fpRegister.Run
    lblStatus.Caption = "Register: Press your finger in the device"
Else
    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

    fpGet.Run
    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
        rsUser.AddNew
    End If
    rsUser!usercode = txtUserCode
    rsUser!Name = txtUserName
    rsUser!Fingerprint = blob_write
    rsUser.Update
    If MsgBox("Want to do more registerations !! ? ", vbYesNo, "More Registrations ?") = vbYes Then
        Call optRegister_Click
    Else
        optRegister.Value = False
        optRegister_Click
    End If
    Set rsUser = Nothing
End Sub




If AnyBody Knows,Then plz help me.

Thanks in Advance

'Deba'

deba
__________________
deba
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old December 5th, 2008, 10:01 PM
Friend of Wrox
Points: 4,805, Level: 29
Points: 4,805, Level: 29 Points: 4,805, Level: 29 Points: 4,805, Level: 29
Activity: 38%
Activity: 38% Activity: 38% Activity: 38%
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,323
Thanks: 3
Thanked 70 Times in 69 Posts
Default

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

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 02: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 03:22 AM
Convert Java to C# justdavid77 C# 0 November 21st, 2003 09:01 PM



All times are GMT -4. The time now is 03:34 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc