views:

107

answers:

1

Hi all, i make some custom java beans components to add at my GUI. This componenent contains a jtable with a stateChangeListener, the problem is when i add this component to my GUI stateChaged is fired (and fire an exception).

How can i resolve this?

A: 

Is it your own StateChangeListener (and not somewhere inside JTable)?! If so, the exception and the stack trace should tell you where and what is wrong. I would guess something isn't initialized in the right order.

Avall
Hi, stacktrace tell me the exception is fired into stateCganged method, becouse i have some hibernate's call in it.So the problem is, why stateChanged is called without compile project but only when i add my bean class into GUI?
blow
By "add into GUI", do you mean drag-n-drop your component from the palette in the GUI editor? In that case your component's constructor is called, and probably some events are triggered while displaying the JTable, and your hibernate call fails coz Hibernate isn't initialized coz the application is not running. I'm guessing here.
Avall
Yes, i mean when i drag-n-drop beans in the GUI editor. So, is it normally that stateChanged is fired when a jtable is "initialized"?
blow
Don't know, what's a StateChangeListener? The only listener with a stateChanged method I found is a ChangeListener, which cannot be added to a JTable.
Avall