java - JFrame does not appear -
i'm using intelij idea platform.
i have following code:
package gui.test; import javax.swing.*; public class frame extends jframe{ frame(){} public void main (string[] args){ new frame(); } }
i expected see jframe after compiling code, nothing appeared. kind of problem can be?
frames not visible default--use the
setvisible(true);
method in order display frames. might want take @ other options such as
setsize(int width, int height);
method resize frame,
setlocation(int xloc, int yloc);
to move frame, and
settitle(string title);
to set title of component.
aside, practice use variable hold components can manipulated when needed.
Comments
Post a Comment