Here Iam creating a jframe with some set properties like setsize, setlocations.
Here two textboxes are here one for entering input and another for printing output. after entering just press on get value button it will display the values in in textbox input to textbox output.
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JTextField;
public class CreateTextbox extends JFrame implements ActionListener{
JTextField input,output;
JButton print;
public CreateTextbox(){
setLayout(null);
input = new JTextField(5);
input.setBounds(100,20,100,20);
add(input);
output = new JTextField(5);
output.setBounds(180,200,100,20);
add(output);
print = new JButton("Get Value");
print.setBounds(20,200,100,20);
print.addActionListener(this);
add(print);
}
public void actionPerformed(ActionEvent e) {
if(e.getSource()== print )
{
output.setText(input.getText());
}
}
public static void main (String[] args)
{
CreateTextbox me = new CreateTextbox();
me.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
me.setVisible(true);
me.setLocation(550, 500);
me.setSize(300, 300);
me. setTitle("Create Textbox");
}
}
output:
output:
great faizal keep it up fine good excellent jog ......................................................................................................................................................
ReplyDeleteThanks for the good words! Really appreciated. Great post. I’ve been commenting a lot on a few blogs recently, but I hadn’t thought about my approach until you brought it up.
ReplyDeletepython Training in Pune
python Training in Chennai
python Training in Bangalore
This looks absolutely perfect. All these tiny details are made with lot of background knowledge. I like it a lot.
ReplyDeleteBest Devops Training in pune
Devops Training in Bangalore
Power bi training in Chennai
Awesome! Education is the extreme motivation that open the new doors of data and material. So we always need to study around the things and the new part of educations with that we are not mindful.
ReplyDeleteData Science training in rajaji nagar
Data Science with Python training in chennai
Data Science training in electronic city
Data Science training in USA
Data science training in bangalore
Awesome blog. Thanks for sharing such a worthy information....
ReplyDeleteAngularjs Training in Hyderabad
Angularjs Training in Gurgaon