Appendix F. Java to .NET API Reference

When viewed as a whole, the Java and .NET class libraries provide comparable functionality. However, as this book has shown, the implementation specifics and structure can often be quite different. This appendix provides a quick reference to Java-to-.NET class library functionality.

We structure the cross-reference at the class level; we exclude interfaces unless they’re essential to understanding the relationship between Java and the Microsoft .NET Framework. Each commonly used Java type from the major packages is listed. We map each Java type to one or more .NET types that provide the same or similar functionality.

The java.awt Package

The .NET Windows Forms system provides a smaller class set than the Abstract Window Toolkit (AWT) for constructing client applications. See Chapter 18, for more information about the Windows Forms system. The mapping between the Java java.awt package and the corresponding .NET classes is provided in Table F-1.

Table F-1. The Java to .NET Mapping for the java.awt Package

Java

.NET

AlphaComposite

N/A

AWTEvent

System.EventArgs

AWTEventMulticaster

N/A

AWTKeyStroke

System.Windows.Forms.KeyPressEventArgs

AWTPermission

System.Security.Permissions.UIPermission

BasicStroke

System.Drawing.Pen

BorderLayout

N/A

BufferCapabilities

N/A

Button

System.Windows.Forms.Button

Canvas

System.Windows.Forms.Control

CardLayout

N/A

Checkbox

System.Windows.Forms.RadioButton

CheckboxGroup

N/A (All RadioButton objects in a .NET control are mutually exclusive within a control.)

CheckboxMenuItem

N/A

Choice

System.Windows.Forms.ComboBox

Color

System.Drawing.Color

Component

System.Windows.Forms.Control

ComponentOrientation

N/A

Container

System.Windows.Forms.Control

Cursor

System.Windows.Forms.Cursor

Dialog

System.Windows.Forms.CommonDialog

Dimension

System.Drawing.Size

DisplayMode

N/A

Event

System.EventArgs

EventQueue

N/A

FileDialog

System.Windows.Forms.FileDialog

 

System.Windows.Forms.OpenFileDialog

 

System.Windows.Forms.SaveFileDialog

FlowLayout

N/A

FocusTraversalPolicy

N/A

Font

System.Drawing.Font

FontMetrics

N/A

Frame

System.Windows.Forms.Form

GradientPaint

System.Drawing.Drawing2D.LinearGradientBrush

Graphics

System.Drawing.Graphics

Graphics2D

System.Drawing.Graphics

GraphicsConfigTemplate

N/A

GraphicsConfiguration

N/A

GraphicsDevice

N/A

GraphicsEnvironment

N/A

GridBagConstraints

N/A

GridBagLayout

N/A

GridLayout

N/A

Image

System.Drawing.Image

ImageCapabilities

N/A

Insets

N/A

JobAttributes

System.Drawing.Printing.PageSettings

System.Drawing.Printing.PrinterSettings

KeyboardFocusManager

N/A

Label

System.Windows.Forms.Label

List

System.Windows.Forms.ListBox

MediaTracker

N/A

Menu

System.Windows.Forms.MainMenu

MenuBar

N/A

MenuComponent

N/A

MenuItem

System.Windows.Forms.MenuItem

MenuShortcut

N/A

PageAttributes

System.Drawing.Printing.PageSettings

Panel

System.Windows.Forms.Panel

Point

System.Drawing.Point

Polygon

N/A

PopupMenu

System.Windows.Forms.ContextMenu

PrintJob

System.Drawing.Printing.PrintDocument

Rectangle

System.Drawing.Rectangle

RenderingHints

N/A

RenderingHints.Key

N/A

Robot

N/A

Scrollbar

System.Windows.Forms.HScrollBar

System.Windows.Forms.VScrollBar

ScrollPane

System.Windows.Forms.Panel

ScrollPaneAdjustable

N/A

SystemColor

N/A

TextArea

System.Windows.Forms.TextBox

System.Windows.Forms.RichTextBox

TextComponent

N/A

TextField

System.Windows.Forms.TextBox

TexturePaint

System.Drawing.TextureBrush

Toolkit

N/A

Window

N/A

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset