Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Canvas object not appearing

 
Liz Costelloe
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This runs okay now. You might change the class names to prevent name-clashing when you compile/run it.
 
Liz Costelloe
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic