Click « JInternalFrame « Java Swing Q&A





1. How a JInternalFrame show on Button Click    coderanch.com

The following code worked ok. import javax.swing.*; import java.awt.event.*; import java.awt.*; public class Test extends JFrame{ Test() { JDesktopPane desk = new JDesktopPane(); final JInternalFrame inter = new JInternalFrame("My Internals", true ,true, true, true); inter.setBounds(25, 25, 100, 300); desk.add(inter); getContentPane().add(desk, BorderLayout.CENTER); JButton button = new JButton("Show my internals"); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { inter.setVisible(true); } }); getContentPane().add(button, BorderLayout.SOUTH); ...

6. why clicking on button does not show a new internalframe in this code?    coderanch.com

My problem is that I am not able see a new Internal frame when I click the 'Show Frame 2' button in one internal frame. The code for the files is as follows.Also the code for internal frames has to be in separate files. What changes are needed to fix the problem? //MainAppFrame.java import java.awt.*; import java.awt.event.*; import javax.swing.*; public class ...