What code should I surround with run(){}?
I finished a 2000-line Swing + SQL program and I'd like to add to it a login window before everything is initialized. The login window is a JFrame class, instanced from the main program.

So my main app needs to implement Runnable. All I want with the thread I'm creating out of it is waiting -with wait()- until the login thread finishes -and uses notify()-.

My program consist of dozens of visual components, methods, main(), constructor, initializer, etc. What's the minimum amount of code I should surround with run(){}?

This is an example of what I want to do. It's not by any means correct (I supppose) but you'll get it:

	private void initialize() { // Called from main()

		this.setBounds(100, 200, 1024, 576);
		this.setTitle("Main app");
		this.setVisible(false);

		Runnable runnable = new Visual_Login();
		Thread login_thread = new Thread(runnable);

		login_thread.run();		
		main_thread.wait();

		this.setVisible(true);
		this.setContentPane(getJContentPane());
		
	}

(...I hope I'm understanding concurrency well)

Thank you in advance.
What code should I surround with run(){}?
===

I finished a 2000-line Swing + SQL program and I'd like to add to it a login window before everything is initialized. The login window is a JFrame class, instanced from the main program.

So my main app needs to implement Runnable. All I want with the thread I'm creating out of it is waiting -with wait()- until the login thread finishes -and uses notify()-.

My program consist of dozens of visual components, methods, main(), constructor, initializer, etc. What's the minimum amount of code I should surround with run(){}?

This is an example of what I want to do. It's not by any means correct (I supppose) but you'll get it:

	private void initialize() { // Called from main()

		this.setBounds(100, 200, 1024, 576);
		this.setTitle("Main app");
		this.setVisible(false);

		Runnable runnable = new Visual_Login();
		Thread login_thread = new Thread(runnable);

		login_thread.run();		
		main_thread.wait();

		this.setVisible(true);
		this.setContentPane(getJContentPane());
		
	}

(...I hope I'm understanding concurrency well)

Thank you in advance.