Botões de minimizar e botões de maximizar

2 respostas
D

Olá pessoal,
tem como eu remover os botões de maximixar e minimizar de um JFrame?

obrigado.

2 Respostas

R

Crie um JPanel ao inves de JFrame…vc faz praticamente a mesma coisa em um que no outro, só que o JPanel só vem com o X de fechar :slight_smile:

H

Eu retirei a barra inteira de um JInternalFrame alterando o UIManager da janela

<blockquote>public class WindowProject extends JInternalFrame

{

private JComponent barTitle;

/**

  • @param d Dimension
    */
    public WindowProject(Dimension d)
    {
    try
    {
    jbInit(d);
    } catch (Exception e)
    {
    e.printStackTrace();
    }
    }

/**

  • Este método inicializa a construção da JInternalFrame.
  • @author Paulo Manabe
  • @param d Dimension
  • @throws Exception
    */
    private void jbInit(Dimension d) throws Exception
    {
    this.setSize(d.width,d.height);
    this.setVisible(true);
    this.setDoubleBuffered(true);
    this.setEnabled(true);
    this.setSelected(true);
    removeTitleBar();

}

/**

  • Este método remove a barra superior do JInternalFrame.
  • @author Paulo Manabe
    */
    private void removeTitleBar(){
    barTitle = ((javax.swing.plaf.basic.BasicInternalFrameUI) getUI()).getNorthPane();
    barTitle.setSize(0,0);
    barTitle.setPreferredSize(new Dimension(0,0));
    repaint();
    }
    }
Criado 9 de novembro de 2006
Ultima resposta 10 de nov. de 2006
Respostas 2
Participantes 3