Hello to all Stackoverflow developers thanks for helping me . I am working on a swing project .In which , i have to add a jinternal frame on jframe . i am adding the jinternal frame by calling method
Container.add(jinternalframe1);
the internalframe is being added but its moving , i want to disable the movement of the jinternalframe. on clicking a button on jinternalframe i want to add a JList and JTable on the previous frame window
I am calling the method
frame1.cp.add(list1);
frame1.cp.add(table1);
while clicking on jlist the table should be removed and new table should be generated. I am writing the following code for it
ms.cp.remove(table);
table= new JTable(String title, Object obj[][]);
add(table);
by doing so jtable is not being removed from container plz suggest me whats wrong in my code
Container
is using a layout manager which is deciding on how the internal frame should be displayed. JInternalFrame
is designed to work with containers that don't have a layout manager, most notably, the JDesktopPane
. For information check out How to Use Internal Framesms.cp
using ms.cp.remove(table)
and then add it to something else, no wonder it never shows up. See How to use Tables for more information.