GUI in 2Dimensions

Flexing with Swing

JTable row resizing using ..JxLayer

Posted by Pavan Kumar on September 16, 2010

A common usecase for a JTable is to  manually resize rows .  One  solution  googled was   Make JTable Resizable

It works fine with a couple of drawbacks..

  • If the CellEditor gets activated on mouseMove(as in my application) the mouse events will be consumed by the editor component , and the table mouseListeners(for  Dragging) will Not be notfied.
  • Working around the problem of rowSelection,when resizing ..needed the underlying table to be modified.



This seemed a perfect usecase for JxLayer

  • Get all MouseEvents from any component parented by the underlying Table.
  • Lock the UI on MouseMove & prevent the RowSelection in the table from changing(on mousePressed).

The class RowResizerUI extends LockableUI(from JxLayer) &  provides  row resizing for the underlying table.


Link to Src

Advertisements

2 Responses to “JTable row resizing using ..JxLayer”

  1. JOKe said

    it works good but there is a very very bad flicking for fonts..

    Windows 7, 64bit, with clear type on.
    As I see the clear type is on/off on/off every … 2 secounds or something like that
    which makes this unusable in real app.

  2. […] gets activated on mouseMove(as in my application) the mouse events will be consumed by… [full post] Pavan Kumar GUI in 2Dimensions guijavaswing 0 0 0 0 […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: