File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Put A Frame In A Shell? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Put A Frame In A Shell?" Watch "Put A Frame In A Shell?" New topic

Put A Frame In A Shell?

Mark Newton
Ranch Hand

Joined: Jan 31, 2006
Posts: 129

Hopefully this is a simple question with an equally simpler answer...

I have an application, built using Swing, and AWT (ie, no SWT). I've had one tiny problem, which is the application icon in the title bar, which doesn't display properly using a Frame or JFrame - it only takes one image, so doesn't scale properly when it needs to.

I've found the perfect solution with SWT. If I use a Shell, I can set an array of different sized images, and cleverly the correct one gets chosen and displayed. This works brilliantly, as a separate application, so I now need to somehow get the main application 'into' my Shell. I don't have time to re-write all my Swing code (things like modal dialogs need a Component as their parent), so am hoping that there's some easy way to just put the main JFrame containing my application into a Shell, or something similar.

Any help greatly appreciated!
David Payne.
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

There are some very limited, platform-specific hacks to let you combine Swing and SWT in the same application. I definitely wouldn't think your issue warrants adding that level of headache to your application!

[Jess in Action][AskingGoodQuestions]
Mark Newton
Ranch Hand

Joined: Jan 31, 2006
Posts: 129
Great, thanks, that's close enough to 'can't be done' for me! Just have to persuade the customer now...
I agree. Here's the link:
subject: Put A Frame In A Shell?
It's not a secret anymore!