java - JFrame setsize with x by x input is not square -


i playing around jframe , when this:

public class ui extends jframe {     public ui() {         pack();         setsize(50, 50);         setlocationrelativeto(null);         setvisible(true);          }     public static void main(string[] args) {         ui test =new ui();     } } 

the frame not square, when change (50,50) larger (500,500) square. can tell why is?

setsize(50,50) small size jframe, jframe root component @ least use proper size it. contains title control box , because of it, square small size difficult. alternative can use jwindow small square size.


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -