i use this code but don't show jtext and jbutton
import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Datepannel extends JPanel { JButton choosdate = new JButton(); JTextField datetext = new JTextField(); JPanel panel = new JPanel(); public void paintComponent() { setLayout(new FlowLayout()); add(panel); panel.setPreferredSize(new Dimension(200, 50)); panel.setLayout(new FlowLayout()); panel.setVisible(true); choosdate.setText("okokok"); choosdate.setVisible(true); panel.add(choosdate); panel.add(datetext); } }