Meaningless Drivel is fun!*
The moose likes Swing / AWT / SWT and the fly likes JTable (Size and Colour) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable (Size and Colour)" Watch "JTable (Size and Colour)" New topic
Author

JTable (Size and Colour)

Jessie Tan
Greenhorn

Joined: Apr 17, 2004
Posts: 12
i place a JTable in Jframe... May i know how to set size for the JTable and as well as color??
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Depends on if you are using a LayoutManager or not. If you are, the JTable's size is dependent on the size of the JFrame. If not, a simple setBounds(int xpos, int ypos, int width, int height) will suffice.
As far as the color, what on the JTable are you wanting the color changed?


GenRocket - Experts at Building Test Data
Jessie Tan
Greenhorn

Joined: Apr 17, 2004
Posts: 12
i wanna change the color of the empty space.. whereby there's no col and row all that..
the grey color thingy..
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Originally posted by Jessie Tan:
i wanna change the color of the empty space.. whereby there's no col and row all that..
the grey color thingy..

So you don't want the grid lines?
Jessie Tan
Greenhorn

Joined: Apr 17, 2004
Posts: 12
yes..
i want the grid line...
wat i mean is, if my frame is big, and the table din take up all the space,
there will have a big space of grey color thingy... with nothing there...
and i wanna that too other color..
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Originally posted by Jessie Tan:
yes..
i want the grid line...
wat i mean is, if my frame is big, and the table din take up all the space,
there will have a big space of grey color thingy... with nothing there...
and i wanna that too other color..


Ahhh, ok, I know what you are talking about now. But I have never been able to find a solution to this. I will keep researching it though.
Jessie Tan
Greenhorn

Joined: Apr 17, 2004
Posts: 12
Never mind is ok...
anyway thanx alot..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTable (Size and Colour)