BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

JdbTable rowColors

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> JBuilder DB Swing
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Thu Jan 26, 2006 11:46 pm    Post subject: JdbTable rowColors Reply with quote



Hi.

Did anyone tried to paint jdbTable rows with two diffirent background
colors.
In a way that every second row is in diffirent color(for example first row
is white, second is blue, third is white fourth is blue and so on...). I did
some work with ColumPaintListener and painted just columns.
That was based on certain Column value(numeric).
So where to look for row painting, and I would like to keep other default
JdbTable stuff intact...Thanx in advance...bye...
Back to top
Kevin Dean [TeamB]
Guest





PostPosted: Thu Jan 26, 2006 11:46 pm    Post subject: Re: JdbTable rowColors Reply with quote



<ivan.lusavec (AT) inet (DOT) hr> wrote:

Quote:
Did anyone tried to paint jdbTable rows with two diffirent background
colors.
In a way that every second row is in diffirent color(for example first row
is white, second is blue, third is white fourth is blue and so on...). I
did some work with ColumPaintListener and painted just columns.
That was based on certain Column value(numeric).
So where to look for row painting, and I would like to keep other default
JdbTable stuff intact...Thanx in advance...bye...

A search of Google yields the following:

http://groups.google.ca/group/borland.public.jbuilder.dbswing/browse_thread/thread/16ec9a94938e4b5/7071bd6cd2ad664d?lnk=st&q=%22kevin+dean%22+jdbtable+color&rnum=3&hl=en#7071bd6cd2ad664d

AKA

http://tinyurl.com/9oou4

--
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
http://www.datadevelopment.com/

NEW WHITEPAPERS
Team Development with JBuilder and Borland Enterprise Server
Securing Borland Enterprise Server
http://www.datadevelopment.com/papers/index.html

Please see Borland's newsgroup guidelines at
http://info.borland.com/newsgroups/guide.html
Back to top
Guest






PostPosted: Fri Jan 27, 2006 1:59 pm    Post subject: Re: JdbTable rowColors Reply with quote



Hi,...hmmm..In post Kevin said that I need column paint listener for every
column. That is potentially a lot of listeners in some cases.
Well I did it with extending JdbTable, and overriding prepareRenderer method
like this:

"import com.borland.dbswing.JdbTable;
import javax.swing.table.TableCellRenderer;
import java.awt.Component;
import java.awt.Color;

public class MyJdbtable extends JdbTable {
public MyJdbtable() {
super();

}
public Component prepareRenderer(TableCellRenderer renderer,
int rowIndex, int vColIndex)
{
Component c = super.prepareRenderer(renderer, rowIndex, vColIndex);

if (rowIndex % 2 == 0 ) {
c.setBackground(Color.orange);
} else {

c.setBackground(getBackground());
}
return c;
}
}"

Can't I register just one column paint listener on "important" column, and
repaint whole row for things that need to be repainted...
Right now I know how to repaint paintSite with ColumnPaintListener, and that
is just one cell...any more ideas, ...thatnx in advance....bye...




"Kevin Dean [TeamB]" <NkOdSePaAnM (AT) datadevelopment (DOT) com> je napisao u poruci
interesnoj grupi:xn0ehoyutdr0fn001-kdean (AT) www (DOT) teamb.com...
Quote:
ivan.lusavec (AT) inet (DOT) hr> wrote:

Did anyone tried to paint jdbTable rows with two diffirent background
colors.
In a way that every second row is in diffirent color(for example first row
is white, second is blue, third is white fourth is blue and so on...). I
did some work with ColumPaintListener and painted just columns.
That was based on certain Column value(numeric).
So where to look for row painting, and I would like to keep other default
JdbTable stuff intact...Thanx in advance...bye...

A search of Google yields the following:

http://groups.google.ca/group/borland.public.jbuilder.dbswing/browse_thread/thread/16ec9a94938e4b5/7071bd6cd2ad664d?lnk=st&q=%22kevin+dean%22+jdbtable+color&rnum=3&hl=en#7071bd6cd2ad664d

AKA

http://tinyurl.com/9oou4

--
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
http://www.datadevelopment.com/

NEW WHITEPAPERS
Team Development with JBuilder and Borland Enterprise Server
Securing Borland Enterprise Server
http://www.datadevelopment.com/papers/index.html

Please see Borland's newsgroup guidelines at
http://info.borland.com/newsgroups/guide.html
Back to top
Guest






PostPosted: Fri Jan 27, 2006 4:55 pm    Post subject: Re: JdbTable rowColors Reply with quote

Forget what i said in last post,
I did it as You suggested, it's working, although it needs more work to be
done right. I must say this is very useful for avoiding cellrenderers.

When combined with code from my previous post, it doesn't work, i see only
stripes, columnPaint is gone...

Thanx for help. If someone had similar situation and solved it, please post
some advice, I have a lot of other work, ...time is short....
Bye..
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> JBuilder DB Swing All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.