java - after compilling code JFrame does not appear -


i'm using intelij idea platform.

i have following code:

package gui.test; import javax.swing.*;  public class ramka extends jframe{      ramka(){          setvisible(true);         setsize(100,100);      }      public void main (string[] args){         new ramka();     } } 

i expected see jframe after compiling code, nothing appeared. kind of problem can be?

also must admit, haven't possibility run method "main". inteligidea propose me compile ramka.java. after compilling intelijideay says, compilation complited sucessfully, thats , nothing happened. in previous exersises allways ran method "main".

you should this:

public static void main (string[] args){             java.awt.eventqueue.invokelater(new runnable() {             public void run() {                 new ramka().setvisible(true);             }         });     } 

besides missing static identifier @ main, have make sure frame runs in right thread check "concurrency" swing


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -