Porting Existing Java Applications

If you’ve spent time writing an application in Java, the last thing you want to do is to rewrite it using the .NET classes. In this section, we’ll look at how you can compile and run an AWT application under .NET. The code we’ll use is for a simple text editor. In this section, the code will use the AWT libraries.

The code for the application follows, in the class EditorFrame. We won’t walk you through how the AWT works (this is a book about .NET, after all), but to summarize, the EditorFrame constructor calls the initComponents method, which creates new instances of all the components used within the application. The bulk of this method builds the menu structure for the application. For each menu item instance, ...

Get Microsoft® Visual J#™ .NET (Core Reference) now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.