quero fazer uma tela principal com um JDesktopPane e um InternalFrame como faço isso, se alguém puder me postar um exemplo eu agradeço T+.
Netbeans
P
6 Respostas
Mas qual o problema? O que você não consegue?
Poste o seu código, que você tentou fazer, e qual é a dúvida.
P
não consigo add o internalFrame e tambem nao consigo add o MenuItem
Como você está tentando fazer?
Acredito que se postar o código ficará mais fácil.

P
eu coloquei um InternalFrame mas na hora q eu vou maximizar a tela ele nao maximiza faz teste ae
* NovoJFrame.java
*
* Created on 31 de Julho de 2007, 16:20
*/
package javaapplication4;
import javax.swing.*;
/**
*
* @author Benfino
*/
public class NovoJFrame extends javax.swing.JFrame {
private JDesktopPane desktop;
/** Creates new form NovoJFrame */
public NovoJFrame() {
initComponents();
desktop = new JDesktopPane();
getContentPane().add(desktop);
}
/** 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=" Código Gerado ">
private void initComponents() {
jDesktopPane1 = new javax.swing.JDesktopPane();
jInternalFrame1 = new javax.swing.JInternalFrame();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jDesktopPane1.setBackground(new java.awt.Color(255, 255, 255));
jDesktopPane1.setName("oi");
jInternalFrame1.setVisible(true);
javax.swing.GroupLayout jInternalFrame1Layout = new javax.swing.GroupLayout(jInternalFrame1.getContentPane());
jInternalFrame1.getContentPane().setLayout(jInternalFrame1Layout);
jInternalFrame1Layout.setHorizontalGroup(
jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 12, Short.MAX_VALUE)
);
jInternalFrame1Layout.setVerticalGroup(
jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 4, Short.MAX_VALUE)
);
jInternalFrame1.setBounds(0, 0, 400, 300);
jDesktopPane1.add(jInternalFrame1, javax.swing.JLayeredPane.DEFAULT_LAYER);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jDesktopPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jDesktopPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
);
pack();
}// </editor-fold>
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new NovoJFrame().setVisible(true);
}
});
}
// Declaração de variáveis - não modifique
private javax.swing.JDesktopPane jDesktopPane1;
private javax.swing.JInternalFrame jInternalFrame1;
// Fim da declaração de variáveis
}
Criado 31 de julho de 2007
Ultima resposta 1 de ago. de 2007
Respostas 6
Participantes 3