This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Embedded Applet in swing app causes paint problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Embedded Applet in swing app causes paint problem" Watch "Embedded Applet in swing app causes paint problem" New topic
Author

Embedded Applet in swing app causes paint problem

Robert T. Johnson
Greenhorn

Joined: Mar 09, 2010
Posts: 5
What I have is an Application that uses swing components (jpanel, jbutton, jlabel, etc), however I have to use an old PDF viewer (upgrade is not an option) that is based on java.awt.Applet (com.adobe.acrobat.Viewer). The problem comes when I am trying to display it, it draws properly however since this PDF viewer is inside a JScrollPane, it draws over all of the swing components (over the scroll bars and the menu).

Does anyone know how to make the PDF viewer act nicely and not to draw over other components.

Any suggestions are appriciated

I have also posted this on stackoverflow. Will post if any of their answers solves my problem.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39576
    
  27
Mixing AWT and Swing components is a fraught business. If you can't upgrade to PDF Renderer -I'm sure you're aware of how obsolete the Acrobat Viewer Bean is- then your best bet is to make this an AWT app instead of a Swing app. Or make this an AWT window that's started from within a Swing application.


Ping & DNS - updated with new look and Ping home screen widget
Robert T. Johnson
Greenhorn

Joined: Mar 09, 2010
Posts: 5
Yes I do know about the dangers of mixing AWT with swing, and I will see if I am allowed to upgrade the bean. And no I dont believe I can downgrade to AWT


Thank I will try this first thing tomorrow morning to see if I can take your last suggestion (make this an AWT window that's started from within a Swing application).

Thanks for your suggestion
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2095
    
    7
The most recent versions of the JDK now support the Mixing of AWT and Swing Components.
Robert T. Johnson
Greenhorn

Joined: Mar 09, 2010
Posts: 5
Ok so I got a very good response from Stackoverflow http://java.sun.com/products/jfc/tsc/articles/mixing/ which seams to answer the technical side of the question, as for now I will leave this as a static frame.

Thank you for your answers as well, they were helpful as well.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Embedded Applet in swing app causes paint problem
 
Similar Threads
Wierd graphics problem....
Yet more swing applet web browser problems
Embed Word/PDf documents in Swing
Not getting control in Servlet
Having a hard time figuring out how to accomplish this in Swing