swing - Java JFrame Size according to screen resolution -


i created java gui using myeclipse matisse. when screen resolution 1024x768 works fine when change resolution gui not working fine. want gui window should re-sized according screen resolution extending jframe create main window.

 public class myclass extends jframe {        //i putting controls here.        dimension screensize = toolkit.getdefaulttoolkit().getscreensize();       setbounds(0,0,screensize.width, screensize.height);       setvisible(true);        pack()      } 

this not working, ever do, setting size hardcoded or toolkit using, frame size remains same.

you calling pack() changes frame size fits components inside. that's why shrinking think. remove pack() line , should work.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -