0
import java.awt.EventQueue;

import javax.swing.JFrame;


public class tatat extends JFrame {

	private static final long serialVersionUID = 1L;

	public static void main(String args[]) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					tatat frame = new tatat();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	public tatat() {
		super();
		setBounds(100, 100, 500, 375);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
	}

}

I'm new to java. I'm confused on how to bring "public tatat ()" into the main method above without writing a separate statement as shown above? Please advise. Thanks.

3
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by ~s.o.s~
0

What you are saying doesn't make any sense, but you could create a separate class and call the constructor "tatat" inside that class's main method.

But if are not familiar with constructors and using multiple classes from different files in one single main, then you should not been writing swing, even though the NetBeans will auto generate everything for you

0

As I said I'm new to java, and I don't think it swing is a problem, I'm learning..... anyway thanks for your advise.

0

> As I said I'm new to java

Then you should try reading the stickies at the top of this forum and get your Java basics cleared up before messing around with complicated stuff like GUI etc.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.