home
products
education
support
partners
company

introduction

get started

articles

manual

tutorials

reference docs

case studies

knowledge base

goodies

screenshots

demos

echoes

Carousel zone


SourceForge.net Logo

home

forums

downloads

bugs

mailing list
XUI Zone - goodies

number of ratings 2
average rating 4.50

An 'about' dialog

When you build an application its often useful to include information about the author, build version and whatever else might be appropriate. This simple about dialog can be copied to your project and customised to include whatever information you think might be appropriate.

First off we'll have a look at the page which will open the dialog and it's XML can be seen in Listing 1

Listing 1 - Welcome page


  
  
  
  
    
  
  
  
  

The Welcome page creates a button and a help - about menu item each of which call the openAbout method shown in Listing 2

Listing 2 - The Welcome class

package net.xoetrope.about;

import java.awt.event.*;
import net.xoetrope.xui.*;
import net.xoetrope.swing.*;


public class Welcome extends XPage
{

  public void openAbout()
  {
  XDialog dlg = ( XDialog )pageMgr.loadPage( "about" );
  dlg.pack();
  dlg.showDialog( this );
  }

}
                

Now the about page which is referenced can be created as in Listing 3

Listing 3 - The about page declaration


  
    
    
  
  
  

                

This pagepage uses the net.xoetrope.swing.XDialog class but the AWT version or a custom class could just as easily be used. The styles being assigned to the components are declared in the styles.xml file as shown in Listing 4

Listing 4 - The styles file


  
  
  
  
  

                

This style fragment can be copied into your existing project styles file. The company and product version information is stored in a datasources file as shown in Listing 5 which is loaded when the project is started.

Listing 5 - The about dialog information


  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
               

Now the dialog XML declaration can be modified to bind to these data nodes as shown in Listing 6

Listing 6 - The dialog data bindings


  ...
  
   
   
   
   
   
   
   
   
   
   
   
   
  

                

You can copy these files and the images to your project and customise the dialog as you need. The dialog, when presented, will display as shown below.


Files

You need to be logged in to download the files for this article

comments


If you were logged in you could rate this article or add a comment.