dcsimg
I am getting an error message "FileName.jar doesn't have beans !" for all my Beans.
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   G_Prakasah
Posted On:   Tuesday, March 9, 2004 05:23 AM

Dear Friends, I am new to Java Beans. I tried writing Simple Java Beans program(Spectrum.java). =========================================== Spectrum.java package spectrum; import java.awt.*; import java.beans.*; public class Spectrum extends Canvas { private boolean vertical; public Spectrum() { vertical = true; setSize(100,100); } public boolean getVertical() { return vertical; } public void setVertical(boolean vertical) { this.vertical = vertical; repaint(); } public void paint(Graphics g) { float saturation = 1.0f; float brightness = 1.0f;    More>>

Dear Friends,

I am new to Java Beans. I tried writing Simple Java Beans program(Spectrum.java).


===========================================

Spectrum.java

			
package spectrum;
import java.awt.*;
import java.beans.*;

public class Spectrum extends Canvas {
private boolean vertical;

public Spectrum() {
vertical = true;
setSize(100,100);
}
public boolean getVertical() {
return vertical;
}

public void setVertical(boolean vertical) {
this.vertical = vertical;
repaint();
}

public void paint(Graphics g) {
float saturation = 1.0f;
float brightness = 1.0f;
Dimension d = getSize();

if(vertical) {
for(int y=0; y
float hue = (float)y/(d.height-1);
g.setColor(Color.getHSBColor(hue, saturation, brightness));
g.drawLine(0, y, d.width-1, y);
}
} else {
for(int x=0; x
float hue = (float)x/(d.width-1);
g.setColor(Color.getHSBColor(hue, saturation, brightness));
g.drawLine(x, 0, x, d.height-1);
}
}
}
}


====================================================

Manifest File


Name: spectrum/Spectrum.class

Java-Bean: True

====================================================



Can u please find out, what mistake is there in that program. Please help me.




Byeee....

GP    <<Less
About | Sitemap | Contact