Home
 Swing Technology
 GUI Features
 Source code
 Enhancements
 Source code

Files:

There are three main files in MengGame project:

MengGame.java

MengGame.java contains the class that creates the MenuBar, TabbedPanels with two instances of TicTacToe class, one with simple mode and the other with fancy mode.

TicTacToe.java

TicTacToe class implements the game TicTacToe in two different modes, simple and fancy. The Simple mode demonstrates basic SWING GUI components such as menubar, toolbar, buttons, labels, etc. The Fancy TicTacToe demonstrates additional features such as Chaning Look and Feel, changing game options, adding rollover icons, floatable toolbars, etc.

HTMLPanel.java

HTMLPanel contains methods and classes that is needed to display HTML files in a java application. The HTMLPanel is downloaded from Sun's SWING connection website.

Bugs Found and Difficulties with Swing:

Since SWING is part of JDK 1.2 Beta, there are several bugs found during this project.

  • When chaning look and feel with UIManager call, the toolbar got displaced to the end of the panel instead of staying at the same location of the panel.
  • The HTML panel does not work very well with real sites such as "http://www.cnn.com" Some of the content were not loaded properly. Background colors were not perserved when loading HTML pages.
  • Although SWING is a tremendous improvement over AWT, the layout manager is still very different to sort out. Some layout manager can only be used once in a chain of layouts, such as BoxLayout.