I'm learning Java and experimenting with jTable to display a hotel room booking system. I just have a few questions:

  • Can I put a newline in the column header? I've tried the following but it was ignored. I'd like this so I can reduce the width of each column.
    mtblCalendar.addColumn( Sat\n2" );
  • Can I set a font size and or width for each column (I'm aiming to display a month or twos data across the screen). There is a tblCalendar.setRowHeight() function but I can't find a setColWidth() function. Or am I not looking hard enough?
  • Is it possible to print text across multiple cells ie row 1 cols 3 to 10 should show "Smith". At the moment I'm just using colour to denote if a room is booked but it would be nice to show the booking name. I can obviously print inside a single cell (a day in this system) but if I want the booking name to appear across a group of cells is that possible? I don't mind if the name gets truncated.
  • Is there a way to make the table scrollable so I could have the whole year available as the user moves the mouse to the edge of the screen.
  • I'm quite happy with jTable so far but would I be better with another class? I'll be trying to add clickable events and dragging and dropping of bookings, popup info etc.