actually i hav been posting a question about JTextField which no buddy hav yet understood...
but i now i have image about my problem
actually i want my display to be this (don't car about JFrame size) :-
Capture.jpg
but instead this is what comes up instead :-
Capture.jpg
here is the code (didn't mentioned the imported packages here ) :-
public class TextField1 extends JApplet implements ActionListener { JTextField Input; public JFrame Panel = new JFrame("A. God"); JTextField sonar; public JButton button1 = new JButton("Enter"); LayoutManager Layout; public TextField1 () { Panel.setSize(500,500); sonar = new JTextField(); sonar.setLocation(0, 40); sonar.setSize(100, 30); Panel.add (sonar); Input = new JTextField ("", 20); Layout = new FlowLayout (); sonar.setEditable (false); Input.setBackground (Color.white); Input.addActionListener (this); Panel.setLayout (Layout); Panel.add (Input); Panel.add(button1); Panel.setVisible(true); } public void actionPerformed (ActionEvent e) { sonar.setText (Input.getText()); Input.setText(""); if (e.getSource() == button1) { sonar.setText (Input.getText()); Input.setText(""); } } }
Plz help
Regards