craftleft.gif (3002 bytes)QuickTable
Home | API | Tutorial | Download | Support | Contact topblack.gif (108 bytes)


QuickTable User Cp  |  Register  |  Members  |  Search  |  Help
    |- QuickTable Discussion Forums > General QuickTable Support/Help Post New Topic   Post A Reply
setCellPropertiesModel doesn't seem to work printer friendly version
next newest post | next oldest post
Author Messages
snaftel
Unregistered
Edit or delete this message Reply w/Quote
Posted Friday, June 4, 2004 @ 09:54:06  

I have create a simple CellPropertiesModel, and assigned it to my DBTable using setCellPropertiesModel. None of the methods I define ever seem to get called, and the table appearance is not what I've programmed in the cellPropertiesModel.
What's wrong?
Admin
Board Owner

Gender: Unspecified
Location:
Registered: Jul 2003
Status: Offline
Posts: 9

Click here to see the profile for Admin Send email to Admin Send private message to Admin Find more posts by Admin Edit or delete this message Reply w/Quote
Posted Friday, June 4, 2004 @ 19:37:10  

Please post the code for your CellPropertiesModel, let me check whether there are any problems.
snaftel
Unregistered
Edit or delete this message Reply w/Quote
Posted Monday, June 7, 2004 @ 10:15:45  

This is the code that sets the cellproperties model:

CellPropertiesModel cellModel = new myCellModel();
dBTable1.setCellPropertiesModel(cellModel);

Here is the implementation of the cellpropertiesmodel:

class myCellModel extends CellPropertiesModel {
public Color getBackground(int row, int col) {
if (row % 2 == 0)
return Color.white;
else
return Color.red;
}
public Color getForeground(int row, int col) {
if (row % 2 == 0)
return Color.black;
else
return Color.white;
}
}

Whenever it is run, the row color is the default (blue background, white letters). In addition, if I run in the debugger, I never see my methods called.

Note: refresh is called on the dbtable after the cellpropertiesmodel is set.

Stuart Naftel

Admin
Board Owner

Gender: Unspecified
Location:
Registered: Jul 2003
Status: Offline
Posts: 9

Click here to see the profile for Admin Send email to Admin Send private message to Admin Find more posts by Admin Edit or delete this message Reply w/Quote
Posted Monday, June 7, 2004 @ 21:32:17  

I added your code into QuickTableFrame.java sample and it works fine.

dBTable1.setCellPropertiesModel( new CellPropertiesModel() {
public Color getBackground(int row, int col) {
if (row % 2 == 0)
return Color.white;
else
return Color.red;
}
public Color getForeground(int row, int col) {
if (row % 2 == 0)
return Color.black;
else
return Color.white;
}
});

Are you using skin? If not send your full source code through email, I will have a look at it.

Post New Topic   Post A Reply Jump to:
Contact Us | QuickTable - A Java DBGrid | Privacy Policy All times are GMT -5 Hours.
Welcome to QuickTable Forums, Guest!  
Login
Username :
Password :
In order to fully utilize the abilities of this board, you are required to register as a member. Registration is free, and allows you to do lots of things including turning on or off certain features of this board. Register now!
Powered by CuteCast v2.0 BETA 2
Copyright © 2001-2003 ArtsCore Studios