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 - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -