Portable GUIs improve application flexibility
AWT Java GUI Tutorial: Developers can create GUI applications using AWT that will run unchanged in Java on Unix and Visual J# .NET on Windows using the Microsoft Common Language Runtime (CLR).

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).

Subscribers who liked this article also read:
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:

JPEX developer for FX Options #2248117 - NY - New York - Ajilon Consulting
Title : JPEX developer for FX Options Posted : 08-02-2005 ...
J2EE/Web developer #139 - IL - Schaumburg - InstallShield Software Corp.
J2EE/Web developer In this position you will play a key role on o...
Help Desk Task Manager #R-280-05 - DC - Washington - McDonald Bradley, Inc.
R-280-05 Help Desk Task Manager Sep 20, 2005 Washington,District of ...
Java Developer / Lead / Architect - NY - New York - Cybernet Software Systems
Desired Technical Profile: Excellent hands on experience with Java ...
Analyst/Programmer #STRSI/173/RV - UK - Abingdon - SunGard
Reference No.: STRSI/173/RV Opening Date: September 7, 2005 Job Ti...
.Net Programmer Analyst - NJ - Mahwah - Arco, Inc.
JOB DESCRIPTION: Work through full development life cycle of an In...
JPEX developer for FX Options #2389817 - NY - New York - Ajilon
Description : Position Description: Requirement to provide eTrading ...
Documentum 4i / 5 Developers / Architects - US - New Jersey - Marlabs Inc.
DOCUMENTUM 4i / 5 DEVELOPERS / ARCHITECTS Location: NJ/NY/PA/CA R...
JPEX developer for FX Options #2248116 - NY - New York - Ajilon Consulting
Title : JPEX developer for FX Options Posted : 08-02-2005 ...
Senior Technical Support Engineer #SLH108 - CA - Menlo Park - Kana
Senior Technical Support Engineer (SLH108) Position available : Menlo...