Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to make JPanel appear in beanbox  RSS feed

 
Vidur Koushik
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wrote the following code to create a Jpanel and button.I would like to make a jar file out of this which would be displayed in the beanbox.How to do it?



 
Brian Cole
Author
Ranch Hand
Posts: 936
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vidur Koushik wrote:I wrote the following code to create a Jpanel and button.I would like to make a jar file out of this which would be displayed in the beanbox.How to do it?

Well, I see two issues here:

1) Your t1 bean (which ought to start with a capital letter unless you want to flout Java naming conventions) doesn't do anything. Or rather, it instantiates a button and a panel, puts the button inside the panel, and then does nothing with the panel. So it does do stuff, but nothing that has any effect. [If you want your bean to be a panel, then you should probably replace "extends Canvas" with "extends JPanel" and replace panel.add() with this.add(). Or maybe you don't want your bean to be a panel.]

2) Once you have an actual bean, how do you package it so it can appear in the beanbox? There are steps to do this. Here's a page that's very old but does describe adding the required entries into the JAR's manifest.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!