On Fri, 27 Nov 1998, Karthik Vishwanath wrote:
> Hi all,
> when i create an application as :
> public class Myapp extends Frame
> {
> public Myapp()
> {
> super("MyApp");
> setSize(100,100);
> show();
> }
> }
>
> and run it, the setSize does not resize the frame.
>
> Can anyone tell me what must i do inorder to resize a frame?
>
> -Karthik.
Karthik
I did expect to see more sensible replies than I have thus far.
I expanded your code to what you SHOULD have posted - with this example,
the whole program isn't excesive.
This works here:
import java.awt.*;
class Myapp extends Frame
{
public Myapp()
{
super("MyApp");
setSize(1100,100);
show();
}
public static void main(String [] s)
{
Myapp m = new Myapp();
// m.setSize(1100,100);
// m.show();
}
}
I've not read through the docs, but setSize(100,100); does not resize here
either.
btw Arguably the setsize/show are better done in the main() method: this
help give you the flexibiliy of using the app in a different context and
perhaps setting its frame to another size.
Sometimes it's a good idea to use getToolkit() to find the underlying
screen size and making your window some proportion of this so it is about
the same physical size regardless of screen resolution.
Cheers
John Summerfield
http://os2.ami.com.au/os2/ for OS/2 support.
Configuration, networking, combined IBM ftpsites index.