About Internal Frames
Hi everyone in the forum,
I have a question, i am using some internal frames in an app and i need to open one internal frame just cliking in a button in another one, and i have no clue how to do it. All the internal frames are created from a father interface. So there is like a father class (called mInterface) which creates the different children, e.g. GraphicalView, InformationView, ConfigurationView, TableView ...
The goal i am looking for, is to let for exampe the possibility to open the information form the configuration but i do not know how to implement it.
I do not think it is neccesary but, in case of it, I post a part of the creation of the internal frame code.
privatevoid menuTable(JMenuBar bar ){
JMenu addMenu =new JMenu("Tables Information " );// create Add menu
JMenuItem openConfiguration =new JMenuItem("Open Tables Window" );
addMenu.add( openConfiguration );// add new frame item to Add menu
bar.add( addMenu );// add Add menu to menu bar
setJMenuBar( bar );// set menu bar for this application
theDesktop =new JDesktopPane();// create desktop pane
add( theDesktop );// add desktop pane to frame
// set up listener for newFrame menu item
openConfiguration.addActionListener(
new ActionListener()// anonymous inner class
{
// display new internal window
publicvoid actionPerformed( ActionEvent event )
{
// create internal frame
if (frameTables ==null){
frameTables =new JInternalFrame("Information Interface", true, true, true,true );
JPanel panel =new JPanel(new BorderLayout());
panel.add( cTables.openTablesInfo(), BorderLayout.CENTER);
frameTables.add( panel, BorderLayout.CENTER );// add panel
frameTables.pack();// set internal frame to size of contents
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
frameTables.setSize(screenSize.width / 3 * 2,screenSize.height / 4 * 3 );
theDesktop.add( frameTables );// attach internal frame
frameTables.setVisible(true );// show internal frame
frameTables.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
//changed = false;
}
frameTables.setVisible(true);
}// end method actionPerformed
}// end anonymous inner class
);// end call to addActionListener
}

