Using em’s as a unit of measure

Doing measurements in CSS? Maybe consider using em’s as a measure of unit instead of pixels… So all units are related to a pixel size, not a specific pixel measure…

The Wikipedia article has some good notes..

Inserting tags in HEAD section of a Drupal page

The “hook_html_head_alter()” can let you add tags to the HEAD section of a Drupal page. Despite some of the comments, I found that if you need to put it into a module in Drupal 7, you do need to name the hook after the module’s name, instead of just “template_”….

If you want to build tags… the Drupal way :-P… try the function theme_html_tag().

I found this was useful for a module I was writing… stay tuned people :-).

Adding sorting to a JTable

sorter for JTable

To add buttons to a JTable’s headers so that when you click on the headers the JTable is sorted in those particular fields:

JTable table = new JTable();

This is also helpful as the underlying TableModel is not altered. But to use selected cells one needs to use the following commands:

//for column indices

//for row indices

Note that one can also extend off “DefaultTableModel” and add other helper functions to the table model such as row counts, column counts etc. Although do not include presentation layer concepts like “new entry rows” in the Table Model: these should be done in a separate JTable.

Including a CSS file in another CSS file

Use the line “@import url(file.css);”.

Apparently this needs to be the first line in a CSS file. Don’t forget the final semi-colon like I did :/…

Thanks Stack Overflow!