• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to run the panel code in net beans?

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
here is my jpanel code of which i was talking about:-

how should i implement it to run this code in java netbeans....?
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
> how should i implement it to run this code in java netbeans....?

the question has nothing to do with Swing - try a netbeans forum
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic