the internal frame could be transparent here is the code
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import javax.swing.*;
public class Frame1 extends JFrame {
//Construct the frame
BorderLayout borderLayout1 = new BorderLayout();
JButton jButton1 = new JButton();
JDesktopPane jPane1 = new JDesktopPane();
public Frame1() {
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
try {
jbInit();
}
catch (Exception e) {
e.printStackTrace();
}
}
//Component initialization
private void jbInit() throws Exception {
this.getContentPane().setLayout(borderLayout1);
this.setSize(new Dimension(600, 450));
jButton1.setText("jButton1");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
jButton1_actionPerformed(e);
}
});
this.setTitle("Frame Title");
this.getContentPane().add(jButton1, BorderLayout.SOUTH);
this.getContentPane().add(jPane1, BorderLayout.CENTER);
}
//Overriden so we can exit on System Close
protected void processWindowEvent(WindowEvent e) {
super.processWindowEvent(e);
if (e.getID() == WindowEvent.WINDOW_CLOSING) {
System.exit(0);
}
}
void jButton1_actionPerformed(ActionEvent e) {
JInternalFrame f=new MyInternalFrame();
f.setVisible(true);
jPane1.add(f);
}
public static void main(
String args[]) {
Frame1 frame1= new Frame1();
frame1.show();
}
}
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import javax.swing.*;
class MyInternalFrame extends JInternalFrame {
Shape clipShape;
public MyInternalFrame() {
super("Hubba", true, true, true, true);
setSize(200,200);
}
public void setBounds(int x, int y, int w, int h) {
// The below looks better, as you can see (and use) the close window icon
// However it's unbelievably slow.
// The version with a plain ellipse is just slow.
/*
Area clipArea=new Area(new Ellipse2D.Float(0,0,w,h));
// Couldn't find any way to get menubar height, so I'm guessing.
int barh=20;
clipArea.add(new Area(new Rectangle(0,0,barh,barh)));
clipArea.add(new Area(new Rectangle(w-barh-1,0,barh,barh)));
clipShape=clipArea;
*/
clipShape=new Ellipse2D.Float(0,0,w,h);
super.setBounds(x, y, w, h);
}
public boolean contains(int x, int y) {
if (clipShape==null) return false;
return clipShape.contains(x, y);
}
public void paint(Graphics g) {
g.setClip(clipShape);
super.paint(g);
}
}
i hope u get ur answer
farrukh_phd