| I l @ ve RuBoard |
Summary
In this chapter, you saw how Microsoft's implementation of J# includes Java language and JDK 1.1.4 functionality while being flexible enough to take advantage of the features of .NET. In particular, you saw how the J# compiler allows you to write Java-language code that can
This chapter also presented a brief comparison between J2EE (the framework often used for building enterprise applications in Java) and .NET. It showed how .NET addresses the requirements of enterprise applications. In later chapters, you'll learn about how to implement the individual elements of an enterprise application using J# with .NET. |
| I l @ ve RuBoard |
| I l @ ve RuBoard |
Chapter 4. Graphical
|
| I l @ ve RuBoard |
| I l @ ve RuBoard |
Desktop GUIs
Despite all the excitement about Microsoft ASP.NET and Web services, writing desktop GUI applications is what many of us are really interested in. If you've developed applications
But before we start looking at GUI development using the.NET Framework, let's take a step back and ask why you'd want to develop applications specifically for Windows. We can answer that question by first looking at how GUIs can be created using Java. Revisiting Java GUI Development
In a
At run time, the AWT libraries map AWT forms and widgets onto the structures used by the underlying platform. However, working with an abstract model poses some disadvantages. The most significant of these are
Figure 4-1 shows a simple text editor application that was developed using AWT running under Windows XP. The AWT implementation under Windows makes the application appear as similar to a native Windows application as possible. Figure 4-1. An AWT editor application running under Windows XP
The AWT will present the same application running on a different operating system using that operating system's look and feel. For example, Figure 4-2 shows the editor application running using the Enlightenment Window Manager under Linux. (The Java class file was
Figure 4-2. The AWT editor application running under Linux
Lack of control over the presentation style was a major factor that led to the creation of the Swing libraries. Unlike the AWT, Swing applications can be configured to always have the same look and feel regardless of the underlying operating system. This is achieved using the Pluggable Look and Feel (PLAF) feature of the Swing
Figure 4-3. The Swing editor application running under Windows XP, using the Metal PLAF scheme
The Swing libraries also simplify many of the day-to-day
Today, some Java developers use Swing, and others use the AWT. The actual choice of library is
One issue not directly addressed by Swing is speed. A benefit of using the .NET implementation of the AWT is that it targets only the Windows platform and is less
Note If you're porting a J++ application to .NET, the assembly vjswfc.dll supplied with J# contains a .NET implementation of the WFC classes. If you're developing an application specifically to run under Windows from scratch using Visual J# .NET, you should consider using the Windows Forms library. This library was written and optimized for Windows. The model used is different from that of the AWT or WFC but is arguably more intuitive. And because it is a native .NET library, it is faster still than the Microsoft implementation of the AWT and WFC. The Windows Forms LibraryThe Windows Forms library comprises a set of classes and other types located in the System.Windows.Forms namespace. The Form class represents a window or dialog box, and many of the other classes implement the various controls (such as ListBox , DataGrid , and Label ) that you can place on a form.
Unlike some earlier Windows GUI development tools such as Visual Basic 6.0, forms and controls are
|
| I l @ ve RuBoard |