Perry Smith

Java Questions & Answers

Home / Java Q & A Archive Page 4 / Java Q & A Archive / Java Main Page

AWT building a new component
Tuesday, 23-Feb-99 15:58:24

208.229.43.126 writes:

When you are trying to create a new component in Java that contains a canvas, why does the canvas come out to be 10x10? I don't want to set the size of the canvas. I'm trying to use getPreferredSize() method, but it returns 0.

HELP!


Response
Re: AWT building a new component
Saturday, 06-Mar-99 01:18:15

202.54.7.29 writes:

unless u set the size of a canvas, or unless u set the size of the frame that holds the canvas, u will not get a viewable sized window.. that's the way it is.. u have to setSize(width,ht) for the frame.. and add the canvas...



Home / Java Q & A Archive Page 4 / Java Q & A Archive / Java Main Page