JInternalFrame and JDesktopPane

5.4k views Asked by At

I have master employee form and I want to show em on my main form. That main form is MDI container, so I just want to know how to show the master employee form.

Here is theJDesktopPane creating object code:

public class MainForm extends javax.swing.JFrame {

JDesktopPane desk = new JDesktopPane();
LoginForm login = new LoginForm();
/** Creates new form MainForm */
public MainForm() {
    initComponents();
}

And here is to call masteremployee form though it's not working.

  MasterEmployee me = new MasterEmployee();       
    desk.add(me);
    me.setVisible(true);

How do I resolve this ? I want to make the master employee form shows on Jdesktoppane

Update:

It is working now. I used the following reference.

1

There are 1 answers

0
camickr On BEST ANSWER

Read the section from the Swing tutorial on How to Use Internal Frames for a working example that shows you how to create and select an internal frame.

You need to do more than just invoke setVisible() on the internal frame and I have no idea what the code in your MasterEmployess class does.