• Post Reply Bookmark Topic Watch Topic
  • New Topic

Put A Frame In A Shell?  RSS feed

 
Mark Newton
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Mark Newton
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Great, thanks, that's close enough to 'can't be done' for me! Just have to persuade the customer now...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!