Other examples

PGUI: Other examples

This page include some additional example programs. The examples are related to different topics, there is only one version of each example.

GraphicsDemo for Java

GraphicsDemo demonstrates different aspects of graphics production with Java 2d Graphics. It includes demontsration of simple shapes, paths, transformations and composites.

Example directory (zipped)
GraphicsDemo.java

 

AnalogClock for Java

This example draws an analog clock showing UTC median time. It uses a separate thread for updating. The hands on the clock are drawn with rotation transformation.

Example directory (zipped)
AnalogClock.java

 

BouncingBall for Java

This example moves a bouncing and rotating ball inside the application window. Use arrowkeys to change the direction, 'S' to stop and 'R' to randomize.

Example directory (zipped)
BouncingBall.java

 

BinaryTree for Java

This example draw a binary search tree into a frame window. Press "A" to add new nodes.

Example directory (zipped)
BinaryTree.java
BinaryTreeView.java

 

LayoutDemo for Java

Example application for demonstrating user interface layouts with specialized layout managers.

Example directory (zipped)

LayoutDemo.java
ColoredLabel.java
TableLayout.java

 

Scrollable diagram for Java

Here we have a new version of the Diagram-example with a scrollable diagram view. In addition, we have selection and deletion of nodes. The scrollable view includes rulers in top and left sides.

Example directory (zipped)

DiagramApp.java
Diagram.java
DiagramView.java
PointModel.java
Ruler.java

 

SumBeast for Java

This is an example program demonstrating the use of javax.swing.JTable -component with a customized data model.

Example directory (zipped)

SumBeast.java
SumTableModel.java
SumTableCellRenderer.java

 

TreeDemo for Java

This example demonstrates the component javax.swing.JTree.

Example directory (zipped)

TreeDemo.java

 

TreeDemo with MFC

The example uses the view classes of MFC: CTreeView and CEditView. These a placed into a CSplitterWnd. The application has been created with AppWizard. The style of the application is "Explorer-style". The view types have been defined in step 6.

Example directory (zipped)

HTML code

TreeDemo.exe

 

See also: