Vinaya,

thanks for your response. The problem here is that I dont know
the value of X_AXIS and Y_AXIS because my table is in applet
and applet is configured to take 100% space of browser. So I 
cannot find out in advance what is the dimension that I am working
with.

- peter


--- Vinaya Kumar T <[EMAIL PROTECTED]> wrote:
> Try this,
> 
> initially set the columnwidth and then column resizing will
> work gr8.
> 
> here colSize array will be for 4 columns will
> 25%,25%,25%,25%
> 
> 
> 
>    /**
>      *  Sets the tableSize attribute of the MasterTable
> object
>      *
>      * @param  X_AXIS  width
>      * @param  Y_AXIS  height
>      */
>     public void setTableSize(int X_AXIS, int Y_AXIS){
>         table.setPreferredScrollableViewportSize(new
> Dimension(X_AXIS, Y_AXIS));
> 
>         int[] columnWidth = new int[colSize.length];
> 
>         for (int i = 0; i < colSize.length; i++){
>             columnWidth[i] = X_AXIS * colSize[i] / 100;
>         }
> 
>         setColWidth(columnWidth);
>         revalidate();
>         repaint();
>     }
> 
> Hope this helps
> Regards
> vinaya
> 
> 
> Peter Peterson wrote:
> > 
> > Hi All,
> > 
> > I have a question on JTable about column resizing.
> > 
> > When the table is launched, I want it to take entire space that
> > is available in JScrollPane and divide it evenly among all columns.
> > ( this part is working fine because I have setup resize mode to
> > RESIZE_ALL ) But when user tries to resize one column, only that
> > column should get resize and rest should remain at same size. I
> tried
> > all resize policies but none supports this behaviour. MS Excel has
> > this type of behaviour.
> > 
> > any ideas ?
> > 
> > thanks
> > Peter
> > 
> > __________________________________________________
> > Do you Yahoo!?
> > Y! Web Hosting - Let the expert host your web site
> > http://webhosting.yahoo.com/
> > _______________________________________________
> > Swing mailing list
> > [EMAIL PROTECTED]
> > http://eos.dk/mailman/listinfo/swing
> 
> -- 
> +---------------------------------------------------------------+
> |  HP OpenView ECS Solutions Expertise
> Centre                   |
> +-------------------------------+-------------------------------+
> |  Vinaya Kumar Thimmappa,      |  Phone :
> 2052343              |
> |  Hewlett Packard ISO Pvt Ltd, |  Email :
> [EMAIL PROTECTED]      |
> |  #3, Sterling Square,         |  Telnet:
> 847-2343             |
> |  Lavelle Rd., Bangalore,     
> |                               |
> |  Karnataka, India, 560001.   
> |                               |
> +-------------------------------+-------------------------------+
> 
> "The secret to finding the answer lies in asking the right 
> question. If you ask the right question, the answer takes 
> care of itself."


__________________________________________________
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/
_______________________________________________
Swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/swing

Reply via email to