aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Canvas object not appearing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Canvas object not appearing" Watch "Canvas object not appearing" New topic
Author

Canvas object not appearing

Liz Costelloe
Greenhorn

Joined: Nov 01, 2003
Posts: 17
Hi,

I have an applet, inside which there is a tabbed pane. In the first pane there is a panel, the panel uses GridLayout (1 column, 2 rows). In the top half of this panel is some text areas and a button. In the bottom half I have added a canvas, however the canvas does not appear. Everything else in the applet does appear fine.

Code is listed here, I'd be grateful if anyone has any suggestions as to why the canvas might not be appearing.

Many thanks in advance.



[ April 10, 2006: Message edited by: Liz Costelloe ]

[ April 10, 2006: Message edited by: Liz Costelloe ]
[ April 10, 2006: Message edited by: Liz Costelloe ]
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
http://java.sun.com/products/jfc/tsc/articles/mixing/

could be the reason, but I cannot run your code to test.
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
This runs okay now. You might change the class names to prevent name-clashing when you compile/run it.
Liz Costelloe
Greenhorn

Joined: Nov 01, 2003
Posts: 17
Hi Craig,

Thanks for taking the time to implement that solution, I'm really grateful. It works perfectly, I can't thank you enough.

I tried using your solution without the JFrame so I could embed my applet in the JSP that I'm using, but the Canvas doesn't seem to appear if I do that. Using the JFrame the applet pops out of the page and the canvas appears. I'll figure out if I can embed the applet in the page at a later stage; it's only for asthetics that I want to do this really. The functionality is there now and that is without a doubt my primary concern.

Also I took out the 4th line of class LPTest because the applets security won't let me do this:



Anyway thank you again, I was beginning to get very frustrated, I really appreciate that you took time out to look through this for me.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Canvas object not appearing