SwingWiKi : Column spanning with JTable

howto:column_spanning [SwingWiki]

Column spanning with JTable

In an equaly distributed table, a single cell is an intersection of a single row and a single column. However, for design purposes, it is often convenient to use group table column headers (above a sequence of cells), and sometimes several vertical cells are containing the same data, so they can be merged into one single large cell. Word processing and spreadsheet software usually uses terms like “merged cells” for joined cells, and in HTML terminology, merged cells are often denoted by column-spanning and row-spanning. We will use HTML terminology here, since it is more precise and takes into account a difference betweek horizontal (column) and vertical (row) merging.

Of Detachable Root Panes and Desktop Hopping

Laird Nelson’s Blog: June 2005 Archive

Background

Different people have different ideas on how an application should work when it can open many different documents of many different types at the same time, and, most importantly, when its value derives from being able to see those documents side-by-side (ruling out, for example, a JTabbedPane-based interface). Some like a true, old-school MDI feel; others like there to be multiple external windows, à la Microsoft Word. My current project’s customers are evenly divided on the subject.

To make everyone happy, I decided to start with a JDesktopPane-based MDI core. Then I added the ability to detach the JInternalFrames from the desktop pane and open them up as external windows—i.e. to make the window hop off the application desktop and onto the user desktop (and, potentially, back again). This comparatively small insight has led to a surprisingly intuitive way of managing the application’s information. When you just want to look at one thing and have it be your central focus, it is easier to have it be in an external window. On the other hand, when you want to look at two things side by side, it seems easier to grasp their relationship to each other and to their containing application if they’re presented inside an MDI.

JXTable highlighter issue with custom renderer

java.net Forums : JXTable highlighter issue with custom …

I am using JPanel as renderer with JXTable (with 2 textFIelds inside Panel)
but problem is .. this cell does not take background color as alternate highlighter.

i have following code written.

if(isSelected){
textField.setBackground(table.getSelectionBackground());
}else{
textField.setBackground(table.getBackground());
}

how do i get highlighter with panel as cellRenderer