• 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

javabeans???

 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi.
i'm just new to javabeans and have tried the javabeans tutorial from javasoft.com. I have troubled making the example program there into a jar files.
**********************
SimpleBean.java
_____________________
import java.awt.*;
import java.io.Serializable;
public class SimpleBean extends Canvas
implements Serializable {
private Color color = Color.green;
//getter method
public Color getColor() {
return color;
}
//setter method
public void setColor(Color newColor) {
color = newColor;
repaint();
}
//override paint method
public void paint (Graphics g) {
g.setColor(color);
g.fillRect(20,5,20,30);
}
//Constructor: sets inherited properties
public SimpleBean() {
setSize(60,40);
setBackground(Color.red);
}
}
manifest.tmp
________________________
Name: SimpleBean.class
Java-Bean: True
*************************************
I compiled already the SimpleBean.java and put it in the same directory with the manifest.tmp. As i execute the command :
jar cfm SimpleBean.jar manifest.tmp SimpleBean.class
an error occured:
E:\java\javabeans>jar cfm SimpleBean.jar manifest.tmp SimpleBean.class
java.io.IOException: invalid manifest format
at java.util.jar.Manifest.read(Manifest.java:185)
at java.util.jar.Manifest.<init>(Manifest.java:56)
at sun.tools.jar.Main.run(Main.java:125)
at sun.tools.jar.Main.main(Main.java:904)
 
reply
    Bookmark Topic Watch Topic
  • New Topic