my dog learned polymorphism*
The moose likes Swing / AWT / SWT and the fly likes how to run the panel code in net beans? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "how to run the panel code in net beans?" Watch "how to run the panel code in net beans?" New topic
Author

how to run the panel code in net beans?

devashish ttripathi
Greenhorn

Joined: Dec 08, 2012
Posts: 5
just have a panel code, how to run the panel code in net beans...
i have a jpanel and want to run the panel in the java netbeans, how should i implement it. I am a starter so please help me getting this.
devashish ttripathi
Greenhorn

Joined: Dec 08, 2012
Posts: 5
here is my jpanel code of which i was talking about:-

how should i implement it to run this code in java netbeans....?
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> how should i implement it to run this code in java netbeans....?

the question has nothing to do with Swing - try a netbeans forum
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41134
    
  45
Not sure about the NetBeans part, but you need an application class (with a "main" method) to run code. That class would need to create a Swing object that can be displeyed -possibly a JFrame-, and to which you can add the JPanel.


Ping & DNS - my free Android networking tools app
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1076
    
  10

Hi devashish,
Welcome to the Ranch!

Please UseCodeTags when posting code. I have added them for you this time.

Like Ulf has already pointed out, you need to write a program with main method and building a JFrame.
The tutorial has a page about writing a small Swing application.
And in NetBeans, you can run any file that has a main method - just right click on the file and select Run File.


Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to run the panel code in net beans?
 
Similar Threads
assertion
net beans
Test result set for listbox
Jboss with Net Beans Configuration Help
Run NetBeans Application in windows using terminal in linux