List of usage examples for javax.swing JInternalFrame setOpaque
@BeanProperty(expert = true, description = "The component's opacity") public void setOpaque(boolean isOpaque)
From source file:Main.java
public Main() { JMenuBar bar = new JMenuBar(); JMenu addMenu = new JMenu("Add"); JMenuItem newFrame = new JMenuItem("Internal Frame"); addMenu.add(newFrame);//from w ww . ja v a2 s . c om bar.add(addMenu); setJMenuBar(bar); final JDesktopPane theDesktop = new JDesktopPane(); getContentPane().add(theDesktop); newFrame.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JInternalFrame frame = new JInternalFrame("Internal Frame", true, true, true, true); Container c = frame.getContentPane(); MyJPanel panel = new MyJPanel(); c.add(panel, BorderLayout.CENTER); frame.setSize(200, 200); frame.setOpaque(true); theDesktop.add(frame); } }); setSize(500, 400); setVisible(true); }