by John Sharp, Content Master Ltd.
Developers can run Java language GUIs in Microsoft .NET if they take a few guidelines into account ahead of time
Microsoft Visual J# .NET includes an implementation of many Java Development Kit (JDK) 1.1.4 packages, including the Abstract Windowing Toolkit (AWT), which is used to create Graphical User Interfaces (GUIs) with the Java programming language. This functionality makes it possible for developers to build GUIs that can run unchanged on platforms such as Unix (including Solaris and Linux), as well as on Windows.
Developers can create GUI applications using the AWT that will run unchanged using Java running on Unix and Visual J# .NET using the Microsoft Common Language Runtime (CLR) running on Windows. This paper concentrates on using the J# compiler, Vjc.exe, to convert working sets of Java language source files into .NET executables and .NET assemblies.
Readers should note that an alternative way to integrate Java code into .NET is to translate Java byte code such as that held in .class files into .NET Common Intermediate Language (CIL) code using the JbImp.exe command line utility (also included with Visual J# .NET). Using JbImp is covered in a separate white paper titled "Integrating Java and Microsoft .NET."
The Microsoft .NET Framework is not without limitations with regard to Java functionality. For instance, Java Swing packages cannot be used with J#, as they became available after JDK 1.1.4. Java GUI applications that employ Swing must be manually recoded to use the equivalent Windows Forms constructs of the .NET Framework. J# also does not provide support for Java Remote Method Invocation (RMI), the Java Native Interface (JNI), Java applets, or the ability to dynamically load Java classes from bytecode (.class) files.
Graphical applications that use these features must be manually converted to use the appropriate .NET mechanisms. Further discussion of these issues is beyond the scope of this paper.
A sample Java GUI application
The code listings that accompany this article show the main elements of a basic GUI application written in the Java language. The application displays a window (EmployeeFrame) that allows the user to enter employee details for an organization (the application does not save those details anywhere, as the purpose of this example is simply to show the user interface).
![]()
![]() | For-loop threading methods by Jeff Andrews, application engineer, Intel Corp. Explore differen... |
![]() | Multithreaded technology and multi-core processors by Craig Szydlowski, Infrastructure Processor Division, Intel Corp. ... |
![]() | Dual processors, Hyper-Threading Technology, and multi-core systems by Sunish Parikh, software performance engineer, and Thomas E. Martine... |
If you're interested in this topic, these articles may be helpful:
![]() | Integrating Java and Microsoft .NET by Jon Jagger, Content Master Ltd. Intel Corp. The right techniques... |
![]() | Intel Itanium Processor Family reference guide: IA-32 Execution Layer The Intel Itanium processor family has been architected to provide ind... |
![]() | OOP Demystified: A Self-Teaching Guide, Chapter 8: Real World Modeling by Jim Keogh and Mario Giannini. McGraw-Hill/Osborne Books. Theory ... |
![]() | The quick & dirty .NET guide to C#/VB OOP by Dimitrios Markatos, independent .NET architect. Everyone, I'm su... |
![]() | Solaris DTrace How To Guide Introduction to DTrace DTrace is a comprehensive dynamic traci... |
![]()
Related Jobs:

