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

Javabean

 
Prabha Balu
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai,
I have a queries regarding the JavaBeans. I have created the one file named as intTextBox.java, compiled creating the class files.
When i was trying to create a jar file like this("jar cfm intTextBox.jar intTextBox.mft,intTextBox.class"), its created. But when i am trying to load in the bean container its giving errors like this "jar file c:\intTextBox.jar didn't have any beans" is the main error.

please try to give me the remedy.
Bye
Prabha
 
louise rochford
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Prabha,
Could you post your intTextBox.java code?
Maybe it doesn't conform to the bean spec?

Regards,
Louise
 
Prabha Balu
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai,
Here the i am forwarding my bean program and mft programs.
//"intTextBox.java"
import java.awt.*;
import java.awt.event.*;
import java.beans.*;

public class intTextBox extends TextField implements KeyListener
{
public intTextBox()
{
super(15);
this.addKeyListener(this);
}

public void keyPressed(KeyEvent k)
{
int a=k.getKeyCode();
if(((a>=48)&&(a<=57))||(a==8)||(a==37)||(a==39)||(a==35)||(a==16)||(a==20)||(a==127)||(a==36)||(a==144))
k.setKeyCode(a);
else
{
this.setText(this.getText());
k.setKeyCode(8);
Toolkit.getDefaultToolkit().beep();
}
}
public void keyTyped(KeyEvent k){ }
public void keyReleased(KeyEvent k) { }
}


//"intTextBox.mft"

Manifest-Version: 1.0
Name: intTextBox.class
Java-Bean: True


Bye
Prabha
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic