java - How to set rectangle bounds to the frame? -
looks i'm doing in instructions frame doesn't work. if put usual bounds stays same. doing wrong?
import java.awt.rectangle; import javax.swing.jframe; import javax.swing.joptionpane; public class translatedemo { public static void main(string[] args) { // construct frame , show jframe frame = new jframe(); frame.setdefaultcloseoperation(jframe.exit_on_close); frame.setvisible(true); rectangle r1 = new rectangle(0,0,60,30); frame.setbounds(r1); } }
some notes made:
- that small rectangle (this important, because os's won't allow set bounds of jframe small, or else minimize, exit, etc. buttons collide.
- i understand using tutorial or demo of sorts; but, in reality, setting bounds of jframe isn't effective method accomplishing anything. using layout better in situation (but, wrong :) ).
please more specific in error experiencing, if wish receive better answer. hope helps you, , best of luck!
Comments
Post a Comment