this is the main class.button first don't show up first but when you hover the the mouse over the position of button it shows up. but this is not the case with the textfield which is not showing up in any case.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Test {
public static void main(String[] args){
JFrame f=new JFrame("Calculator");
f.setSize(450,450);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setVisible(true);
JPanel p=new JPanel();
f.add(p);
JTextField t=new JTextField(20);
t.setBounds(5, 5, 0, 0);
t.setLayout(null);
p.add(t);
JButton clear=new JButton("C");
clear.setBounds(5,100,50,50);
clear.setSize(50,40);
p.add(clear);
}
}