[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

[JAVA] JFrame size



Hej alle

Jeg sidder og forsøger at sætte størrelsen på en JFrame ud fra en ønsket størrelse på dens content pane, og jeg kan ikke helt genneskue, hvordan det skal gøres.
Jeg vil gerne have, at når min JFrame's størrelse er sat, så er dens content pane 400 x 400 pixels stor og gør følgende:


       width = 400;
       height = 400;
       setSize(width, height);
       width += (getSize().width - getContentPane().getSize().width);
       height += (getSize().height - getContentPane().getSize().height);
       setSize(width, height);

Og det virker nogle gange, men nogle gange bliver framen 400x400, andre gange 798x816 og andre gange igen meget mindre. Det virker lidt tilfældigt.
Findes der en god løsning på dette ?


Venlig hilsen
Robert


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2006-09-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *