• Post Reply Bookmark Topic Watch Topic
  • New Topic

using JDialog  RSS feed

 
oghenekaro EFEKODO
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
need help in identifying what's wrong with my codes.is giving the following exception after running the code:
the exception is:
Exception in thread "main" java.lang.NullPointerException
at java.awt.Container.addImpl(Unknown Source)
at java.awt.Container.add(Unknown Source)
at javax.swing.JDialog.addImpl(Unknown Source)
at java.awt.Container.add(Unknown Source)
at TestDialog.<init>(TryDialog.java:28)
at TryDialog.<init>(TryDialog.java:68)
at TryDialog.main(TryDialog.java:91)

the code is:
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Learning how to read compile errors will save you a ton of time. The java compiler even gives you the line number.

at TestDialog.<init>(TryDialog.java:28)


Look very closely there. I am sure you will get it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!