To kerendo abrir JInternalFrames em uma JFrame numa app pelo NetBeans 5, so q n to sabendo faze-los aparecer nesta JFrame.
codigo do JInternalFrame:public class NewClass extends javax.swing.JInternalFrame {
/** Creates a new instance of NewClass */
public NewClass() {
setClosable(true);
setIconifiable(true);
setMaximizable(true);
setResizable(true);
setVisible(true);
org.jdesktop.layout.GroupLayout jInternalFrame1Layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(jInternalFrame1Layout);
jInternalFrame1Layout.setHorizontalGroup(
jInternalFrame1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(0, 870, Short.MAX_VALUE)
);
jInternalFrame1Layout.setVerticalGroup(
jInternalFrame1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(0, 521, Short.MAX_VALUE)
);
}
}
public class Gui_Principal extends javax.swing.JFrame {
/** Creates new form Gui_Principal */
public Gui_Principal() {
initComponents();
NewClass nc = new NewClass();
nc.setVisible(true);
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
private void initComponents() {
jMenuBar1 = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
jMenu2 = new javax.swing.JMenu();
jMenu3 = new javax.swing.JMenu();
jMenu4 = new javax.swing.JMenu();
jMenu5 = new javax.swing.JMenu();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setExtendedState(6);
jMenu1.setText("Programa");
jMenuBar1.add(jMenu1);
jMenu2.setText("Consultas");
jMenuBar1.add(jMenu2);
jMenu3.setText("Cadastros");
jMenuBar1.add(jMenu3);
jMenu4.setText("Usu\u00e1rios");
jMenuBar1.add(jMenu4);
jMenu5.setText("Ajuda");
jMenuBar1.add(jMenu5);
setJMenuBar(jMenuBar1);
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(0, 1016, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(0, 683, Short.MAX_VALUE)
);
setBounds(0, 0, 1024, 738);
}// </editor-fold>//GEN-END:initComponents
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
try {
javax.swing.UIManager.setLookAndFeel("com.jgoodies.looks.windows.WindowsLookAndFeel");
} catch (Exception e) {
System.out.println("Não foi possível carregar o Skin padrão.");
}
new Gui_Principal().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JMenu jMenu1;
private javax.swing.JMenu jMenu2;
private javax.swing.JMenu jMenu3;
private javax.swing.JMenu jMenu4;
private javax.swing.JMenu jMenu5;
private javax.swing.JMenuBar jMenuBar1;
// End of variables declaration//GEN-END:variables
}
Eu acho q n ta aparecendo pq o NB5 monta o layuot c base no FreeLayout e dai o JInternalFrame tem q ser inserido nele, eu n sei como faco, pq n ata aprecendo, alguem q ja tenha feito isso, poderia disponibilizar o codigo? Tem q ser 1 codigo q tenha feito isso, ja olhei o codigo da Sun e n me ajudou mto n :(