Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

error whitl switching from one screen to another in same application  RSS feed

 
Bhanuteja Shrida Yenduri
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have the problem with swithching from one application to another.There are two applications like X and Y. When I first select X , it works fine without any errors.When I switch from X to Y , it was giving the error as Null pointer Exception.it won't get the screen.Both X and Y Bussiness code was written in the same java file.But the controller and view are different.and also the Java file was mentioned as Singleton. How to change this object.



FmDialog.getInstance(context).show(); //actual code.

for this only one screen is working fine. When I switch it i'll gives the nullpointer exception.can't able to get the data.

additional code.

FmDialog fmdlg=FmDialog.getInstance();
JPanel mainPanel = new JPanel();
fmdlg.createMainPanel(mainPanel);

another exception with this additional code as "java.lang.IllegalArgumentException: wrong parent for CardLayout"


Anybody could you help me regarding this.
 
Rob Spoor
Sheriff
Posts: 21090
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to tell us some more information. Like show us the NullPointerException stack trace and the piece of code it relates to.

As for the CardLayout problem: a CardLayout can only work on the container for which it is the layout manager. In other words, only if

where "this" is the CardLayout instance.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!