Bom dia! Obrigado pela ajuda.
Funcionou em parte: a janela inicia maximizada, com o botão de maximização desabilitado, somente permitindo fechar ou minimizar, mas se você der dois cliques na barra de títulos, ela reduz-se à barra de titulo da janela, e aí… não tem como restaurar. Vou colocar o código do meu estudo aqui:
package visao;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.border.EmptyBorder;
import java.awt.GridBagLayout;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JLabel;
import java.awt.GridBagConstraints;
import javax.swing.JToolBar;
import java.awt.Insets;
import javax.swing.JButton;
import javax.swing.JTextArea;
import javax.swing.border.TitledBorder;
import java.awt.Dimension;
import javax.swing.border.LineBorder;
import java.awt.Color;
import javax.swing.ImageIcon;
public class Teste extends JFrame {
/**
*
*/
private static final long serialVersionUID = 1L;
private JPanel contentPane;
/**
* Launch the application.
*/
public static void main(String[] args) {
/* Use an appropriate Look and Feel */
try {
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
//UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
} catch (UnsupportedLookAndFeelException ex) {
ex.printStackTrace();
} catch (IllegalAccessException ex) {
ex.printStackTrace();
} catch (InstantiationException ex) {
ex.printStackTrace();
} catch (ClassNotFoundException ex) {
ex.printStackTrace();
}
/* Turn off metal's use of bold fonts */
UIManager.put("swing.boldMetal", Boolean.FALSE);
//Schedule a job for the event dispatchi thread:
//creating and showing this application's GUI.
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Teste frame = new Teste();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public Teste() {
setTitle("Janela");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setExtendedState(MAXIMIZED_BOTH);
setVisible(true);
setResizable(false);
JMenuBar menuBar = new JMenuBar();
setJMenuBar(menuBar);
JMenu mnNewMenu = new JMenu("T\u00F3pico");
menuBar.add(mnNewMenu);
JMenuItem mntmNewMenuItem = new JMenuItem("Novo");
mnNewMenu.add(mntmNewMenuItem);
JMenuItem mntmAbrir = new JMenuItem("Abrir");
mnNewMenu.add(mntmAbrir);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
GridBagLayout gbl_contentPane = new GridBagLayout();
gbl_contentPane.columnWidths = new int[]{0, 0, 0};
gbl_contentPane.rowHeights = new int[]{0, 34, 0, 0, 0};
gbl_contentPane.columnWeights = new double[]{1.0, 1.0, Double.MIN_VALUE};
gbl_contentPane.rowWeights = new double[]{0.0, 1.0, 0.0, 0.0, Double.MIN_VALUE};
contentPane.setLayout(gbl_contentPane);
JToolBar toolBar = new JToolBar();
toolBar.setFloatable(false);
GridBagConstraints gbc_toolBar = new GridBagConstraints();
gbc_toolBar.fill = GridBagConstraints.HORIZONTAL;
gbc_toolBar.insets = new Insets(0, 0, 5, 5);
gbc_toolBar.gridx = 0;
gbc_toolBar.gridy = 0;
contentPane.add(toolBar, gbc_toolBar);
JButton btnNewButton = new JButton("BT1");
btnNewButton.setIcon(null);
toolBar.add(btnNewButton);
JButton btnNewButton_1 = new JButton("BT2");
btnNewButton_1.setIcon(null);
toolBar.add(btnNewButton_1);
JPanel painelDeVideo = new JPanel();
painelDeVideo.setPreferredSize(new Dimension(640, 480));
painelDeVideo.setBorder(new TitledBorder(new LineBorder(new Color(184, 207, 229)), "\u00C1rea de V\u00EDdeo", TitledBorder.LEADING, TitledBorder.TOP, null, null));
GridBagConstraints gbc_painelDeVideo = new GridBagConstraints();
gbc_painelDeVideo.insets = new Insets(0, 0, 5, 5);
gbc_painelDeVideo.gridx = 0;
gbc_painelDeVideo.gridy = 1;
contentPane.add(painelDeVideo, gbc_painelDeVideo);
JPanel painelDeImagem = new JPanel();
painelDeImagem.setPreferredSize(new Dimension(320, 240));
painelDeImagem.setBorder(new TitledBorder(null, "\u00C1rea de Imagem", TitledBorder.LEADING, TitledBorder.TOP, null, null));
GridBagConstraints gbc_painelDeImagem = new GridBagConstraints();
gbc_painelDeImagem.insets = new Insets(0, 0, 5, 0);
gbc_painelDeImagem.gridx = 1;
gbc_painelDeImagem.gridy = 1;
contentPane.add(painelDeImagem, gbc_painelDeImagem);
JTextArea textArea = new JTextArea();
textArea.setWrapStyleWord(true);
textArea.setLineWrap(true);
GridBagConstraints gbc_textArea = new GridBagConstraints();
gbc_textArea.gridwidth = 2;
gbc_textArea.insets = new Insets(0, 0, 5, 5);
gbc_textArea.fill = GridBagConstraints.BOTH;
gbc_textArea.gridx = 0;
gbc_textArea.gridy = 2;
contentPane.add(textArea, gbc_textArea);
JLabel lblNewLabel = new JLabel("Barra de Status");
GridBagConstraints gbc_lblNewLabel = new GridBagConstraints();
gbc_lblNewLabel.insets = new Insets(0, 0, 0, 5);
gbc_lblNewLabel.anchor = GridBagConstraints.SOUTH;
gbc_lblNewLabel.fill = GridBagConstraints.HORIZONTAL;
gbc_lblNewLabel.gridx = 0;
gbc_lblNewLabel.gridy = 3;
contentPane.add(lblNewLabel, gbc_lblNewLabel);
}
}
Experimente rodar e se der, manda um feedback, ok?
Abraços,
Augusto