Hi there,
Every time i am making a program in Java(Advance). I found that it can many errors in it.
For example I am Giving u a program written by me
//a push button with all features
import java.awt.*;
import javax.swing.*;
import javax.swing.border.*;
class Mybuttons1 extends Frame
{
//vars
JButton b;
//constructor
Mybuttons1()
{
//goto content pane
Container c = this.getContentPane();
//set the flow layout to c
c.setLayout(new FlowLayout());
//load the image into ImageIcon class object
ImageIcon obj;
ImageIcon ii = new ImageIcon("India_by_mr_curry.jpg");
//create the button with image on it
b = new JButton("Click Me",ii);
//set colors
b.setBackground(Color.yellow);
b.setForeground(Color.red);
//set a font
Font f = new Font("Arial",Font.BOLD,32);
b.setFont(f);
//set bevel border
//Border bd = BorderFactory.createBevelBoreder(BevelBorder.RAISED);
b.setBorder(bd);
//set a tool tip text
b.setToolTipText("I am Button");
//set a short cut key
//b.setMneomnic('C');
//add button to C
c.add(b);
//close the application
this.setDefaultCloseOperation ( JFrame.EXIT_ON_CLOSE );
}
public static void main(String a[])
{
//create the frame
Mybuttons1 mb = new Mybuttons1();
mb.setTitle("My Push Button");
mb.setSize(400,300);
mb.setVisible(true);
}
}
After compiling it I am getting three errors can....Your reply will be appreciated