0

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?

blow
  • 12,811
  • 24
  • 75
  • 112

1 Answers1

1

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
  • 850
  • 1
  • 5
  • 14
  • 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 Aug 07 '10 at 10:54
  • 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 Aug 08 '10 at 00:22
  • 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 Aug 08 '10 at 15:42
  • 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 Aug 09 '10 at 10:23