VB to Java Tutor Help


Using Tutor
 
Predefined Variables
 
Notes
Variant Data Type
Case Sensitive Keywords
Unsupported Properties and Methods
Relationship to VB Converter
Troubleshooting

Using Tutor

Just type in some Visual Basic code in the top pane and press the convert button. The corresponding Java code will be displayed in the bottom pane.

A Form with all of the basic controls are predefined so converting from a property in VB is very easy and quick. For example, type in the following VB code:

Text1 = Label1
Text1.BackColor = vbRed

And you get the following output in Java:

Text1.setText( Label1.getText() );
Text1.setBackground( Color.red );

Use Tutor to lookup a Java function by typing in the VB function. For example:

s = FormatDateTime( d, vbLongDate )

And you get the following output in Java:

s = DateFormat.getDateInstance(DateFormat.LONG).format( d );

Note: d is a predefined Date variable and s is a predefined String.

Predefined Variables

Several variables and controls have been predefined. These can be used just as you would if you had written a "Dim" statement at the top of your module or as if you had place an instance of one of the controls in the Form window.

Type Variable Name
Integer i
String s
Double dbl
Date d
CheckBox Check1
ComboBox Combo1
CommandButton Command1
Frame Frame1
HScrollBar HScroll1
Image Image1
Label Label1
Line Line1
ListBox List1
Menu Menu1
OptionButton Option1
PictureBox Picture1
Shape Shape1
TextBox Text1
Timer Timer1
VScrollBar VScroll1

Notes

Variant Data Type

Occasionally, you will see a reference to a Variant class. This class is not a standard Java class nor is it supplied with Tutor. It is one of the classes that ships with VB Converter .

Case Sensitive Keywords

All VB keywords are case insensitive except the following:

Each of the above keywords can also be in all lower case e.g. "end function".

Unsupported Properties and Methods

There are some properties and methods that are not supported in Java. If you use something that is not supported in Java then the VB code will be commented out and placed in the Java code. For example in VB:

Text1.Appearance = 3
i = Text1.Appearance

And you get the following output in Java:

//unsup Appearance = 3;
i = 1 /*Text1.getAppearance()*/;

Relationship to VB Converter

Tutor uses the same VB to Java conversion technology that is in VB Converter , the industry leading VB to Java conversion tool. VB Converter is a Visual Basic add-in that instantly converts entire Visual Basic applications to Java, allowing you to leverage your existing VB investment. VB Converter eliminates the need to rewrite Visual Basic applications in Java and allows you to deploy them on the Internet, on an intranet or on any platform which supports Java. VB Converter won a JavaWorld Editor's Choice Award for best utility.

VB Converter ships with a library of Java classes which extend the builtin Java classes with functionality that exists in VB but which are not in the standard Java library. For this reason, VB Converter will convert more code.

Troubleshooting

If you don't get any functions output under "// methods" line, make sure that TutorTemplate.frm and Tutor.frm are not read-only files.