The .NET Framework provides a small set of classes that compare to Java's AWT. Tables A.12 and A.13 show the classes of the java.awt and the java.awt.event packages, along with their C# equivalents.
Java | .NET |
---|---|
AWTEvent | System.EventArgs |
AWTKeyStroke | System.Windows.Forms.KeyPressEventArgs |
AWTPermission | System.Security.Permissions.UIPermission |
BasicStroke | System.Drawing.Pen |
Button | System.Windows.Forms.Button |
Canvas | System.Windows.Forms.Control |
Checkbox | System.Windows.Forms.RadioButton |
Choice | System.Windows.Forms.ComboBox |
Color | System.Drawing.Color |
Component | System.Windows.Forms.Control |
Container | System.Windows.Forms.Control |
Cursor | System.Windows.Forms.Cursor |
Dialog | System.Windows.Forms.CommonDialog |
Dimension | System.Drawing.Size |
Event | System.EventArgs |
FileDialog | System.Windows.Forms.FileDialog |
Font | System.Drawing.Font |
Frame | System.Windows.Forms.Form |
GradientPaint | System.Drawing.Drawing2D.LinearGradientBrush |
Graphics | System.Drawing.Graphics |
Graphics2D | System.Drawing.Graphics |
Image | System.Drawing.Image |
JobAttributes | System.Drawing.Printing.PageSettings |
Label | System.Windows.Forms.Label |
List | System.Windows.Forms.ListBox |
Menu | System.Windows.Forms.MainMenu |
MenuItem | System.Windows.Forms.MenuItem |
PageAttributes | System.Drawing.Printing.PageSettings |
Panel | System.Windows.Forms.Panel |
Point | System.Drawing.Point |
PopupMenu | System.Windows.Forms.ContextMenu |
PrintJob | System.Drawing.Printing.PrintDocument |
Rectangle | System.Drawing.Rectangle |
Scrollbar |
System.Windows.Forms.HscrollBar System.Windows.Forms.VscrollBar |
ScrollPane | System.Windows.Forms.Panel |
TextArea | System.Windows.Forms.TextBox |
TextField | System.Windows.Forms.TextBox |
TexturePaint | System.Drawing.TextureBrush |
Java | .NET |
---|---|
ActionEvent | System.EventArgs |
AdjustmentEvent | System.Windows.Forms.ScrollEventArgs |
ComponentEvent | System.EventArgs |
ContainerEvent | System.Windows.Forms.ControlEventArgs |
FocusEvent | System.EventArgs |
ItemEvent | System.EventArgs |
KeyEvent | System.Windows.Forms.KeyPressEventArgs |
MouseEvent | System.Windows.Forms.MouseEventArgs |
MouseWheelEvent | System.Windows.Forms.MouseEventArgs |
PaintEvent | System.Windows.Forms.PaintEventArgs |
TextEvent | System.EventArgs |
WindowEvent | System.EventArgs |
The .NET framework does not provide equivalents for the following Java packages: java.awt.color, java.awt.datatransfer, java.awt.dnd, java.awt.font, java.awt.geom, java.awt.im, java.awt.im.spi, java.awt.image, and java.awt.image.renderable.
Table A.14 shows the classes of the java.awt.print package.
Java | .NET |
---|---|
PageFormat | System.Drawing.Printing.PageSettings |
Paper | System.Drawing.Printing.PaperSize |
PrinterJob | System.Drawing.Printing.PrintDocument |
18.118.30.253