Prev: bug in java.net.Socket??
Next: Call for Papers: The 2010 International Conference of Information Security and Internet Engineering (ICISIE 2010)
From: Daniel Luis dos Santos on 9 Feb 2010 19:03 Hello, I have a JTable with some columns. I am setting the widths of some columns to some preferred size. One column has no header text, and the cells have a check box. I want the cells of that column to have the least amount of extra width around the check boxes. I set the preferred size on the table column to be 1 or 0 and the there is always space around the check boxes. Is it possible to remove that extra space. I have the same problem on some other columns. Those columns on which I am setting the width, I am also setting them not to be resizable. But when I resize the window (and thus the table), the non-resizable columns also resize proportionally. Can I tell them to be fixed size no matter what width the table has ? Thanks.
From: John B. Matthews on 10 Feb 2010 10:05
In article <4b71f7ca$0$1900$a729d347(a)news.telepac.pt>, Daniel Luis dos Santos <daniel.dlds(a)gmail.com> wrote: > I have a JTable with some columns. I am setting the widths of some > columns to some preferred size. One column has no header text, and > the cells have a check box. I want the cells of that column to have > the least amount of extra width around the check boxes. I set the > preferred size on the table column to be 1 or 0 and the there is > always space around the check boxes. Is it possible to remove that > extra space. I have the same problem on some other columns. > > Those columns on which I am setting the width, I am also setting them > not to be resizable. But when I resize the window (and thus the > table), the non-resizable columns also resize proportionally. Can I > tell them to be fixed size no matter what width the table has ? You could override the check box's paintBorder() method or change the borderPainted property. <http://java.sun.com/javase/6/docs/api/javax/swing/AbstractButton.html> -- John B. Matthews trashgod at gmail dot com <http://sites.google.com/site/drjohnbmatthews> |