I am trying to develop an application in which i need to open an internal frame in a simple frame......with the click of a menu......is it possible????How?????The internal frame does open in a new frame but doesnot open in the same frame....what can be the reason......... :cry:

did you set the parent frame correctly?

how do i do that???...the coding for my parent frame is as under...

JFrame frame = new JFrame("Violet Linux");
		frame.addWindowListener(new BasicWindowMonitor());
		frame.setJMenuBar(new violet());
		frame.pack();
		frame.setVisible(true);

do you add your JInternalFrames to the contentpane for your application?
If you don't I guess they end up as children to the desktop rather than the application.

well if the coding is not lengthy, can u plz post the codin for makin a frame the parent frame....i tried...

JFrame parent;
parent=this;

but i am supposed to write this in addactionlistener method.....and so it just doesnt work out

well if the coding is not lengthy, can u plz post the codin for makin a frame the parent frame....i tried...

JFrame parent;
parent=this;

but i am supposed to write this in addactionlistener method.....and so it just doesnt work out

http://java.sun.com/docs/books/tutorial/uiswing/components/internalframe.html


If you are lazy like me I would have just overriden JDialog and set the location to the size of this dialog minus that of the larger... or something like that.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.