0

I am currently working on a self-project using Java SE-13 on Eclipse with Window builder.

I intend to create a program that has the following design flow using individual button as the event-source.

[Edit](for those who do not wish to visit the link)

Default Package Swing application <---> Package A swing application

I using package to help me simulate then I am using people program and integrate it. Trying to think of modular and keeping the project organize [/Edit]

I had tried to use the following two approach.

  • Destroy the "current Swing application"(extend Frame) using XXX.dispose(), create the instance of the second Swing application and set it visible.

It works fine if the flow is one direction but not bidirectional. When I try to return back to the "current Swing application" it was unable to destroy the second-swing application which it throws a Nullpointer exception.

  • Using CardLayout. By creating multiple Jpanel and only set the one I wish to display as visible(true).

It allows me to have the bi-direction flow. But I am not using packages.

I had heard about the getContentpane() method but I am unsure if it will meet my requirement or it the best practice. If so, how will you be implementing else if not, what will you do to achieve my desire flow.

Thank you and take care

  • No, we're not going to visit external links. Please post a small example that reproduces the issue here. – Stultuske May 13 '20 at 06:09
  • I can see why. But the link was auto-generated when I insert the image. It is more easier and efficient to show the image then produce. But I see what I can do – Tian Yonka Chagikata May 13 '20 at 06:51
  • how is using packages even remotely relevant to your issue? You still don't show any code. – Stultuske May 13 '20 at 07:10
  • I using package to help me simulate then I am using people program and integrate it. Trying to think of modular and keeping the project organized . I did not post any code. Cause I am asking What to do ? not How to do ? plus what I had it mostly generated by the window-builder tool. I can post but not like it will be much help. – Tian Yonka Chagikata May 13 '20 at 07:22
  • whether you use packages or not has no impact on the functionality. It just structures your project more clearly. – Stultuske May 13 '20 at 07:38
  • since your actual issue i a nullpointerException, this should be a good place to start: https://stackoverflow.com/questions/218384/what-is-a-nullpointerexception-and-how-do-i-fix-it – Stultuske May 13 '20 at 07:39

0 Answers0