Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

java beans  RSS feed

 
arnold stalon
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
package sunw.demo.bdkcolors;

import java.awt.*;
import java.awt.event.*;

public class bdkcolors extends Canvas {
private Color color;
public boolean rect;
bdkcolors() {
addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent me) {
change();
}
});
rect=false;
setSize(300,200);
change();
}

public void setRect(boolean rect){
this.rect=rect;
}
public boolean getRect() {
return rect;
}
public void change() {
color=randomColor();
repaint();
}
public Color randomColor() {
int r=(int)(255*Math.random());
int g=(int)(255*Math.random());
int b=(int)(255*Math.random());
return new Color(r,g,b);
}
public void paint(Graphics g) {
Dimension d=getSize();
int w=d.width;
int h=d.height;
g.setColor(color);
if(rect)
g.fillRect(0,0,w-1,h-1);
else
g.fillOval(0,0,w-1,h-1);
}

}


My current directory is e:/program files/editplus/java
sub directory:sun/demo/bdkcolors.

Here is my jdk directory:e:/java/jdk1.3.
My current bdk directory is:e:/java/bdk.

This program was complied,no errors are found.How to add this class file into bdk.I was used jar command.but there was not possible to add the bdk.

Class file was kept into sun/demo/bdkcolors.

How to add this class file into bdk?

Please help me.

Thank you.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66184
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As this has nothing to do with JDBC, I've moved it to the Java in General (beginner) forum.
 
Manuel Moons
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't understand your question? What is bdk? What exactly do you want to do?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!