import javax.swing.*;
public class Test extends JFrame{
   private JButton jbtOK=new JButton("OK");
  
    public Test(){
   jbtOK.setToolTipText("This is a button");
   add(new JButton("OK"));
    
}
   public static void main(String[] args){
   JFrame frame=new Test();   frame.setTitle("Logic Error");
   frame.setSize(200,100);
   frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
   frame.setVisible(true);
}
}