here i attach the picture of my apps so I want to create an app that can be use and install for me and my friends on laptop. What this app will do : 1. this app will have 20 numbers and the initial numbers will be "0" before they click the start button.
The first 10 numbers in the textbox, users can insert any numbers thats the range only between 0-9 only but for the last 10 numbers, users cannot insert any numbers.
this app have 2 buttons which are save and start button.
when the users click start button even the users didnt insert anything in the first 10 textbox, the 1st number will start counting from 0-9, after the 1st number finish count until 9, the second number will continue counting from 0-9 and 3rd-20th number will also do the same until all the 20 numbers in the textbox become 9999999999999999999, then it will stop counting.
when the users insert numbers in first three textbox and press start button, the number will start counting from the 4th textbox, until 20th numbers and until the 4-20th numbers become ***999999999999999999.
but every time the numbers changing, for example, when 1st number start counting like 100000000000000000000, users will click save button and it will save the numbers in the textarea which is located in the middle of this app and at the same time it will automatically create a folder in the users computer and the numbers will also save in that folder.
when the users transfer that folder from their laptop to their phone, all the numbers will save automatically as contact numbers in their phone.
here in my code, I dont know how to make the start button to run the numbers automatically once the start button click, in my code, the number will only change everytime when the start button click, i just want to click the start button only one time and the number will count automatically,anyone know how to do it? and the save button also i have no idea how to do it.`[ import javax.swing.; import java.awt.; import java.awt.event.*;
public class b extends JFrame implements ActionListener{
JPanel panel = new JPanel();
JPanel panel1 = new JPanel();
JTextField t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20;
JButton start, save;
JTextArea ta;
public b() {
Container pane = getContentPane();
pane.setLayout(new GridLayout(3, 1));
panel.setLayout(new FlowLayout());
panel.add(t1 = new JTextField(("0"), 2));
panel.add(t2 = new JTextField(("0"), 2));
panel.add(t3 = new JTextField(("0"), 2));
panel.add(t4 = new JTextField(("0"), 2));
panel.add(t5 = new JTextField(("0"), 2));
panel.add(t6 = new JTextField(("0"), 2));
panel.add(t7 = new JTextField(("0"), 2));
panel.add(t8 = new JTextField(("0"), 2));
panel.add(t9 = new JTextField(("0"), 2));
panel.add(t10 = new JTextField(("0"), 2));
panel.add(t11 = new JTextField(("0"), 2));
panel.add(t12 = new JTextField(("0"), 2));
panel.add(t13 = new JTextField(("0"), 2));
panel.add(t14 = new JTextField(("0"), 2));
panel.add(t15 = new JTextField(("0"), 2));
panel.add(t16 = new JTextField(("0"), 2));
panel.add(t17 = new JTextField(("0"), 2));
panel.add(t18 = new JTextField(("0"), 2));
panel.add(t19 = new JTextField(("0"), 2));
panel.add(t20 = new JTextField(("0"), 2));
t11.setEditable(false);
t12.setEditable(false);
t12.setEditable(false);
t13.setEditable(false);
t14.setEditable(false);
t15.setEditable(false);
t16.setEditable(false);
t17.setEditable(false);
t18.setEditable(false);
t19.setEditable(false);
t20.setEditable(false);
ta = new JTextArea();
ta.setEditable(false);
panel1.setLayout(new FlowLayout());
panel1.add(save = new JButton("Save"));
panel1.add(start = new JButton("Start"));
pane.add(panel);
pane.add(ta);
pane.add(panel1);
t1.addActionListener(this);
t2.addActionListener(this);
t3.addActionListener(this);
t4.addActionListener(this);
t5.addActionListener(this);
t6.addActionListener(this);
t7.addActionListener(this);
t8.addActionListener(this);
t9.addActionListener(this);
t10.addActionListener(this);
t11.addActionListener(this);
t12.addActionListener(this);
t13.addActionListener(this);
t14.addActionListener(this);
t15.addActionListener(this);
t16.addActionListener(this);
t17.addActionListener(this);
t18.addActionListener(this);
t19.addActionListener(this);
t20.addActionListener(this);
save.addActionListener(this);
start.addActionListener(this);
}
public void actionPerformed(ActionEvent e) {
Object obj = e.getSource();
int count = Integer.parseInt(t1.getText());
if (obj == start) {
if (count < 9) {
count++;
t1.setText("" + count);
}
else {
count = 0;
t1.setText("" + count);
count = Integer.parseInt(t2.getText());
if (count < 9) {
count++;
t2.setText("" + count);
}
else {
count = 0;
t2.setText("" + count);
count = Integer.parseInt(t3.getText());
if (count < 9) {
count++;
t3.setText("" + count);
}
else {
count = 0;
t3.setText("" + count);
count = Integer.parseInt(t4.getText());
if (count < 9) {
count++;
t4.setText("" + count);
}
else {
count = 0;
t4.setText("" + count);
count = Integer.parseInt(t5.getText());
if (count < 9) {
count++;
t5.setText("" + count);
}
else {
count = 0;
t5.setText("" + count);
count = Integer.parseInt(t6.getText());
if (count < 9) {
count++;
t6.setText("" + count);
}
else {
count = 0;
t6.setText("" + count);
count = Integer.parseInt(t7.getText());
if (count < 9) {
count++;
t7.setText("" + count);
}
else {
count = 0;
t7.setText("" + count);
count = Integer.parseInt(t8.getText());
if (count < 9) {
count++;
t8.setText("" + count);
}
else {
count = 0;
t8.setText("" + count);
count = Integer.parseInt(t9.getText());
if (count < 9) {
count++;
t9.setText("" + count);
}
else {
count = 0;
t9.setText("" + count);
count = Integer.parseInt(t10.getText());
if (count < 9) {
count++;
t10.setText("" + count);
}
else {
count = 0;
t10.setText("" + count);
count = Integer.parseInt(t11.getText());
if (count < 9) {
count++;
t11.setText("" + count);
}
else {
count = 0;
t11.setText("" + count);
count = Integer.parseInt(t12.getText());
if (count < 9) {
count++;
t12.setText("" + count);
}
else {
count = 0;
t12.setText("" + count);
count = Integer.parseInt(t13.getText());
if (count < 9) {
count++;
t13.setText("" + count);
}
else {
count = 0;
t13.setText("" + count);
count = Integer.parseInt(t14.getText());
if (count < 9) {
count++;
t14.setText("" + count);
}
else {
count = 0;
t14.setText("" + count);
count = Integer.parseInt(t15.getText());
if (count < 9) {
count++;
t15.setText("" + count);
}
else {
count = 0;
t15.setText("" + count);
count = Integer.parseInt(t16.getText());
if (count < 9) {
count++;
t16.setText("" + count);
}
else {
count = 0;
t16.setText("" + count);
count = Integer.parseInt(t17.getText());
if (count < 9) {
count++;
t17.setText("" + count);
}
else {
count = 0;
t17.setText("" + count);
count = Integer.parseInt(t18.getText());
if (count < 9) {
count++;
t18.setText("" + count);
}
else {
count = 0;
t18.setText("" + count);
count = Integer.parseInt(t19.getText());
if (count < 9) {
count++;
t19.setText("" + count);
}
else {
count = 0;
t19.setText("" + count);
count = Integer.parseInt(t20.getText());
if (count < 9) {
count++;
t20.setText("" + count);
}
else {
count = 0;
t20.setText("0");
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
public static void main (String[] args) {
b frame1 = new b();
frame1.setTitle("bb");
frame1.setSize(650, 400);
frame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame1.setVisible(true);
}
} ]2`