manimalapotta
July 19th, 2005, 04:19 AM
I am converting java code into c#.net code using Java Language Conversion Assistant(JLCA). In java if i am giving a statement
Java- import javax.swing.*
then JLCA is converting it into statement as follows.
C#- using javax.swing.*
Now my problem is if am trying to compile .net code it is giving error that type or namespace missing.
I think it is because that .net don't know "javax" package.
Can any body suggest the equalent namespace for javax in .net
Thanks & Regards,
Manimala.
Andy Tacker
July 19th, 2005, 04:29 AM
excerpt from MSDN
Migrating Swing
Java contains two competing forms packages: the Abstract Windowing Toolkit (AWT) and Swing. AWT is available in JDK level 1.1.4, and is supported by Visual J# .NET and converted to Windows Forms by the Java Language Conversion Assistant. An add-on Swing library was available for JDK 1.1.4 and is a part of the J2SE and J2EE class libraries. Swing form layouts are not automatically migrated to .NET. During migration, the Javax.Swing classes are left as-is in your code, and should be replaced with Windows Forms classes. To do this, perform the following steps for each Swing Form in your migrated application:
Add a new Windows Form to the migrated application
Add controls to the form to give the same layout as the original Swing form
Copy the event logic code from the migrated Swing form into event handlers in the new Windows Form
Remove the migrated Swing form from your application
Windows Forms provides a richer environment than either AWT or Swing and in almost all respects contains a superset of the functionality found in the Java platform. For example, Windows Forms makes it easier to control the layout of forms. Layout managers in Java are often a source of difficulty. Trying to achieve the desired layout for a form requires an understanding of layout managers, and a lot of code for even the most basic layouts. Windows Forms simplifies this by providing absolute positioning for all controls. In addition, Windows Forms makes form resizing easy through docking and anchoring. Docking specifies that a control should always take up a particular area of the screen. Anchoring "pins" one or more corners of a control to the form. When the form is resized, these "pins" are used to determine the position of the control. By using docking and anchoring, complicated form-resizing code can usually be eliminated altogether.
Not only is it easy to move Swing forms to .NET, you can make a better application while doing so through the richer classes of the .NET Framework
also look for this link (http://www.jnbridge.com/demos.htm.) to see .NET to Java bridging solution