3.9.6 - Applet Frame - JdlAppletFrame

John W. Campbell

3.9.6.1 Introduction

This class provides an applet based framed panel.

Class, fields, constructor and methods:

Class Details
Accessible Fields
Constructor
Set Framed Panel Resources
Overriden Superclass Methods

3.9.6.2 Class Details

Package:
Jdl.JdlView;
Class name:
JdlAppletFrame
Class definition:
public class JdlAppletFrame
Extends:
JPanel
Implements:
none
Actions:
none

3.9.6.3 Accessible Fields

The following accessible fields have been defined:

public final static int SOLID_FRAME
Frame type option: solid.
public final static int RAISED_FRAME
Frame type option: raised.
public final static int INSET_FRAME
Frame type option: inset.
public final static int ETCHED_OUT_FRAME
Frame type option: etched out.
public final static int ETCHED_IN_FRAME
Frame type option: etched in.
static final long serialVersionUID

3.9.6.4 Constructor

3.9.6.4.1 Introduction

A single constructor is available.

Constructor:

Standard constructor

3.9.6.4.2 Standard constructor

Constructs an applet frame with a given size and frame colours.

Constructor Definition:
public JdlAppletFrame (int w, int h, Color fill, Color brdr, Color brdr_brighter, Color brdr_darker)
Parameters List:
w
The required framed panel width (including the border).
h
The required frame height (including the border).
fill
The panel fill colour.
brdr
The frame border colour.
brdr_brighter
A brighter version of the frame border colour.
brdr_darker
A darker version of the frame border colour.

3.9.6.5 Set Framed Panel Resources

3.9.6.5.1 Introduction

This section has methods to set or reset the framed panel resources including the required border parameters and the panel size.

Methods:

Set border thickness - setBorderThickness
Set border type - setBorderType
Set fill colour - setFillColor
Set panel height - setPanelHeight
Set panel width - setPanelWidth

3.9.6.5.2 Set border thickness - setBorderThickness

This method sets the border thickness resource.

Method Definition:
public void setBorderThickness (int border)
Parameters List:
thickness
This is the required border thickness in pixels. (default = 4).

3.9.6.5.3 Set border type - setBorderType

This method sets the border type resource.

Method Definition:
public void setBorderType (int type)
Parameters List:
type
Border type flag:
= 0, solid
= 1, raised
= 2, inset (the default)
= 3, etched out
= 4, etched in
(May use the variables SOLID_FRAME, RAISED_FRAME, INSET_FRAME, ETCHED_OUT_FRAME, ETCHED_IN_FRAME)

3.9.6.5.4 Set fill colour - setFillColor

This method sets the fill colour resource.

Method Definition:
public void setFillColor (Color fill_color)
Parameters List:
colr
The fill colour for the panel. If null (the default), then the background colour will be used.

3.9.6.5.5 Set panel height - setPanelHeight

This method sets the panel height resource.

Method Definition:
public void setPanelHeight (int height)
Parameters List:
height
The required panel height in pixels.

3.9.6.5.6 Set panel width - setPanelWidth

This method sets the panel width resource.

Method Definition:
public void setPanelWidth (int width)
Parameters List:
width
The required panel width in pixels.

3.9.6.6 Overriden Superclass Methods

3.9.6.6.1 Introduction

This section contains methods which override the corresponding superclass methods. These are basically standard for JdlView objects and comprise methods to set background and foreground colours and to get the minimum and preferred sizes for the object. (The paintComponent method is also over-ridden but is not normally called by the user).

Methods:

Set background - setBackground
Set foreground - setForeground
Get minimum size - getMinimumSize
Get preferred size - getPreferredSize
Set size - setSize

3.9.6.6.2 Set background - setBackground

This method sets the background colour resource.

Method Definition:
public void setBackground (Color c)
Parameters List:
c
The color to become this object's background color.

3.9.6.6.3 Set foreground - setForeground

This method sets the foreground colour resource.

Method Definition:
public void setForeground (Color c)
Parameters List:
c
The color to become this object's foreground color.

3.9.6.6.4 Get minimum size - getMinimumSize

This method returns the minimum size of the component.

Method Definition:
public Dimension getMinimumSize()
Parameters List:
none

3.9.6.6.5 Get preferred size - getPreferredSize

This method returns the preferred size of the component.

Method Definition:
public Dimension getPreferredSize()
Parameters List:
none

3.9.6.6.6 Set size - setSize

This method sets (resets) the required frame panel size.

Method Definition:
public void setSize(int w, int h)
Parameters List:
w
The required framed panel width (including the border).
h
The required frame height (including the border).

⇑ Up 3   ⇑ Up 2   ⇑ Up 1   ⇑ Top of this