Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to run the panel code in net beans?

 
devashish ttripathi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • 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
  • 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....?
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • 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
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • 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.
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1101
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic