How do the AbstractTableModel, ColumnModel and TableCellRenderer interact?

could someone please explain to me how the AbstractTableModel, TableColumnModel and the TableCellRenderer interact?
That is, if I have a table which used a custom AbstractTableModel, and a custom TableCellRenderer, then how do I cause the renderer to render the correct data?
Do I have to manually invoke it from my table model? does it get called automatically for every column/row combination?
also if I want to add a column to the table and I use:
TableColumnModel's addColumn(TableColumn colum), do I have to invoke AbstractTableModel's fireTableStructureChanged() as well?
Also, I implemented AbstractTableModel's
Object valueAt(int row, int column)
but that method is never invoked in my code. Is that ok?
int getRowCount(), and int getColumnCount() are invoked on the other hand.
nir

I misspelled the name of the method.
I was using Object getValueAt(int row, int column)...
still this method is never invoked (I have debug messages there and they are never shown).
And I am setting the default renderer...
Here is my ccode:
   // this is how I define my table and table model.
   // PlayerTableDataModel is class implementing AbstractTableModel
   // dataSource is the object that will supply the data that will be presented in the table.
   PlayerTableDataModel tableModel = new PlayerTableDataModel(dataSource);
   table = new JTable(tableModel);
   table.getTableHeader().setReorderingAllowed(false);
   tableModel.setTable(table);
   table.setDefaultRenderer(RoundResult.class, new RoundResultRenderer(dataSource));
   table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);Here is my PlayerTableDataModel class:
public class PlayerTableDataModel extends AbstractTableModel
    private DataSource dataSource;
    private JTable table;
    public PlayerTableDataModel(DataSource dataSource) {
     super();
     this.dataSource; = dataSource;;     
    // This is the method I invoke when I want to dynamically add a new column to the table.
    public void addNewColumn(GameTableHeaderRenderer headerRenderer) {
     TableColumn newColumn = new TableColumn(getColumnCount());
     newColumn.setHeaderRenderer(headerRenderer);
     newColumn.setResizable(true);
     TableColumnModel cm = table.getColumnModel();
     cm.addColumn(newColumn);
     fireTableStructureChanged();
    public void setTable(JTable table) {
     this.table = table;
    public int getRowCount() {
     return dataSource.getNumRoundsPlayed();
    public int getColumnCount() {
     if (table == null) {
         return 0;
     return dataSource.numberOfPlayers();
    public Object getValueAt(int row, int column) {
     System.out.println("this is never shown");
    public boolean isCellEditable(int row, int col) {
        return false;      
    // I want each cell in the table to hold an object of class RoundResult
    public Class getColumnClass(int c) {
     return RoundResult.class;
}why do I have to implement getValueAt(), if it is never invoked?

Similar Messages

  • How do you connect your photoshop elements on your computer to your account online? and how do you create a customized url? how does the gallery work and how do you access it? i have trouble signing in on my program from my computer to connect to the onli

    how do you connect your photoshop elements on your computer to your account online? and how do you create a customized url? how does the gallery work and how do you access it? i have trouble signing in on my program from my computer to connect to the online photoshop, and I really want to create my own customized url and post photos to my gallery and share them with the world, family, and friends, but i need help because i can't figure how to do any of this, would really appreciate feedback and assistance, thanks, - claire conlon

    To add to sig's reply, "calibrating" does not calibrate Lithiu-Ion batteries, it calibrates the charge reporting circuitry.  If you look at the effect of deep discharging Lithium-Ion batteries in the data from the independent test group, Battery University, you will see that doing so shortens the life of the battery significantly. It looks like an optimum balance between use and life is at a discharge level of 50%.

  • I am purchasing a apple iphone 4 16 gb - model no. MC318LL, version 5.1.1 (9B206) CAN ANYBODY TELL THAT HOW OLD THE PHONE IS AND WHERE TO CHECK THAT IF I AM PURCHASING A RIGHT MODEL. SPECIFICATIONS CHECK ALSO REQUIRED

    I am purchasing a apple iphone 4 16 gb from a local second hand seller - model no. MC318LL, version 5.1.1 (9B206) CAN ANYBODY TELL THAT HOW OLD THE PHONE IS AND WHERE TO CHECK THAT IF I AM PURCHASING A RIGHT MODEL. SPECIFICATIONS CHECK ALSO REQUIRED - its looks are like a new phone.

    http://www.gazelle.com/how-to/iphone/model-identification
    Turn off your Caps Lock - all caps is considered shouting and rude.
    Many will not read your post if suject/body is in caps.

  • I started downloading an update without knowing how big the file was and when I found out how big it was decided I didn't want it because I probably won't use it. how do I stop, not pause, the download and remove the file?

    I started downloading an update for iphoto and imovie without realizing how big the file was and I really don't want these updates because I probably won't use them. I've paused the updates but don't know how to cancel them. Please let me know how to do so.

    Hide the purchase in your account and there should be nothing more from it.
    http://support.apple.com/kb/HT4919

  • Forex Qs: ob08 How do the Indir Quot and Dir Quot work?

    I have 3 currencies, said IDR (Local currency), HKD (Doc currency), and CHF (Group currency)
    How to read these currencies in the ob08?
    I key in HKD100, and I get 114,460 IDR and 15.03 CHF, and I check document, and found that the exrate for HKD/IDR is /0.87365.
    Could anyone guide me how to read the ob08, and How do the Indir Quot and Dir Quot work?  How can system generate HKD/IDR: ->  /0.87365.
    Thanks in advance.

    Hi
    First let us understand what the direct quote and Indirect quote is.
    Direct quote means when one unit of Foreing currency  if translated result into how many units of local currency.
    Local currency is the company code currency what u would have defined for your company.
    In your case it looks like IDR is the local currency. So all other currency u enter in the system is treated as Foreign currency. So HKD is foreign currency.
    Direct Quote: One unit oh HKD is equal to 0.87365
    When you are posting a document  either u can give your exchange rate if it is available or else system will apply the average rate(Rate typeM) stored  in the table(OB08)
    In your example it appears system wold habe taken the rate from the exchange rate table.
    Then the indirect quotation is how many unit of local currency u will get for each unit of foreign currency.I IDR=how much HDK it is the reverse of Direct quote.
    The concept of Group currency is used if a client is having different company code having different co code currency. Then to consolidate the accounts group currency comes in to picture.
    Regards.
    Surendra

  • I need know how operate the tables RSBKDTP and RSBKDTPH

    hi, i need know how operate the tables RSBKDTP and RSBKDTPH. i need kwon things like:
    - the diference between this tables
    - How operate the table RSBKDTPH and RSBKDTP ? What type the DTP's are inserted in this tables? How often are inserted DTP's in this tables?.
    Thanks in advanced

    The basic difference is
    RSBKDTP  - retrieves based on Object version (DTP  and OBJVERS are keyfields)
    RSBKDTPH - retrieves based on Time stamp (DTP  and timestamp are keyfields)
    according to your requirement you can consider the tables for statical reports on DTPs

  • How will the ipad batery and screen like this ???

    hi!
    i plan on using my ipad in the dental surgery i am working in to stand most of the time on a dock.
    while standing on a dock i want it to run movies or slideshows with special offers, before after pictures etc and then i want to take it off the dock several times a day to show the patient his or her pictures i took before to explain findings.
    how would the screen like to run 8 hours a day? would it be bad?
    how would the batteries react to the ipad running 8 hours a day, most of the time on a dock with power supply but several times a day 5-10 min battery powered. would the battery have a new loading cyce every time i put the ipad back on the dock? would this use reduce the battery life of it?

    Most battery suppliers of Nickle-Metal Hydride batteries say leaving them on a charger all the time shortens battery life...but you really have to ask what does that mean with respect to the planned life of the display you are planning. Your own plans for changing to another display approach may make that concern moot.
    Apple provides this information on the iPad batteries:
    http://www.apple.com/batteries/ipad.html
    An important part of that is the recommendation of monthly complete charge cycles: drain the battery all the way, the unit shutsdown automatically at a charge level of 1%, or so. Then recharges on wall power to full charge. You could probably do that with a single days' usage as you have described.
    Since the unit would be constantly changing images, you would not have to worry about anything like display damage from burning pixels like you do with computer monitors.
    Why not get one and try it out and see what the patient reaction is? Sounds like a clever use to me.

  • How toStore the Date Variable and pass it when the program runs next time??

    HI All,
    My JDBC program basically needs two command line args. Rabge_Start_Dt and Range_End_Dt. for ex:
    2001-05-31 and 2001-06-01 . And my porgram should run every day. Next day the date range will be 2001-06-01 to some date. It means I have to store some how the range_end_dt and pass it as range_start_dt when my program runs the next day.
    Problem:
    How can I store the Data variable and pass it as an argument to my porgram when It runs next time. Every time my pogram runs It should pick the range start_dt (==range_end_dt of the previuos run) and end_dt I have to go and query some other data base and pass that value to it.
    Thanks in advance!!!!

    save the value in a file, then read it back in each day. Similar to when a process needs a PID.
    -blhqctz

  • How does the crop-lock and "Effect" settings logic work?

    The crop lock and Effect setting have in common the fact that they are unpredictable with a strange logic I have yet to figure out. Questions:
    What decision process causes the crop lock to remain locked, and then suddenly decide to stay open from one use to the next  (Or the reverse).?
    What makes the "Effects" decide to retain its last used settings, and sometimes not?  (Usually the last customized setting is NOT what I want for the next photo in line to be edited).
    Thanks!

    Thank you for the reply!
    richardplondon wrote:
    There is no distinction betwen edited and un-edited. And the tools and controls do not have any defaults of their own aside from what the images possess. You can't put the crop tool on 3:2 and then move from image to image clicking "apply"; this is simply not how the LR interface works.
    Understood, except that these settings are an exception.  The effects settings will be stuck in the last positions they where on before you created the edit button.  See attached photo for what I mean by edit buttons and associated settings.  This also applies to graduated filters.
    This is difficult to describe.   I think I've figured out the logic but cant understand why anyone would want it to work this way:   If I choose a setting *before* making the first mark (i.e. new button) with the tool, those settings will persist forever until I change them (even if I change catalogs).  If I change the settings AFTER applying the tool, they are forgotten even if I want to keep them.  I never want a custom setting to persist into the next photo because the last tool/setting I used will not likely be the first tool used in the next photo.
    And just to be clear, the effects I'm referring to are on the right. The timing of WHEN you adjust those settings determines whether or not they persist in what I consider an undesirable way.  In other words, in order to avoid messing up the presets, I must always start the tool before adjusting the effects. That is the only way to keep them from persisting into the next tool/button operation.

  • Flash - how is the HD support - and HUGE image resolution question

    Hello Flash Forums,
    It's been a while since I posted, but I would love to get some information from some of the old pros on here as to best practices using flash for large scale environmental displays:
    1. Flash supports High Definition correct? I did a google search, and see that it does - but unsure whether I need a plug-in or it's just a setting? My question is more along the lines of - can the flash animation be highDef, or only the videos it displays?
    2. I am working on a very large (like 40ft tall) environmental graphic, and curious if anyone can tell me how you deal with images at that size? I remember vaugely, that they don't need to be 300dpi, but do i still need to maintain a certain resolution?
    Thanks for any help you can provide~!
    B

    Any limiting factors you'll be dealing with are likely more to do with what will actually be running/playing your Flash content and feeding that to this display. Whoever is responsible for setting up the computer system that displays this could answer that. Find out the resolution of their display set up. It will probably be a projection setup, that shows whatever media at a blown-up size. Ask them if 1080 HD video will work, and if they have used that before, and how did it look, etc.
    If the display ends up having a resolution of something significantly higher than what a graphic designer's "high" resolution monitor is, you don't necessarily have to have your Flash showing at 100% and fill all those pixels. You can have good results creating your Flash at a reasonale width & height, and then scaling that to 150%, 200%, etc.
    Flash has no problems dispalying 1080 HD video, and nothing is needed other than the Flash plugin. There continue to be Flash Player updates for improved video support, so be sure you get the latest version installed on whatever computer is playing this. YouTube started showing full HD size (1080) a while ago, and so you can always refer to that site to see how smooth the videos are.

  • How about the RFID device and SAP AutoId connections?

    Hi All,
    Scenario1 (Ports are enabled from client system): Client m/c is in different location and SAP AutoId Server is in different location. I have to connect the RFID reader and device controller to Client m/c to send the PML message to Server system. Is it possible?
    (Or) Do we need to connect the RFID Hardwares directly to the SAP Auto Id server?
    Scenario2 : I have to connect the server system through VPN, in this case If I connect the RFID hardwares to client system. Is it fine?
    Regards
    Sara

    Hi Stellare,
         I fully agree with Daniela Bork. You've installed 5.2 and you need some preliminary data load like rules, messages etc. as per the installation & config guide. By doing so you're loading standard risks(Global) will be created in the system. This value if you want to check at table level this should be at your DB attached to the Java stack.
       ABAP stack tables are /virsa.... and virsa_cc are java stack tables.  It depends on which version of GRC you're using.
    Regards,
    Asok

  • How do the Anti-Phishing and Malware prtection features in Firefox manifest themselves?

    You have a MOST interesting and informative e-mail and links to web pages concerning the protective features of Firefox, particularly the pages on Anti-Phishing and Malware.
    You direct the user (me) to go to your test web pages and see the process in action.
    I went to both pages, the page on Anti-Phishing and on Malware.
    '''Firstly''' I did not notice any notice on my Firefox browser (8.0.0). What should or can I do about this?
    '''Secondly''': (a) What should I have seen or be looking for to be warned? (b) How does Firefox warn me? (c) Is there anything I should or can do?
    My settings under "Options" are set as you advise.
    Sincerely
    Richard
    Richard D'Aeth
    <[email protected]>
    Phone: (613) 384-7320

    Hi Tylerdowner,
    About malware - software that sends personal data about the user to unauthorized parties over the Internet.
    1. There is transfer of personal data to third parties.
    2. I'm not agree to use this feature and therefore these third parties are unauthorized.
    3. This feature is not completely removable and it remains passively like a backdoor.
    Finally from 1,2,3 it's enough to claim that it is malware
    Bellow is the full and exact citation from http://www.thefreedictionary.com/malware
    Malicious computer software that interferes with normal computer functions or sends personal data about the user to unauthorized parties over the Internet.

  • How is the code compiled and run?

    Hi,
    im wondering how this code is interpretet/run by flash as3.
    Lets say i have a for loop:
    for ( var i:Number = 0; i < 12; i++)
    runStep1();
    runStep2();
    runStep3();
    Does the as-code run top to bottom and every method runStep1,
    runStep2, runStep3 is run in a sequence or does the for-loop just
    rush through the methods and doesnt bother if the methods are
    totally executed?
    //Criss

    Hi --
    I agree with you on the way Actionscript behaves -- it
    definitly doesn't
    execute in a way you would expect. One way to work around
    this issue (if
    possible) is to call one function from the end of another,
    for example:
    for ( var i:Number = 0; i < 12; i++)
    runStep1();
    function runStep1() {
    runStep2();
    function runStep2() {
    runStep3();
    This appraoch won't always work if you don't always want step
    2 to run after
    step 1, etc. but it is one approach to this issue.
    Rich
    "Surferboy_SWE" <[email protected]> wrote in
    message
    news:ggegg7$21i$[email protected]..
    >
    Yes im an oldie but new hehe. I was told flash would
    run
    > straight thorough each for loop without bothering if
    each of the functions
    > (runStep1, runStep2...) were executed ready. Lets say
    runStep1() is
    > calculating somthing that takes 2 second and runStep2
    and runStep3 are
    > dependent of what runStep1 has calculated you would end
    up with som
    > strange
    > hard to debug error.
    > I know there are other ways of adressing this problem
    but I never heard
    > of
    > this kind of execution order in other programming
    languages.
    >

  • How restore the tool bars and bookmarks and so on which have been accidentally deleted ?

    in order to get more place on the screen I have distinck off "barre d'outils", "barre des menus", etc and, consequently, nothing appears, notably my bookmarks and so on.
    How to restore them ?
    I Have no possibility to do while I click right the mouse.

    See [[menu bar is missing]]
    En français - [https://support.mozilla.com/fr/kb/menu+bar+is+missing Barre de menu manquante]

  • How are the Apps Store and iTunes store different? Which do you use for what?

    Can you explain the difference between Apps Store and iTunes store? Is Apps a subset of iTunes store? To which store do you go for what?

    Apps you buy from the Mac App store can be used on your computer.  You use the same Apple ID as the iTunes Store, but that's the only connection.
    Apps you buy from the iTunes App Store are written to run on an iOS device (iPhone, iPad or iPod Touch).  They won't run on your computer, only on your iDevice.

Maybe you are looking for

  • How to handle sessions with two severs on one machine?

    All, I am having a problem with session cookies being overwritten when I host two apps on one machine running WebLogic 8.1 The apps are http://myserver:7300/app1 and http://myserver:7400/app2, and each runs in its own server. Users will often access

  • In a helpset with multiple chms, how do you make the master toc appear in all child chms?

    I'm using RoboHelp 11. The software product I'm documenting is modular so the help is also divided into many chms (requirement). One of the other requirements is that the TOC from the master project appear, no matter which which chm contains the link

  • FI Invoicing Workflow

    Hi, I have implemented a FI Invoicing workflow which involves 3 levels of approval starting from document parking through TC: FV60 till document posting. And this is working fine. I have done configurations in SPRO like creating workflow variants and

  • What are the digital publishing supported devices ?

    can any one told me what  the devices are supported the digital publishing ( mobile devices and tablet device ) with the pixel dimensions for each please ... or any one know any article or web site can tell me that info ?

  • Isight not connected/ chronic

    My son's macbook's built in isight camera just stopped working, and we don't know why this started. The message is that it is not connected, or that it is in use by another application (which it isn't). I have searched on these forums and have found