• 0

[JAVA] Display a second form within the main form


Question

I'm using JAVA and NetBeans IDE to port some programs I wrote in C now to JAVA both to learn and to make them multiplataform.

I'm stuck in the GUI part, after some reading I can't figure out how to launch a second modular form, from the main one. I don't mean a messagebox but a full form with custom controls and actions (something like an Options dialog).

Can anyone share some knowledge with me??

Thanks!

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

You need to make your second gui form a class file and extend it from JFrame, or an Internal Frame, then just load it from your program.

Example: (assuming your second form is in a class named Form2)

Form2 form = new Form2();
form.setVisible( TRUE);

And that will do the trick :D

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.