> I need to draw a table which will be full of numbers. I also need to draw
> lines over the numbers (for example, draw a horizontal line from the first
[quoted text clipped - 8 lines]
> can
> give me some solution or way to get the table done.
class MyTable extends JTable {
public void paint(Graphics g) {
super.paint(g);
paintLines(g);
}
protected void paintLines(Graphics g) {
//draw lines here
}
}

Signature
Andrey Kuznetsov
http://uio.imagero.com Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities
PGR - 12 Jan 2006 22:10 GMT
Thank you, it looks easy and simple

Signature
PGR
Martin Bradley - 29 Jan 2006 23:06 GMT
>>I need to draw a table which will be full of numbers. I also need to draw
>>lines over the numbers (for example, draw a horizontal line from the first
[quoted text clipped - 20 lines]
> }
> }
Would it not be better to create a TableCellRenderer that does the line
drawing for you rather than extending JTable? Your TableCellRenderer
can use a JLabel to dislay the number. JLabels can render HTML. HTML
has a strike through <strike>word</strike>.
Thats what I would look into first anyway.
hope I helped,
Martin
Andrey Kuznetsov - 31 Jan 2006 00:52 GMT
>>>http://img314.imageshack.us/img314/184/image13891mv.png
> Would it not be better to create a TableCellRenderer that does the line
> drawing for you rather than extending JTable? Your TableCellRenderer can
> use a JLabel to dislay the number. JLabels can render HTML. HTML has a
> strike through <strike>word</strike>.
>
> Thats what I would look into first anyway.
if you look at his image, you will find there also vertical lines,
Note also that lines must be _inside_of_cell_ to be drawn by renderer.

Signature
Andrey Kuznetsov
http://uio.imagero.com Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities