java gui basics l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
JAVA GUI BASICS PowerPoint Presentation
Download Presentation
JAVA GUI BASICS

Loading in 2 Seconds...

play fullscreen
1 / 6

JAVA GUI BASICS - PowerPoint PPT Presentation


  • 114 Views
  • Uploaded on

JAVA GUI BASICS. Basic Java GUI Components java.awt.Component , java.awt.Container , javax.swing.JComponent , … Event handling packages java.awt.event and javax.swing.event Creating UI layouts using and creating layout managers java.awt.LayoutManager and java.awt.LayoutManager2

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'JAVA GUI BASICS' - lynsey


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
java gui basics
JAVA GUI BASICS
  • Basic Java GUI Components
    • java.awt.Component, java.awt.Container, javax.swing.JComponent, …
  • Event handling
    • packages java.awt.event and javax.swing.event
  • Creating UI layouts
    • using and creating layout managers
    • java.awt.LayoutManager and java.awt.LayoutManager2
  • Using resources
    • using resource bundles for different locales
    • java.util.ResourceBundle
components
COMPONENTS

Component

addMouseListener()addKeyListener()...getBounds()getComponentAt()...void paint(Graphics)

AWT

Swing

Container

Button

add(Component)remove(Component)setLayoutManager()...

JComponent

setBorder()setUI()...

Canvas

Label

...

Panel

Box

Window

...

Swing Components

windows frames
WINDOWS & FRAMES

Container

Window

add(Component)remove(Component)setLayoutManager()...

addWindowListener()pack()show()...

MenuContainer

Frame

Dialog

JWindow

setIconImage()setMenuBar()setTitle()...

setModal()setTitle()...

AWT

Swing

JFrame

JDialog

contentPane

contentPane

getContentPane()setJMenuBar()...

getContentPane()...

layout
LAYOUT

Container

LayoutManager

layoutManager

addLayoutComponent(name, component)removeLayoutComponent(component)preferredLayoutSizer()minimumLayoutSize()layoutContainer(container)

add(component)add(component, constraints)add(name, component)remove(Component)setLayoutManager()validate()doLayout()...

LayoutManager2

FlowLayout

GridLayout

addLayoutComponent(comp, constraints)invalidateLayout()maximumLayoutSize()...

...layoutManager.layoutContainer(this);...

BoxLayout

CardLayout

OverlayLayout

GridBagLayout

BorderLayout

events
EVENTS

Component

EventListener

listenerList

addMouseListener(listener)removeMouseListener(listener)processMouseEvent(mouseEvent)...

MouseListener

MouseMotionListener

mouseClicked(mouseEvent)mousePressed(mouseEvent)mouseReleased(mouseEvent)mouseEntered(mouseEvent)mouseExited(mouseEvent)

KeyListener

ActionListener

mouseEvent( MOUSE_PRESSED, 123, 456)

MouseEvent

getX()getY()getClickCount()

events cont d
EVENTS cont’d

AWTEvent

EventObject

getID()

getSource()

ComponentEvent

ActionEvent

other AWT events

many notification event types

getComponent()

InputEvent

FocusEvent

WindowEvent

getModifiers()getWhen()

ContainerEvent

PaintEvent

MouseEvent

KeyEvent

getX()getY()getClickCount()