jInternalFrame sempre maximizado

0 respostas
nagpaulo

Quero fazer um metodo que deixe sempre maximizado a jInternalFrame em uma jDesktoPane. Alguem pode ajudar?
segue o metodo que esta funcionando mas sem esta maximizado.

public class JIFGenerico extends javax.swing.JInternalFrame {
       
    public JIFGenerico(){
        this.setClosable(true);
        this.setMaximizable(true);
    }
   
    protected void centralizar() {
        //Centraliza o JInternalFrame no Desktop
        Dimension paneSize = this.getSize();
        Dimension screenSize = this.getToolkit().getScreenSize();
        this.setLocation((screenSize.width - paneSize.width) / 2, 
                (screenSize.height - paneSize.height) / 2);
    }
    
    public void centralizar(JComponent c) {
        //Centraliza o JInternalFrame no Desktop
        Dimension paneSize = this.getSize();
        Dimension screenSize = c.getSize();
        this.setLocation((screenSize.width - paneSize.width) / 2, 
                (screenSize.height - paneSize.height) / 2);
    }    
    
    public void limpar() {
        limpar(getContentPane());
    }
    
    public void limpar(Container comp) {
        Component[] cs = comp.getComponents();
        for(Component c : cs) {
            if( c instanceof JTextComponent ) {
                JTextComponent txc = (JTextComponent)c;
                txc.setText("");
            } else if( c instanceof Container ) {
                limpar((Container)c);
            }
        }
    }
Criado 4 de agosto de 2010
Respostas 0
Participantes 1