Skip to main content

Java awt Package

The Java AWT (Abstract Window Toolkit) package is a collection of classes and interfaces that provide a set of tools for creating graphical user interfaces (GUIs) in Java. The AWT package was introduced in JDK 1.0 and is still included in the latest Java versions.

Some of the key classes and interfaces in the AWT package include:

  • Component: This is the base class for all AWT components, such as buttons, labels, text fields, and so on. It provides methods for handling events, painting the component, and managing its position and size.

  • Container: This is a subclass of Component that can hold other components. Examples of containers include panels, frames, and dialogs.

  • LayoutManager: This is an interface that defines how components should be arranged within a container. There are several built-in layout managers in the AWT package, such as BorderLayout, GridLayout, and FlowLayout.

  • Graphics: This is a class that provides methods for drawing shapes, text, and images on a component. It is used in conjunction with the paint() method of a component.

  • Event: This is a class that represents a user or system event, such as a mouse click, a key press, or a window resize. There are several subclasses of Event that correspond to different types of events.

  • Listener: This is an interface that defines methods for handling events. There are several built-in listener interfaces in the AWT package, such as ActionListener, MouseListener, and KeyListener.

The AWT package is useful for creating simple GUIs, but it has some limitations, such as a limited set of components and layout managers. For more advanced GUIs, it is recommended to use the newer Swing framework, which is built on top of the AWT package and provides a wider range of components and layout managers.

Where is Java awt package?

awt package are exist in java.awt package.

What is included in Java awt?

There is file directory of java.awt package.

  •  color
  •  datatransfer
  •  dnd
  •  doc-files
  •  event
  •  font
  •  geom
  •  im
  •  image
  •  peer
  •  print
  • AWTError.java
  • AWTEvent.java
  • AWTEventMulticaster.java
  • AWTException.java
  • AWTKeyStroke.java
  • AWTPermission.java
  • ActiveEvent.java
  • Adjustable.java
  • AlphaComposite.java
  • AttributeValue.java
  • BasicStroke.java
  • BorderLayout.java
  • BufferCapabilities.java
  • Button.java
  • Canvas.java
  • CardLayout.java
  • Checkbox.java
  • CheckboxGroup.java
  • CheckboxMenuItem.java
  • Choice.java
  • Color.java
  • ColorPaintContext.java
  • Component.java
  • ComponentOrientation.java
  • Composite.java
  • CompositeContext.java
  • Conditional.java
  • Container.java
  • ContainerOrderFocusTraversalPolicy.java
  • Cursor.java
  • DefaultFocusTraversalPolicy.java
  • DefaultKeyboardFocusManager.java
  • Desktop.java
  • Dialog.java
  • Dimension.java
  • DisplayMode.java
  • Event.java
  • EventDispatchThread.java
  • EventFilter.java
  • EventQueue.java
  • FileDialog.java
  • FlowLayout.java
  • FocusTraversalPolicy.java
  • Font.java
  • FontFormatException.java
  • FontMetrics.java
  • Frame.java
  • GradientPaint.java
  • GradientPaintContext.java
  • Graphics.java
  • Graphics2D.java
  • GraphicsCallback.java
  • GraphicsConfigTemplate.java
  • GraphicsConfiguration.java
  • GraphicsDevice.java
  • GraphicsEnvironment.java
  • GridBagConstraints.java
  • GridBagLayout.java
  • GridBagLayoutInfo.java
  • GridLayout.java
  • HeadlessException.java
  • IllegalComponentStateException.java
  • Image.java
  • ImageCapabilities.java
  • Insets.java
  • ItemSelectable.java
  • JobAttributes.java
  • KeyEventDispatcher.java
  • KeyEventPostProcessor.java
  • KeyboardFocusManager.java
  • Label.java
  • LayoutManager.java
  • LayoutManager2.java
  • LinearGradientPaint.java
  • LinearGradientPaintContext.java
  • List.java
  • MediaTracker.java
  • Menu.java
  • MenuBar.java
  • MenuComponent.java
  • MenuContainer.java
  • MenuItem.java
  • MenuShortcut.java
  • ModalEventFilter.java
  • MouseInfo.java
  • MultipleGradientPaint.java
  • MultipleGradientPaintContext.java
  • PageAttributes.java
  • Paint.java
  • PaintContext.java
  • Panel.java
  • Point.java
  • PointerInfo.java
  • Polygon.java
  • PopupMenu.java
  • PrintGraphics.java
  • PrintJob.java
  • RadialGradientPaint.java
  • RadialGradientPaintContext.java
  • Rectangle.java
  • RenderingHints.java
  • Robot.java
  • ScrollPane.java
  • ScrollPaneAdjustable.java
  • Scrollbar.java
  • SecondaryLoop.java
  • SentEvent.java
  • SequencedEvent.java
  • Shape.java
  • SplashScreen.java
  • Stroke.java
  • SystemColor.java
  • SystemTray.java
  • TextArea.java
  • TextComponent.java
  • TextField.java
  • TexturePaint.java
  • TexturePaintContext.java
  • Toolkit.java
  • Transparency.java
  • TrayIcon.java
  • WaitDispatchSupport.java
  • Window.java




Comment

Please share your knowledge to improve code and content standard. Also submit your doubts, and test case. We improve by your feedback. We will try to resolve your query as soon as possible.

New Comment