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);
}
}
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);
}
}
add(jbtOK);
jbtOK.setToolTipText("This is a button");
jbtOK.setToolTipText("This is a button");
JPanel panel = new JPanel();
panel.add(jbtOK);
add(panel); }