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

Popular posts from this blog

Issues changing the value of an element in an array in matlab -

php - MySQLi binding parameters in a prepared statement doesn't work unless inserted after "WHERE" -

vb.net - Alternative to the T-SQL AS keyword -