swing - in java, when do I get access to this instance if not in main()? -


so trying make simple swing app learning purposes, , bit confused this. understand entry-point of program main() function, , object doesn't exist @ point can't refer this, how , when know instance has been created?

my class extends jframe has visual presence when execute it, , right after created, want position on specific position on screen. option seems to use new classname(), create second instance instead....so yeh, total beginner , confused

you need create instance of class in main:

myclass c = new myclass("a nice frame title here"); 

then in class constructor or methods:

public myclass(string title) {    //you can use here }  public void method() {    //and here } 

Comments

Popular posts from this blog

c# - OpenXML hanging while writing elements -

php - regexp cyrillic filename not matches -

sql - Select Query has unexpected multiple records (MS Access) -