Art Vandalay

Greenhorn
+ Follow
since Nov 09, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Art Vandalay

I was able to hack away at the existing code very minimally, and change the JFrame to JInternalFrame. Now it behaves mostly as I'd like. However it does create several JDialogs and are not playing nicely (they're not constrained to within the JFrame). Any ideas?
14 years ago
Rob and Fred, thanks for the timely responses. Rob, I tried your idea. It does part of the job. Basically, I see it takes the contents of JFrame2 and dumps them statically into JFrame1. Perhaps... no I'm certain... I did not explain the problem properly. So to add to my previous problem statement and hopefully succinctly summarize, I'm basically looking to have a JFrame, and various JDialogs owned, or contained within a "master" JFrame, with the same type of relationship that a JInternalFrame has to a JFrame. In other words, I wish to have the JFrame and JDialogs remain looking like a Dialog, with all the associated title bars, etc. However, they will be constrained (location wise) by the "parent" JFrame. Really, if I could figure out a way to restrict their movement so they couldn't be dragged outside the area of the master JFrame (which would be always placed in back), that would be an adequate solution. Because that gives the impression that the master JFrame is the "container" whether it really is or not. Hope I'm doing a decent job describing the issue.

Regards.

14 years ago
Is it possible for a JFrame to contain another JFrame? This is a question posed by the the following post from 2008.

https://coderanch.com/t/346079/Swing-AWT-SWT-JFace/java/JFrame

I have created a simple stand alone JFrame-based graphical application that needs to be the background for various other frames/dialogs. I tested my stand alone with JInternalFrames, and it worked just the way I wanted. However, when I went to integrate with a larger app (which is it's intended purpose), I discovered that app was JFrame-based as well. Looking through that code, it seems very problematic to try and change it to JInternalFrame. In addition, the main project also launches various JDialog based windows as part of it's normal operation.

The entire purpose of my app when bundled with the main app is to act as a background or container for that app. Specifically, I have two requirements:

1) My JFrame needs to always be on the bottom, behind all other frames/dialogs.
2) My JFrame needs to be the bounding area of all the other frames/dialogs.

Working with JInternalFrames, this comes naturally. But as it stands now, the best I can do is instantiate my app, then the main app as well. And that main app is in no way bounded to or by my JFrame. Does anybody know a way around this? I'm trying to alter the main apps code as littel as possible and do all the work or fancy stuff in my code. I would appreciate any advice that anybody has to send my way. Here is an tiny example of what I'm trying to do, that is failing.



Thanks again, and any alternative approaches are, of course, welcome.
14 years ago