Google

Saturday, May 24, 2008

DarkGDK for Visual C++2008 Express

Dark GDK

Friday, May 23, 2008

Panda3D Free Game Library

Free 3D Game Library for C++

Inticas 006: Created Classroom class

I'm re-evaluating whether or not to use XML to store data. XML introduces an element of complexity to the coding. I want to keep it simple.

I'm considering the possibility of storing data using a pre-defined class, called Classroom:

public class Classroom
{
private String classroomname;
private String mon[] = new String[24];
private String tues[] = new String[24];
private String wed[] = new String[24];
private String thurs[] = new String[24];
private String fri[] = new String[24];
private String sat[] = new String[24];

public void setMonSlot(String name, int time)
{
mon[time] = name;
}
public void setTuesSlot(String name, int time)
{
tues[time] = name;
}
public void setWedSlot(String name, int time)
{
wed[time] = name;
}
public void setThursSlot(String name, int time)
{
thurs[time] = name;
}
public void setFriSlot(String name, int time)
{
fri[time] = name;
}
public void setSatSlot(String name, int time)
{
sat[time] = name;
}
//////////////////////////////////////////

public String getMonSlot(int time)
{
return mon[time];
}
public String getTuesSlot(int time)
{
return tues[time];
}
public String getWedSlot(int time)
{
return wed[time];
}
public String getThursSlot(int time)
{
return thurs[time];
}
public String getFriSlot(int time)
{
return fri[time];
}
public String getSatSlot(int time)
{
return sat[time];
}


}



It will be stored in files as Classroom objects.

Wednesday, May 21, 2008

Inticas 005: Added Table

Added JTable:


I am now able to programmatically read each cell and also write to each cell.
For example, to set a value at cell 5, 5:


mytable.setValueAt("cc",5,5);


where mytable is a JTable object

To read a value from cell 5,5 :

String myvalue = (String)mytable.getValueAt(5, 5);


To be done:
Next I will implement code to save the contents of each cell in this xml format:






where PC, JM and SK are example Lecturer's names.

I will also need to implement code to enable user to populate the JTable with any selected xml file of the above format.

Tutorial on JTable

Inticas 004 : Added Xml Writer Demo

Below is a screen shot of the Xml Writer Demo application:



The new frame demonstrates how to an xml file called book.xml is created and saved.
The book.xml is saved in the root folder of the inticas project. And the contents is also automatically displayed in the TextArea of the form.

Monday, May 19, 2008

How to Create MDI App in Netbeans

YouTube - How fast we create MDI forms with Netbeans


Below is Inticas003:



It is an MDI Implementation of the previous Inticas. The two applications :

1. File Chooser (which allows you to select any text file to open and view)
2. Xml Dom Demo (which opens the file 'employees.xml' and displays its contents)

is now implemented within two different Frames (Forms).

The Xml Dom Demo now displays the exmployees.xml content within the Frame (form) instead of at the bottom of the Netbeans IDE.

The steps for building Inticas003 follows.

1. Create a new project.
Select a Java Desktop Application

2. Add a Desktop Pane from the Swing Containers Pallette

3. Add a new Menu to the Menu Bar and call it Applications

4. Add two Menu Items fo the above new Menu Bar called
File Chooser Demo
Xml Demo

5. Add two new JInternalFrames to the Project called:
FileChooserFrame
XmlDemoFrame

6. To each of the above new Frames in 5 above, add the respective Menu Bars and
JTextArea objects

7. Add code to implement the menuitems in 6 above

8. Go back to the MainFrame called InticasView.java (this is the parent Frame)
and implement the code for the FileChooser menuitem and XmlDemo menuitem.

9. To enable the two new frames to be called, u need to add them to the Desktop Pane
created in Step 2 above:

private void fileChooseMenuItemActionPerformed(java.awt.event.ActionEvent evt) {
FileChooserFrame fc = new FileChooserFrame();
desktop.add(fc);
fc.setVisible(true);

}

private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {
XmlDomFrame xf = new XmlDomFrame();
desktop.add(xf);
xf.setVisible(true);
}


desktop is the name of the JDesktopPane

Note that if you do not add them to the JDesktopPane, the child windows will not be able to become the top focussed window when u click on them, and also will not be able to iconify (minimize).