Como retirar o close, o minimizar e o maximizar de uma tela

4 respostas Resolvido
J

Saudações,

Desculpem a duvida mas sou iniciante rs, entao qual é o comando para retirar estes 3 icones da borda da tela em um Jframe ?

4 Respostas

J

Já tentou usar: seuFrame.setUndecorated(true);

J

Obrigado pela resposta, como sou iniciante nao sei onde colocar isso.

Por favor me mostre onde eu coloco isso, segue o meu fonte

/*

  • To change this license header, choose License Headers in Project Properties.
  • To change this template file, choose Tools | Templates
  • and open the template in the editor.
    */
    package telas;

/**
*

  • @author Jefferson
    */
    public class TelaSobre extends javax.swing.JFrame {

    /**

    • Creates new form TelaSobre
      */
      public TelaSobre() {
      initComponents();

    }

    /**

    • 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.
      
      */
      
      @SuppressWarnings(unchecked)
      
      // 
      
      private void initComponents() {
      
      TelaSobre1 = new javax.swing.JLabel();
      
      TelaSobre2 = new javax.swing.JLabel();
      
      TelaSobre3 = new javax.swing.JLabel();
      
      TelaSobre4 = new javax.swing.JLabel();
      
      TelaSobre5 = new javax.swing.JLabel();
      
      TelaSobre6 = new javax.swing.JLabel();
      
      setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
      
      setTitle(Sobre);
      
      setResizable(false);
      

      TelaSobre1.setFont(new java.awt.Font(“Tahoma”, 1, 11)); // NOI18N
      TelaSobre1.setText(“Sistema para controle de entregas”);

      TelaSobre2.setText(“Desenvolvido por Jefferson Andre da Silva”);

      TelaSobre3.setText(“Direitos autorais da Xcomp Soluçoes em T.I.”);

      TelaSobre4.setText(“Projeto 11-2018”);

      TelaSobre5.setIcon(new
      javax.swing.ImageIcon(getClass()
      .getResource("/icones/Xcomp -
      bolha.png"))); // NOI18N

      TelaSobre6.setText(“[telefone removido]”);

      javax.swing.GroupLayout layout = new
      
      javax.swing.GroupLayout(getContentPane());
      
      getContentPane().setLayout(layout);
      
      layout.setHorizontalGroup(
      
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      
      .addGroup(layout.createSequentialGroup()
      
      .addGap(44, 44, 44)
      
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addComponent(TelaSobre5,

javax.swing.GroupLayout.PREFERRED_SIZE, 310,

javax.swing.GroupLayout.PREFERRED_SIZE)

.addComponent(TelaSobre4)

.addComponent(TelaSobre3)

.addComponent(TelaSobre2)

.addComponent(TelaSobre1)

.addComponent(TelaSobre6))

.addContainerGap(38, Short.MAX_VALUE))

);

layout.setVerticalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addContainerGap(27, Short.MAX_VALUE)

.addComponent(TelaSobre1)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(TelaSobre2)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(TelaSobre3)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(TelaSobre6)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)

.addComponent(TelaSobre4)

.addGap(18, 18, 18)

.addComponent(TelaSobre5,

javax.swing.GroupLayout.PREFERRED_SIZE, 282,

javax.swing.GroupLayout.PREFERRED_SIZE)

.addContainerGap())

);
pack();
    setLocationRelativeTo(null);
}// </editor-fold>

/**
 * @param args the command line arguments
 */
public static void main(String args[]) {
    /* Set the Nimbus look and feel */
    //<editor-fold defaultstate="collapsed" desc=" Look and feel
setting code (optional) ">

/* If Nimbus (introduced in Java SE 6) is not available, stay

with the default look and feel.

* For details see

<a href="http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html" class="onebox" target="_blank">http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html</a>

*/

try {

for (javax.swing.UIManager.LookAndFeelInfo info :

javax.swing.UIManager.getInstalledLookAndFeels()) {

if (“Nimbus”.equals(info.getName())) {

javax.swing.UIManager.setLookAndFeel(info.getClassName());

break;

}

}

} catch (ClassNotFoundException ex) {

java.util.logging.Logger.getLogger(TelaSobre.class.getName()).log(java.util.logging.Level.SEVERE,

null, ex);

} catch (InstantiationException ex) {

java.util.logging.Logger.getLogger(TelaSobre.class.getName()).log(java.util.logging.Level.SEVERE,

null, ex);

} catch (IllegalAccessException ex) {

java.util.logging.Logger.getLogger(TelaSobre.class.getName()).log(java.util.logging.Level.SEVERE,

null, ex);

} catch (javax.swing.UnsupportedLookAndFeelException ex) {

java.util.logging.Logger.getLogger(TelaSobre.class.getName()).log(java.util.logging.Level.SEVERE,

null, ex);

}

//
/* Create and display the form */
    java.awt.EventQueue.invokeLater(new Runnable() {
        public void run() {
            new TelaSobre().setVisible(true);

        }
    });
}


// Variables declaration - do not modify
private javax.swing.JLabel TelaSobre1;
private javax.swing.JLabel TelaSobre2;
private javax.swing.JLabel TelaSobre3;
private javax.swing.JLabel TelaSobre4;
private javax.swing.JLabel TelaSobre5;
private javax.swing.JLabel TelaSobre6;
// End of variables declaration

}

J
Solucao aceita

Dentro do construtor da sua classe, logo acima do initcomponents!

public TelaSobre() {
    setUndecorated(true);
    initComponents();
}
J

Obrigado pela ajuda Jonatha, deu certo

Criado 30 de outubro de 2018
Ultima resposta 5 de nov. de 2018
Respostas 4
Participantes 2