Hi, I'm using eclipse to write my programs
but for some reason this code does not work
can someone tell me whats wrong with it?
here is the code. and sorry if i didnt use the code wrapper properly.

package dataTypes;
import javax.swing.*;

public class Window
    JPanel pnl = new JPanel();

    public static void main(String[] args)
        // TODO Auto-generated method stub
        Window gui = new Window();

    public Window()
        super( "hello kishan" );
        setSize( 500, 200);
        setDefaultCloseOperation( EXIT_ON_CLOSE);
        add( pnl ):
        setVisible( true );


Edited by pritaeas: fixed formatting

9 Years
Discussion Span
Last Post by Nathan Campos

thnx for trying to help me out
but that doesnt work!

thnx for trying to help me out
but that doesnt work

Edited by Nick Evan: Fixed formatting

If you truly made an effort to use the code tags you would have used them correctly. There is a sticky at the top of the forum showing how to use them. There is a button on the post reply box that inserts code tags. You can also "reply w/ quote" to this post and you'll see how to do it correctly.
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.