IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

AWT/Swing Java Discussion :

Erreur lors de l'utilisation de TableSorter.java


Sujet :

AWT/Swing Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé Avatar de Frac10
    Profil pro
    Inscrit en
    Avril 2006
    Messages
    81
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : France

    Informations forums :
    Inscription : Avril 2006
    Messages : 81
    Par défaut Erreur lors de l'utilisation de TableSorter.java
    Bonjour tout le monde !

    Alors voilà, j'utilise le TableSorter de Sun sur une JTable : cela marche convenablement lors de l'affichage initial du tableau mais lorsque je mets à jour ce tableau, j'ai une erreur sur le fichier TableSorter.java (et donc pas sur mon fichier perso) qui apparaît et la mise à jour du tableau se bloque. Par contre si je rafraîchi la fenêtre (en l'agrandissant par exemple), alors le tableau réapparait...

    Voilà cette erreur :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
            at TableSorter$Row.access$500(TableSorter.java:283)
            at TableSorter.modelIndex(TableSorter.java:237)
            at TableSorter.getValueAt(TableSorter.java:274)
            at javax.swing.JTable.getValueAt(Unknown Source)
            at javax.swing.JTable.prepareRenderer(Unknown Source)
            at javax.swing.plaf.basic.BasicTableUI.paintCell(Unknown Source)
            at javax.swing.plaf.basic.BasicTableUI.paintCells(Unknown Source)
            at javax.swing.plaf.basic.BasicTableUI.paint(Unknown Source)
            at javax.swing.plaf.ComponentUI.update(Unknown Source)
            at javax.swing.JComponent.paintComponent(Unknown Source)
            at javax.swing.JComponent.paint(Unknown Source)
            at javax.swing.JComponent.paintChildren(Unknown Source)
            at javax.swing.JComponent.paint(Unknown Source)
            at javax.swing.JViewport.paint(Unknown Source)
            at javax.swing.JComponent.paintChildren(Unknown Source)
            at javax.swing.JComponent.paint(Unknown Source)
            at javax.swing.JComponent.paintChildren(Unknown Source)
            at javax.swing.JComponent.paint(Unknown Source)
            at javax.swing.JComponent.paintWithOffscreenBuffer(Unknown Source)
            at javax.swing.JComponent.paintDoubleBuffered(Unknown Source)
            at javax.swing.JComponent._paintImmediately(Unknown Source)
            at javax.swing.JComponent.paintImmediately(Unknown Source)
            at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
            at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
            at java.awt.event.InvocationEvent.dispatch(Unknown Source)
            at java.awt.EventQueue.dispatchEvent(Unknown Source)
            at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
            at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
            at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    Je n'arrive pas à comprendre d'où cela provient, donc si d'autres personnes ont déjà eu le même problème que moi lors de l'utilisation de ce TableSorter, çà serait sympa de m'éclairer...

  2. #2
    Membre confirmé
    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    147
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Septembre 2006
    Messages : 147
    Par défaut
    J'ai aussi divers souci avec mon TableSorter. Les erreurs apparaissent directement à la première création du tableau.

    J'ai essayé de debugger, mais c'est vraiment galère. Apparemment, certain paramètres ne passent pas et on se retrouve a utiliser des valeurs nulles.

    Voici une partie de mes erreurs :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
     
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
            at utilisateursojv.TableSorter.getViewToModel(TableSorter.java:226)
            at utilisateursojv.TableSorter.modelIndex(TableSorter.java:237)
            at utilisateursojv.TableSorter.getValueAt(TableSorter.java:274)
            at javax.swing.JTable.getValueAt(JTable.java:1903)
            at javax.swing.JTable.prepareRenderer(JTable.java:3911)
            at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:2072)
            at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1974)
            at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:1897)
            at javax.swing.plaf.ComponentUI.update(ComponentUI.java:142)
            at javax.swing.JComponent.paintComponent(JComponent.java:742)
            at javax.swing.JComponent.paint(JComponent.java:1005)
            at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4963)
            at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4916)
            at javax.swing.JComponent._paintImmediately(JComponent.java:4859)
            at javax.swing.JComponent.paintImmediately(JComponent.java:4666)
            at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:451)
            at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:114)
            at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
            at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    Exception in thread "AWT-EventQueue-0" Exception in thread "AWT-EventQueue-0" Exception in thread "AWT-EventQueue-0" Exception in thread "AWT-EventQueue-0" Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
            at utilisateursojv.TableSorter.getViewToModel(TableSorter.java:226)
            at utilisateursojv.TableSorter.modelIndex(TableSorter.java:237)
            at utilisateursojv.TableSorter.getValueAt(TableSorter.java:274)
            at javax.swing.JTable.getValueAt(JTable.java:1903)
            at javax.swing.JTable.prepareRenderer(JTable.java:3911)
            at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:2072)
            at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1974)
            at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:1897)
            at javax.swing.plaf.ComponentUI.update(ComponentUI.java:142)
            at javax.swing.JComponent.paintComponent(JComponent.java:742)
            at javax.swing.JComponent.paint(JComponent.java:1005)
            at javax.swing.JComponent.paintChildren(JComponent.java:842)
            at javax.swing.JComponent.paint(JComponent.java:1014)
            at javax.swing.JViewport.paint(JViewport.java:728)
            at javax.swing.JComponent.paintChildren(JComponent.java:842)
            at javax.swing.JComponent.paint(JComponent.java:1014)
            at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4963)
            at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4916)
            at javax.swing.JComponent._paintImmediately(JComponent.java:4859)
            at javax.swing.JComponent.paintImmediately(JComponent.java:4666)
            at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:451)
            at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:114)
            at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
            at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    java.lang.NullPointerException
            at utilisateursojv.TableSorter.getViewToModel(TableSorter.java:226)
            at utilisateursojv.TableSorter.modelIndex(TableSorter.java:237)
            at utilisateursojv.TableSorter.getValueAt(TableSorter.java:274)
            at javax.swing.JTable.getValueAt(JTable.java:1903)
            at javax.swing.JTable.prepareRenderer(JTable.java:3911)
            at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:2072)
            at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1974)
            at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:1897)
            at javax.swing.plaf.ComponentUI.update(ComponentUI.java:142)
            at javax.swing.JComponent.paintComponent(JComponent.java:742)
            at javax.swing.JComponent.paint(JComponent.java:1005)
            at javax.swing.JComponent.paintChildren(JComponent.java:842)
            at javax.swing.JComponent.paint(JComponent.java:1014)
            at javax.swing.JViewport.paint(JViewport.java:728)
            at javax.swing.JComponent.paintChildren(JComponent.java:842)
            at javax.swing.JComponent.paint(JComponent.java:1014)
            at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4963)
            at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4916)
            at javax.swing.JComponent._paintImmediately(JComponent.java:4859)
            at javax.swing.JComponent.paintImmediately(JComponent.java:4666)
            at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:451)
            at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:114)
            at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
            at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    java.lang.NullPointerException
            at utilisateursojv.TableSorter.getViewToModel(TableSorter.java:226)
            at utilisateursojv.TableSorter.modelIndex(TableSorter.java:237)
            at utilisateursojv.TableSorter.getValueAt(TableSorter.java:274)
            at javax.swing.JTable.getValueAt(JTable.java:1903)
            at javax.swing.JTable.prepareRenderer(JTable.java:3911)
            at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:2072)
            at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1974)
            at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:1897)
            at javax.swing.plaf.ComponentUI.update(ComponentUI.java:142)
            at javax.swing.JComponent.paintComponent(JComponent.java:742)
            at javax.swing.JComponent.paint(JComponent.java:1005)
            at javax.swing.JComponent.paintChildren(JComponent.java:842)
            at javax.swing.JComponent.paint(JComponent.java:1014)
            at javax.swing.JViewport.paint(JViewport.java:728)
            at javax.swing.JComponent.paintChildren(JComponent.java:842)
            at javax.swing.JComponent.paint(JComponent.java:1014)
            at javax.swing.JComponent.paintChildren(JComponent.java:842)
            at javax.swing.JComponent.paint(JComponent.java:1014)
            at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4963)
            at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4916)
            at javax.swing.JComponent._paintImmediately(JComponent.java:4859)
            at javax.swing.JComponent.paintImmediately(JComponent.java:4666)
            at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:451)
            at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:114)
            at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
            at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    java.lang.NullPointerException
            at utilisateursojv.TableSorter.getViewToModel(TableSorter.java:226)
            at utilisateursojv.TableSorter.modelIndex(TableSorter.java:237)
            at utilisateursojv.TableSorter.getValueAt(TableSorter.java:274)
            at javax.swing.JTable.getValueAt(JTable.java:1903)
            at javax.swing.JTable.prepareRenderer(JTable.java:3911)
            at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:2072)
            at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1974)
            at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:1897)
            at javax.swing.plaf.ComponentUI.update(ComponentUI.java:142)
            at javax.swing.JComponent.paintComponent(JComponent.java:742)
            at javax.swing.JComponent.paint(JComponent.java:1005)
            at javax.swing.JComponent.paintChildren(JComponent.java:842)
            at javax.swing.JComponent.paint(JComponent.java:1014)
            at javax.swing.JViewport.paint(JViewport.java:728)
            at javax.swing.JComponent.paintChildren(JComponent.java:842)
            at javax.swing.JComponent.paint(JComponent.java:1014)
            at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4963)
            at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4916)
            at javax.swing.JComponent._paintImmediately(JComponent.java:4859)
            at javax.swing.JComponent.paintImmediately(JComponent.java:4666)
            at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:451)
            at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:114)
            at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
            at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    java.lang.NullPointerException
            at utilisateursojv.TableSorter.getViewToModel(TableSorter.java:226)
            at utilisateursojv.TableSorter.modelIndex(TableSorter.java:237)
            at utilisateursojv.TableSorter.getValueAt(TableSorter.java:274)
            at javax.swing.JTable.getValueAt(JTable.java:1903)
            at javax.swing.JTable.prepareRenderer(JTable.java:3911)
            at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:2072)
            at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1974)
            at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:1897)
            at javax.swing.plaf.ComponentUI.update(ComponentUI.java:142)
            at javax.swing.JComponent.paintComponent(JComponent.java:742)
            at javax.swing.JComponent.paint(JComponent.java:1005)
            at javax.swing.JComponent.paintChildren(JComponent.java:842)
            at javax.swing.JComponent.paint(JComponent.java:1014)
            at javax.swing.JViewport.paint(JViewport.java:728)
            at javax.swing.JComponent.paintChildren(JComponent.java:842)
            at javax.swing.JComponent.paint(JComponent.java:1014)
            at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4963)
            at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4916)
            at javax.swing.JComponent._paintImmediately(JComponent.java:4859)
            at javax.swing.JComponent.paintImmediately(JComponent.java:4666)
            at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:451)
            at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:114)
            at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
            at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    Exception in thread "AWT-EventQueue-0" Exception in thread "AWT-EventQueue-0" Exception in thread "AWT-EventQueue-0" Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
            at utilisateursojv.TableSorter.getViewToModel(TableSorter.java:226)
            at utilisateursojv.TableSorter.modelIndex(TableSorter.java:237)
            at utilisateursojv.TableSorter.getValueAt(TableSorter.java:274)
            at javax.swing.JTable.getValueAt(JTable.java:1903)
            at javax.swing.JTable.prepareRenderer(JTable.java:3911)
            at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:2072)
            at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1974)
            at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:1897)
            at javax.swing.plaf.ComponentUI.update(ComponentUI.java:142)
            at javax.swing.JComponent.paintComponent(JComponent.java:742)
            at javax.swing.JComponent.paint(JComponent.java:1005)
            at javax.swing.JComponent.paintChildren(JComponent.java:842)
            at javax.swing.JComponent.paint(JComponent.java:1014)
            at javax.swing.JViewport.paint(JViewport.java:728)
            at javax.swing.JComponent.paintChildren(JComponent.java:842)
            at javax.swing.JComponent.paint(JComponent.java:1014)
            at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4963)
            at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4916)
            at javax.swing.JComponent._paintImmediately(JComponent.java:4859)
            at javax.swing.JComponent.paintImmediately(JComponent.java:4666)
            at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:451)
            at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:114)
            at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
            at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    java.lang.NullPointerException
            at utilisateursojv.TableSorter.getViewToModel(TableSorter.java:226)
            at utilisateursojv.TableSorter.modelIndex(TableSorter.java:237)
            at utilisateursojv.TableSorter.getValueAt(TableSorter.java:274)
    java.lang.StringIndexOutOfBoundsException: String index out of range: -17
            at javax.swing.JTable.getValueAt(JTable.java:1903)
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    java.lang.StringIndexOutOfBoundsException: String index out of range: -18
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    java.lang.StringIndexOutOfBoundsException: String index out of range: -18
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    java.lang.StringIndexOutOfBoundsException: String index out of range: -17
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
            at javax.swing.JTable.prepareRenderer(JTable.java:3911)
            at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:2072)
    java.lang.StringIndexOutOfBoundsException: String index out of range: -17
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    java.lang.StringIndexOutOfBoundsException: String index out of range: -17
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    java.lang.StringIndexOutOfBoundsException: String index out of range: -17
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    java.lang.StringIndexOutOfBoundsException: String index out of range: -17
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    java.lang.StringIndexOutOfBoundsException: String index out of range: -17
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    java.lang.StringIndexOutOfBoundsException: String index out of range: -17
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    java.lang.StringIndexOutOfBoundsException: String index out of range: -17
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
            at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1974)
            at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:1897)
            at javax.swing.plaf.ComponentUI.update(ComponentUI.java:142)
            at javax.swing.JComponent.paintComponent(JComponent.java:742)
            at javax.swing.JComponent.paint(JComponent.java:1005)
            at javax.swing.JComponent.paintChildren(JComponent.java:842)
            at javax.swing.JComponent.paint(JComponent.java:1014)
            at javax.swing.JViewport.paint(JViewport.java:728)
            at javax.swing.JComponent.paintChildren(JComponent.java:842)
            at javax.swing.JComponent.paint(JComponent.java:1014)
            at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4963)
            at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4916)
            at javax.swing.JComponent._paintImmediately(JComponent.java:4859)
            at javax.swing.JComponent.paintImmediately(JComponent.java:4666)
            at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:451)
            at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:114)
            at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
            at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    java.lang.NullPointerException
            at utilisateursojv.TableSorter.getViewToModel(TableSorter.java:226)
            at utilisateursojv.TableSorter.modelIndex(TableSorter.java:237)
            at utilisateursojv.TableSorter.getValueAt(TableSorter.java:274)
            at javax.swing.JTable.getValueAt(JTable.java:1903)
            at javax.swing.JTable.prepareRenderer(JTable.java:3911)
            at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:2072)
            at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1974)
            at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:1897)
            at javax.swing.plaf.ComponentUI.update(ComponentUI.java:142)
            at javax.swing.JComponent.paintComponent(JComponent.java:742)
            at javax.swing.JComponent.paint(JComponent.java:1005)
            at javax.swing.JComponent.paintChildren(JComponent.java:842)
            at javax.swing.JComponent.paint(JComponent.java:1014)
            at javax.swing.JViewport.paint(JViewport.java:728)
            at javax.swing.JComponent.paintChildren(JComponent.java:842)
            at javax.swing.JComponent.paint(JComponent.java:1014)
            at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4963)
            at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4916)
            at javax.swing.JComponent._paintImmediately(JComponent.java:4859)
            at javax.swing.JComponent.paintImmediately(JComponent.java:4666)
            at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:451)
            at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:114)
            at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
            at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    java.lang.NullPointerException
            at utilisateursojv.TableSorter.getViewToModel(TableSorter.java:226)
            at utilisateursojv.TableSorter.modelIndex(TableSorter.java:237)
            at utilisateursojv.TableSorter.getValueAt(TableSorter.java:274)
            at javax.swing.JTable.getValueAt(JTable.java:1903)
            at javax.swing.JTable.prepareRenderer(JTable.java:3911)
            at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:2072)
            at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1974)
            at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:1897)
            at javax.swing.plaf.ComponentUI.update(ComponentUI.java:142)
            at javax.swing.JComponent.paintComponent(JComponent.java:742)
            at javax.swing.JComponent.paint(JComponent.java:1005)
            at javax.swing.JComponent.paintChildren(JComponent.java:842)
            at javax.swing.JComponent.paint(JComponent.java:1014)
            at javax.swing.JViewport.paint(JViewport.java:728)
            at javax.swing.JComponent.paintChildren(JComponent.java:842)
            at javax.swing.JComponent.paint(JComponent.java:1014)
            at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4963)
            at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4916)
            at javax.swing.JComponent._paintImmediately(JComponent.java:4859)
            at javax.swing.JComponent.paintImmediately(JComponent.java:4666)
            at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:451)
            at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:114)
            at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
            at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    Exception in thread "AWT-EventQueue-0" Exception in thread "AWT-EventQueue-0" Exception in thread "AWT-EventQueue-0" Exception in thread "AWT-EventQueue-0" Exception in thread "AWT-EventQueue-0" Exception in thread "AWT-EventQueue-0" Exception in thread "AWT-EventQueue-0" Exception in thread "AWT-EventQueue-0" Exception in thread "AWT-EventQueue-0" Exception in thread "AWT-EventQueue-0" Exception in thread "AWT-EventQueue-0" Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
            at utilisateursojv.TableSorter.getViewToModel(TableSorter.java:226)
            at utilisateursojv.TableSorter.modelIndex(TableSorter.java:237)
            at utilisateursojv.TableSorter.getValueAt(TableSorter.java:274)
            at javax.swing.JTable.getValueAt(JTable.java:1903)
            at javax.swing.JTable.prepareRenderer(JTable.java:3911)
            at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:2072)
            at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1974)
            at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:1897)
            at javax.swing.plaf.ComponentUI.update(ComponentUI.java:142)
            at javax.swing.JComponent.paintComponent(JComponent.java:742)
            at javax.swing.JComponent.paint(JComponent.java:1005)
            at javax.swing.JComponent.paintChildren(JComponent.java:842)
            at javax.swing.JComponent.paint(JComponent.java:1014)
            at javax.swing.JViewport.paint(JViewport.java:728)
            at javax.swing.JComponent.paintChildren(JComponent.java:842)
            at javax.swing.JComponent.paint(JComponent.java:1014)
            at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4963)
            at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4916)
            at javax.swing.JComponent._paintImmediately(JComponent.java:4859)
            at javax.swing.JComponent.paintImmediately(JComponent.java:4666)
            at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:451)
            at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:114)
            at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
            at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    java.lang.NullPointerException
            at utilisateursojv.TableSorter.getViewToModel(TableSorter.java:226)
            at utilisateursojv.TableSorter.modelIndex(TableSorter.java:237)
            at utilisateursojv.TableSorter.getValueAt(TableSorter.java:274)
            at javax.swing.JTable.getValueAt(JTable.java:1903)
            at javax.swing.JTable.prepareRenderer(JTable.java:3911)
            at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:2072)

  3. #3
    Membre éprouvé Avatar de Satch
    Homme Profil pro
    Hypnothérapeute - Magicien
    Inscrit en
    Mars 2004
    Messages
    498
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : Suisse

    Informations professionnelles :
    Activité : Hypnothérapeute - Magicien

    Informations forums :
    Inscription : Mars 2004
    Messages : 498
    Par défaut
    Il y a plusieurs versions de ce TableSorter non ?

    Vous pouvez nous mettre un lien vers celui que vous utilisez qu'on y voit un peu plus clair ? (notamment pour les numéros de ligne)

  4. #4
    Membre confirmé Avatar de Frac10
    Profil pro
    Inscrit en
    Avril 2006
    Messages
    81
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : France

    Informations forums :
    Inscription : Avril 2006
    Messages : 81
    Par défaut
    Tout d'abord merci pour vos réponses.

    Pour Satch, voici un lien vers le fichier que j'utilise :

    TableSorter.java

    Voilà, çà à l'air de venir de cette ligne :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    return getViewToModel()[viewIndex].modelIndex;
    Mais je ne comprends toujours pas pourquoi...

  5. #5
    Membre éprouvé Avatar de Satch
    Homme Profil pro
    Hypnothérapeute - Magicien
    Inscrit en
    Mars 2004
    Messages
    498
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : Suisse

    Informations professionnelles :
    Activité : Hypnothérapeute - Magicien

    Informations forums :
    Inscription : Mars 2004
    Messages : 498
    Par défaut
    Bizarre.
    Je vais peut-être dire n'importe quoi, parce que je ne suis jamais tombé sur une stacktrace comme ça.

    Essaye (à tout hasard) de remplacer
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
        public int modelIndex(int viewIndex) {
            return getViewToModel()[viewIndex].modelIndex;
        }
    par
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
        public int modelIndex(int viewIndex) {
        	Row r = getViewToModel()[viewIndex];
        	if (r==null){
        		System.err.println("Evidemment que ça merde...");
        	}
            return r.modelIndex;
        }
    Si ça ne marque pas que ça merde, essaye (toujours à tout hasard mais j'y crois pas du tout) de remplacer le private modelIndex de la class Row par un protected.

  6. #6
    Membre confirmé
    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    147
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Septembre 2006
    Messages : 147
    Par défaut
    J'ai la même version que Frac10, et j'ai la même erreur.

    J'ai essayé avec ton code, apparemment r n'est pas null, mais malgré ça il y a une erreur. J'ai exécuté mon code une bonne vingtaine de fois en pas à pas mais je n'y comprend rien.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [POO] Erreur lors de l'utilisation de $this en PHP5
    Par Ekimasu dans le forum Langage
    Réponses: 4
    Dernier message: 03/11/2006, 20h21
  2. Erreur lors de l'utilisation de session_start();
    Par nane1474 dans le forum Langage
    Réponses: 8
    Dernier message: 30/06/2006, 12h06
  3. Erreur lors de l' utilisation des objets ADO
    Par aityahia dans le forum Bases de données
    Réponses: 10
    Dernier message: 24/03/2006, 13h46
  4. Eviter les erreurs lors de l'utilisation des compo Tsocket
    Par Coussati dans le forum Composants VCL
    Réponses: 5
    Dernier message: 01/02/2006, 19h14
  5. Erreur lors de l'utilisation de strlwr ?!
    Par MonsieurAk dans le forum C++
    Réponses: 4
    Dernier message: 05/12/2005, 10h22

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo