آخرین فعالیت ١٣ ساعت پیش

@woohee

پارس کلیکی از ۴ ماه پیش

تجربه

3600

  • ٢ ماه پیش @woohee به بحث نحوه اتصال به دیتابیس سایت جواب داد.

    @tilkacoder مشکلم اینه که وقتی اطلاعات رو حتی یکی از خونه ها رو فارسی وارد میکنم هیچ اطلاعاتی ثبت نمیشه ولی اگر اطلاعات رو انگلیسی وارد کنم اطلاعات به درستی ثبت میشن .در فایل connect.php کدهای پشتیبانی از زبان فارسی رو هم نوشتم ولی اطلاعات فارسی ثبت نمیشن . آیا باید در خود دیتابیس هم ستون ها رو بر روی utf8 بگذارم ؟

  • ٢ ماه پیش @woohee به بحث نحوه اتصال به دیتابیس سایت جواب داد.

    @tilkacoder خیلی خیلی خیلی ممنون مشکلم حل شد . ولی یه نکته ، من کاربر رو نفهمیدم چی هست یعنی به هر دیتابیس میشه چندین سایت با سطح دسترسی های مشخص وصل بشن ؟ و یه سوال دیگه ، من کدهای پشتیبانی از زبان فارسی رو داخل فایل connect.php نوشته بودم ولی وقتی اطلاعات رو به زبان فارسی وارد میکنم اطلاعات تو دیتابیس ثبت نمیشن . علت چیه ؟ ممنون میشم کمکم کنین .

  • ٢ ماه پیش @woohee یک بحث به اسم نحوه اتصال به دیتابیس سایت درست کرد.

    سلام من وقتی میخوام با php با نرم افزار wamp به mysql وصل بشم از طریق PDO هیچ مشکلی ندارم ولی وقتی که همون کدههای php رو توی هاست سایتم امتحان میکنم ارور میده . این متن ارور :

    unable to connectSQLSTATE[42000] [1044] Access denied for user 'zahediha_pop'@'localhost' to database 'zahediha_kpop'

    این هم کدهای connect.php :

    <?php
    $server="localhost";
    $user="zahediha_pop";
    $pass="123456789";
    $dbname="zahediha_kpop";
    
    $dsn="mysql:host=$server;dbname=$dbname";
    
    try{
        $connect=new PDO($dsn , $user , $pass);
        $connect->exec("SET character_set_connection = 'utf8'");
        $connect->exec("SET NAMES 'UTF8'");
    }catch(PDOException $error){
        echo "unable to connect".$error->getMessage();
    }
    
    ?>

    آیا باید در قسمت localhost آدرس سایت را بنویسم ؟

  • @shahryarjb

    بهتره شما اول سعی کنید بگید اولین نیاز و پروژه شما چی هست بعد بهتره در زمینه کامپیوتر یک خط رو دنبال کنید وگرنه یکدفعه به خودتون می یایید ۵۰ سالتونه ولی یک مسیر رو حتی نتونستید برید جلو چون بسیار توسعه زیادی داره و امکان یادگیری همه نیست .

    منظورتون اینه که زبان جاوا رو بصورت کامل نمیشه یاد گرفت و زمان زیادی رو باید صرف کامل یاد گرفتنش کنیم ؟

    بحث اینجاست که دنیای جاوا خیلی بزرگه و برنامه نویسان حرفه ای وجود دارند که مثل زامبی اند آیا اونا در آینده اجازه پروژه های بزرگ به شما می دند ؟

    منظورتونو کامل نفهمیدم .زامبی ؟

    آیا با زبان دیگیر توسعه شما سریع تر نیست

    میشه چند تا زبان برای ساخت وبسایت که بهتر از جاوا هستن را معرفی بفرمایید .

  • ۴ ماه پیش @woohee یک بحث به اسم برگرداندن لیست در جاوا درست کرد.

    من می خوام برنامه ای بنویسم که از کاربر متنی را بگیره و اون متن کاربر نباید بیشتر از 1000 کاراکتر باشه و متن کاربر را بصورت برعکس به خودش نشون بده . من از متدcollections.reverse() استفاده کردم ولی هیچ فایده ای نداره و متن رو به همون صورت که کاربر وارد کرده نشون میده .

    package test1;
    
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Collections;
    import java.util.Scanner;
    
    public class Test1 {
    
        public static void main(String[] args) {
            Scanner hassan = new Scanner(System.in);
            int a = 1000;
            System.out.println("please enter your message : ");
            String b = hassan.nextLine();
            int c = b.length();
            System.out.println(c);
            String[] list1 = {b};
            ArrayList<String> list = new ArrayList<>(Arrays.asList(list1));
            if (c < a) {
    //            reverse(list);
                Collections.reverse(list);
                list1 = list.toArray(new String[list.size()]);
                for (String x : list1) {
                    System.out.println(" " + x);
                }
            } else {
                System.out.println(" plese enter 1000 character .");
            }
        }
    }
  • ۴ ماه پیش @woohee عضو بحث برگرداندن لیست در جاوا شد.
  • @amir میدونم ولی می خواستم بدونم میشه ؟

  • ۴ ماه پیش @woohee به بحث راه اندازی GitHub روی سرور محلی جواب داد.

    @danial_kh گیت لب و گیت هاب چیه ؟

  • @amir
    کلاس اول :

    package calculator;
    
    import java.awt.BorderLayout;
    import java.awt.Color;
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    
    public class bmi extends javax.swing.JFrame {
    
        double masss;
        double heaight, result;
        String mass1, heaight1;
        char zarb;
    
        public class TableExample {
    
            JFrame f;
    
            TableExample() {
                f = new JFrame();
                f.setTitle("BMI help");
                f.setBackground(Color.GRAY);
                String data[][] = {
                    {"Very severely underweight", "15"},
                    {"Severely underweight", "from 15 to 16"},
                    {"Underweight", "from 16 to 18.5"},
                    {"Normal (healthy weight)", "from 18.5 to 25"},
                    {"Overweight", "from 25 to 30"},
                    {"Obese Class I (Moderately obese)", "from 30 to 35"},
                    {"Obese Class II (Severely obese)", "from 35 to 40"},
                    {"Obese Class III (Very severely obese)", "from 40 to 45"},
                    {"Obese Class IV (Morbidly Obese)", "from 45 to 50"},
                    {"Obese Class V (Super Obese)", "from 50 to 60"},
                    {"Obese Class VI (Hyper Obese)", "60"},};
                String column[] = {"category", "BMI"};
                JTable jt = new JTable(data, column);
    //            jt.setBounds(500, 500, 400, 600);
                JScrollPane sp = new JScrollPane(jt);
                f.add(sp, BorderLayout.CENTER);
                f.setSize(600, 280);
                f.setVisible(true);
            }
        }
    
        public bmi() {
            initComponents();
        }
    
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
        private void initComponents() {
    
            menha2 = new javax.swing.JButton();
            taghsim2 = new javax.swing.JButton();
            jam2 = new javax.swing.JButton();
            menha4 = new javax.swing.JButton();
            menha6 = new javax.swing.JButton();
            menha = new javax.swing.JButton();
            zarb1 = new javax.swing.JButton();
            menha1 = new javax.swing.JButton();
            taghsim1 = new javax.swing.JButton();
            jam1 = new javax.swing.JButton();
            zarb2 = new javax.swing.JButton();
            next = new javax.swing.JButton();
            back = new javax.swing.JButton();
            jLabel1 = new javax.swing.JLabel();
            help = new javax.swing.JButton();
            text = new javax.swing.JTextField();
            jLabel2 = new javax.swing.JLabel();
            jLabel3 = new javax.swing.JLabel();
    
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            setTitle("BMI");
            setName("bmi"); // NOI18N
            setPreferredSize(new java.awt.Dimension(1200, 850));
    
            menha2.setFont(new java.awt.Font("Tempus Sans ITC", 1, 150)); // NOI18N
            menha2.setForeground(new java.awt.Color(153, 0, 204));
            menha2.setText("1");
            menha2.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    menha2ActionPerformed(evt);
                }
            });
    
            taghsim2.setFont(new java.awt.Font("Tempus Sans ITC", 1, 150)); // NOI18N
            taghsim2.setForeground(new java.awt.Color(153, 0, 204));
            taghsim2.setText("4");
            taghsim2.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    taghsim2ActionPerformed(evt);
                }
            });
    
            jam2.setFont(new java.awt.Font("Tempus Sans ITC", 1, 150)); // NOI18N
            jam2.setForeground(new java.awt.Color(153, 0, 204));
            jam2.setText("6");
            jam2.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jam2ActionPerformed(evt);
                }
            });
    
            menha4.setFont(new java.awt.Font("Tempus Sans ITC", 1, 200)); // NOI18N
            menha4.setForeground(new java.awt.Color(153, 0, 204));
            menha4.setText(".");
            menha4.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    menha4ActionPerformed(evt);
                }
            });
    
            menha6.setFont(new java.awt.Font("Tempus Sans ITC", 1, 150)); // NOI18N
            menha6.setForeground(new java.awt.Color(153, 0, 204));
            menha6.setText("8");
            menha6.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    menha6ActionPerformed(evt);
                }
            });
    
            menha.setFont(new java.awt.Font("Tempus Sans ITC", 1, 150)); // NOI18N
            menha.setForeground(new java.awt.Color(153, 0, 204));
            menha.setText("0");
            menha.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    menhaActionPerformed(evt);
                }
            });
    
            zarb1.setFont(new java.awt.Font("Tempus Sans ITC", 1, 150)); // NOI18N
            zarb1.setForeground(new java.awt.Color(153, 0, 204));
            zarb1.setText("9");
            zarb1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    zarb1ActionPerformed(evt);
                }
            });
    
            menha1.setFont(new java.awt.Font("Tempus Sans ITC", 1, 150)); // NOI18N
            menha1.setForeground(new java.awt.Color(153, 0, 204));
            menha1.setText("3");
            menha1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    menha1ActionPerformed(evt);
                }
            });
    
            taghsim1.setFont(new java.awt.Font("Tempus Sans ITC", 1, 150)); // NOI18N
            taghsim1.setForeground(new java.awt.Color(153, 0, 204));
            taghsim1.setText("7");
            taghsim1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    taghsim1ActionPerformed(evt);
                }
            });
    
            jam1.setFont(new java.awt.Font("Tempus Sans ITC", 1, 150)); // NOI18N
            jam1.setForeground(new java.awt.Color(153, 0, 204));
            jam1.setText("5");
            jam1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jam1ActionPerformed(evt);
                }
            });
    
            zarb2.setFont(new java.awt.Font("Tempus Sans ITC", 1, 150)); // NOI18N
            zarb2.setForeground(new java.awt.Color(153, 0, 204));
            zarb2.setText("2");
            zarb2.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    zarb2ActionPerformed(evt);
                }
            });
    
            next.setFont(new java.awt.Font("Tempus Sans ITC", 1, 100)); // NOI18N
            next.setForeground(new java.awt.Color(0, 153, 102));
            next.setText("NEXT");
            next.setToolTipText("next");
            next.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    nextActionPerformed(evt);
                }
            });
    
            back.setFont(new java.awt.Font("Tempus Sans ITC", 1, 50)); // NOI18N
            back.setForeground(new java.awt.Color(255, 0, 0));
            back.setText("back");
            back.setToolTipText("back to home");
            back.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    backActionPerformed(evt);
                }
            });
    
            jLabel1.setText("BMI = MASS(KG) / HEAIGHT(M)^2");
    
            help.setFont(new java.awt.Font("Tempus Sans ITC", 1, 100)); // NOI18N
            help.setForeground(new java.awt.Color(0, 51, 255));
            help.setText("HELP");
            help.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    helpActionPerformed(evt);
                }
            });
    
            text.setFont(new java.awt.Font("Tempus Sans ITC", 1, 12)); // NOI18N
            text.setForeground(new java.awt.Color(0, 102, 102));
    
            jLabel2.setFont(new java.awt.Font("Tempus Sans ITC", 1, 36)); // NOI18N
            jLabel2.setForeground(new java.awt.Color(0, 153, 102));
            jLabel2.setText("Enter your mass (kg)  and click on the NEXT");
    
            jLabel3.setBackground(new java.awt.Color(204, 255, 255));
            jLabel3.setFont(new java.awt.Font("Tempus Sans ITC", 1, 18)); // NOI18N
            jLabel3.setForeground(new java.awt.Color(0, 153, 102));
            jLabel3.setText("created by TOAgt and bae woohee !!!");
            jLabel3.setToolTipText("t.me/toagt");
    
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                            .addGap(28, 28, 28)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(menha2, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jam1, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(zarb1, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGap(36, 36, 36)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(menha, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jam2, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(zarb2, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGap(42, 42, 42)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(menha1, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(taghsim1, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(menha4, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGap(32, 32, 32)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(next, javax.swing.GroupLayout.PREFERRED_SIZE, 571, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGroup(layout.createSequentialGroup()
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                        .addComponent(menha6, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(taghsim2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 155, Short.MAX_VALUE))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 366, Short.MAX_VALUE)
                                        .addComponent(help, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))))
                        .addGroup(layout.createSequentialGroup()
                            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 809, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(82, 82, 82))
                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                    .addComponent(jLabel3)
                                    .addGap(311, 311, 311)))
                            .addComponent(back, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGap(52, 52, 52))
                .addGroup(layout.createSequentialGroup()
                    .addGap(84, 84, 84)
                    .addComponent(text, javax.swing.GroupLayout.PREFERRED_SIZE, 942, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            );
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(back, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGap(52, 52, 52)
                    .addComponent(text, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 142, Short.MAX_VALUE)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                            .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(18, 18, 18)
                            .addComponent(help, javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(80, 80, 80))
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(taghsim2, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(menha1, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(zarb2, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(menha2, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGap(30, 30, 30)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jam1, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jam2, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(taghsim1, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(menha6, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGap(29, 29, 29)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(menha4, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(menha, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(zarb1, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addComponent(next, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(51, 51, 51))
            );
    
            pack();
            setLocationRelativeTo(null);
        }// </editor-fold>                        
    
        private void jam2ActionPerformed(java.awt.event.ActionEvent evt) {                                     
            String lastText = text.getText();
            text.setText(lastText + "6");
        }                                    
    
        private void jam1ActionPerformed(java.awt.event.ActionEvent evt) {                                     
            String lastText = text.getText();
            text.setText(lastText + "5");
        }                                    
    
        private void helpActionPerformed(java.awt.event.ActionEvent evt) {                                     
            new TableExample();
        }                                    
    
        private void backActionPerformed(java.awt.event.ActionEvent evt) {                                     
            super.dispose();
            new home().setVisible(true);
        }                                    
    
        private void menha2ActionPerformed(java.awt.event.ActionEvent evt) {                                       
            String lastText = text.getText();
            text.setText(lastText + "1");
        }                                      
    
        private void zarb2ActionPerformed(java.awt.event.ActionEvent evt) {                                      
            String lastText = text.getText();
            text.setText(lastText + "2");
        }                                     
    
        private void menha1ActionPerformed(java.awt.event.ActionEvent evt) {                                       
            String lastText = text.getText();
            text.setText(lastText + "3");
        }                                      
    
        private void taghsim2ActionPerformed(java.awt.event.ActionEvent evt) {                                         
            String lastText = text.getText();
            text.setText(lastText + "4");
        }                                        
    
        private void taghsim1ActionPerformed(java.awt.event.ActionEvent evt) {                                         
            String lastText = text.getText();
            text.setText(lastText + "7");
        }                                        
    
        private void menha6ActionPerformed(java.awt.event.ActionEvent evt) {                                       
            String lastText = text.getText();
            text.setText(lastText + "8");
        }                                      
    
        private void zarb1ActionPerformed(java.awt.event.ActionEvent evt) {                                      
            String lastText = text.getText();
            text.setText(lastText + "9");
        }                                     
    
        private void menhaActionPerformed(java.awt.event.ActionEvent evt) {                                      
            String lastText = text.getText();
            text.setText(lastText + "0");
        }                                     
    
        private void menha4ActionPerformed(java.awt.event.ActionEvent evt) {                                       
            String lastText = text.getText();
            text.setText(lastText + ".");
        }                                      
    
        private void nextActionPerformed(java.awt.event.ActionEvent evt) {                                     
            try {
    
                masss = Double.parseDouble(text.getText());
                text.setText("");
                next.setText("result");
                super.dispose();
                new nextbmi().setVisible(true);
    
            } catch (Exception e) {
                JOptionPane.showMessageDialog(null, " whooooops!!! please enter your mass or " + e, "Error", JOptionPane.ERROR_MESSAGE);
            }
        }                                    
    
        public static void main(String args[]) {
    
            try {
                for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                    if ("Nimbus".equals(info.getName())) {
                        javax.swing.UIManager.setLookAndFeel(info.getClassName());
                        break;
                    }
                }
            } catch (ClassNotFoundException ex) {
                java.util.logging.Logger.getLogger(bmi.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            } catch (InstantiationException ex) {
                java.util.logging.Logger.getLogger(bmi.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            } catch (IllegalAccessException ex) {
                java.util.logging.Logger.getLogger(bmi.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            } catch (javax.swing.UnsupportedLookAndFeelException ex) {
                java.util.logging.Logger.getLogger(bmi.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            }
            //</editor-fold>
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new bmi().setVisible(true);
                }
            });
        }
    
        // Variables declaration - do not modify                     
        private javax.swing.JButton back;
        private javax.swing.JButton help;
        private javax.swing.JLabel jLabel1;
        private javax.swing.JLabel jLabel2;
        private javax.swing.JLabel jLabel3;
        private javax.swing.JButton jam1;
        private javax.swing.JButton jam2;
        private javax.swing.JButton menha;
        private javax.swing.JButton menha1;
        private javax.swing.JButton menha2;
        private javax.swing.JButton menha4;
        private javax.swing.JButton menha6;
        private javax.swing.JButton next;
        private javax.swing.JButton taghsim1;
        private javax.swing.JButton taghsim2;
        private javax.swing.JTextField text;
        private javax.swing.JButton zarb1;
        private javax.swing.JButton zarb2;
        // End of variables declaration                   
    }
    

    کلاس دوم :

    package calculator;
    
    import java.awt.BorderLayout;
    import java.awt.Color;
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    
    public class nextbmi extends javax.swing.JFrame {
        bmi hassan = new bmi();
        double mass = hassan.masss;
        double heaight;
        double result;
    
        public class TableExample {
    
            JFrame f;
    
            TableExample() {
                f = new JFrame();
                f.setTitle("BMI help");
                f.setBackground(Color.GRAY);
                String data[][] = {
                    {"Very severely underweight", "15"},
                    {"Severely underweight", "from 15 to 16"},
                    {"Underweight", "from 16 to 18.5"},
                    {"Normal (healthy weight)", "from 18.5 to 25"},
                    {"Overweight", "from 25 to 30"},
                    {"Obese Class I (Moderately obese)", "from 30 to 35"},
                    {"Obese Class II (Severely obese)", "from 35 to 40"},
                    {"Obese Class III (Very severely obese)", "from 40 to 45"},
                    {"Obese Class IV (Morbidly Obese)", "from 45 to 50"},
                    {"Obese Class V (Super Obese)", "from 50 to 60"},
                    {"Obese Class VI (Hyper Obese)", "60"},};
                String column[] = {"category", "BMI"};
                JTable jt = new JTable(data, column);
    //            jt.setBounds(500, 500, 400, 600);
                JScrollPane sp = new JScrollPane(jt);
                f.add(sp, BorderLayout.CENTER);
                f.setSize(600, 280);
                f.setVisible(true);
            }
        }
        public nextbmi() {
            initComponents();
        }
    
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
        private void initComponents() {
    
            back = new javax.swing.JButton();
            jLabel3 = new javax.swing.JLabel();
            menha = new javax.swing.JButton();
            zarb1 = new javax.swing.JButton();
            menha1 = new javax.swing.JButton();
            taghsim1 = new javax.swing.JButton();
            jam1 = new javax.swing.JButton();
            zarb2 = new javax.swing.JButton();
            menha2 = new javax.swing.JButton();
            next = new javax.swing.JButton();
            taghsim2 = new javax.swing.JButton();
            jam2 = new javax.swing.JButton();
            jLabel1 = new javax.swing.JLabel();
            menha4 = new javax.swing.JButton();
            help = new javax.swing.JButton();
            menha6 = new javax.swing.JButton();
            text = new javax.swing.JTextField();
            jLabel2 = new javax.swing.JLabel();
    
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    
            back.setFont(new java.awt.Font("Tempus Sans ITC", 1, 50)); // NOI18N
            back.setForeground(new java.awt.Color(255, 0, 0));
            back.setText("back");
            back.setToolTipText("back to mass page");
            back.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    backActionPerformed(evt);
                }
            });
    
            jLabel3.setBackground(new java.awt.Color(204, 255, 255));
            jLabel3.setFont(new java.awt.Font("Tempus Sans ITC", 1, 18)); // NOI18N
            jLabel3.setForeground(new java.awt.Color(0, 153, 102));
            jLabel3.setText("created by TOAgt and bae woohee !!!");
            jLabel3.setToolTipText("t.me/toagt");
    
            menha.setFont(new java.awt.Font("Tempus Sans ITC", 1, 150)); // NOI18N
            menha.setForeground(new java.awt.Color(153, 0, 204));
            menha.setText("0");
            menha.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    menhaActionPerformed(evt);
                }
            });
    
            zarb1.setFont(new java.awt.Font("Tempus Sans ITC", 1, 150)); // NOI18N
            zarb1.setForeground(new java.awt.Color(153, 0, 204));
            zarb1.setText("9");
            zarb1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    zarb1ActionPerformed(evt);
                }
            });
    
            menha1.setFont(new java.awt.Font("Tempus Sans ITC", 1, 150)); // NOI18N
            menha1.setForeground(new java.awt.Color(153, 0, 204));
            menha1.setText("3");
            menha1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    menha1ActionPerformed(evt);
                }
            });
    
            taghsim1.setFont(new java.awt.Font("Tempus Sans ITC", 1, 150)); // NOI18N
            taghsim1.setForeground(new java.awt.Color(153, 0, 204));
            taghsim1.setText("7");
            taghsim1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    taghsim1ActionPerformed(evt);
                }
            });
    
            jam1.setFont(new java.awt.Font("Tempus Sans ITC", 1, 150)); // NOI18N
            jam1.setForeground(new java.awt.Color(153, 0, 204));
            jam1.setText("5");
            jam1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jam1ActionPerformed(evt);
                }
            });
    
            zarb2.setFont(new java.awt.Font("Tempus Sans ITC", 1, 150)); // NOI18N
            zarb2.setForeground(new java.awt.Color(153, 0, 204));
            zarb2.setText("2");
            zarb2.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    zarb2ActionPerformed(evt);
                }
            });
    
            menha2.setFont(new java.awt.Font("Tempus Sans ITC", 1, 150)); // NOI18N
            menha2.setForeground(new java.awt.Color(153, 0, 204));
            menha2.setText("1");
            menha2.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    menha2ActionPerformed(evt);
                }
            });
    
            next.setFont(new java.awt.Font("Tempus Sans ITC", 1, 100)); // NOI18N
            next.setForeground(new java.awt.Color(0, 153, 102));
            next.setText("Result");
            next.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    nextActionPerformed(evt);
                }
            });
    
            taghsim2.setFont(new java.awt.Font("Tempus Sans ITC", 1, 150)); // NOI18N
            taghsim2.setForeground(new java.awt.Color(153, 0, 204));
            taghsim2.setText("4");
            taghsim2.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    taghsim2ActionPerformed(evt);
                }
            });
    
            jam2.setFont(new java.awt.Font("Tempus Sans ITC", 1, 150)); // NOI18N
            jam2.setForeground(new java.awt.Color(153, 0, 204));
            jam2.setText("6");
            jam2.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jam2ActionPerformed(evt);
                }
            });
    
            jLabel1.setText("BMI = MASS(KG) / HEAIGHT(M)^2");
    
            menha4.setFont(new java.awt.Font("Tempus Sans ITC", 1, 200)); // NOI18N
            menha4.setForeground(new java.awt.Color(153, 0, 204));
            menha4.setText(".");
            menha4.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    menha4ActionPerformed(evt);
                }
            });
    
            help.setFont(new java.awt.Font("Tempus Sans ITC", 1, 100)); // NOI18N
            help.setForeground(new java.awt.Color(0, 51, 255));
            help.setText("HELP");
            help.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    helpActionPerformed(evt);
                }
            });
    
            menha6.setFont(new java.awt.Font("Tempus Sans ITC", 1, 150)); // NOI18N
            menha6.setForeground(new java.awt.Color(153, 0, 204));
            menha6.setText("8");
            menha6.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    menha6ActionPerformed(evt);
                }
            });
    
            text.setFont(new java.awt.Font("Tempus Sans ITC", 1, 60)); // NOI18N
            text.setForeground(new java.awt.Color(0, 102, 102));
    
            jLabel2.setFont(new java.awt.Font("Tempus Sans ITC", 1, 36)); // NOI18N
            jLabel2.setForeground(new java.awt.Color(0, 153, 102));
            jLabel2.setText("Enter your heaight(m)  and click on the NEXT");
    
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                    .addComponent(jLabel3)
                                    .addGap(299, 299, 299))
                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 809, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(71, 71, 71)))
                            .addComponent(back, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(layout.createSequentialGroup()
                            .addGap(23, 23, 23)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(menha2, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jam1, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(zarb1, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGap(36, 36, 36)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(menha, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jam2, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(zarb2, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGap(42, 42, 42)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(menha1, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(taghsim1, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(menha4, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGap(32, 32, 32)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(next, javax.swing.GroupLayout.PREFERRED_SIZE, 571, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGroup(layout.createSequentialGroup()
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                        .addComponent(menha6, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(taghsim2, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 74, Short.MAX_VALUE)
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 366, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(help, javax.swing.GroupLayout.PREFERRED_SIZE, 305, javax.swing.GroupLayout.PREFERRED_SIZE))))))
                    .addContainerGap())
                .addGroup(layout.createSequentialGroup()
                    .addGap(86, 86, 86)
                    .addComponent(text, javax.swing.GroupLayout.PREFERRED_SIZE, 942, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            );
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(27, 27, 27)
                            .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addComponent(back, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(text, javax.swing.GroupLayout.PREFERRED_SIZE, 174, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                            .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(18, 18, 18)
                            .addComponent(help, javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(80, 80, 80))
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(taghsim2, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(menha1, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(zarb2, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(menha2, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGap(30, 30, 30)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jam1, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jam2, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(taghsim1, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(menha6, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGap(29, 29, 29)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(menha4, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(menha, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(zarb1, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addComponent(next, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(40, 40, 40))
            );
    
            pack();
            setLocationRelativeTo(null);
        }// </editor-fold>                        
    
        private void backActionPerformed(java.awt.event.ActionEvent evt) {                                     
            super.dispose();
            new bmi().setVisible(true);
        }                                    
    
        private void menhaActionPerformed(java.awt.event.ActionEvent evt) {                                      
            String lastText = text.getText();
            text.setText(lastText + "0");
        }                                     
    
        private void zarb1ActionPerformed(java.awt.event.ActionEvent evt) {                                      
            String lastText = text.getText();
            text.setText(lastText + "9");
        }                                     
    
        private void menha1ActionPerformed(java.awt.event.ActionEvent evt) {                                       
            String lastText = text.getText();
            text.setText(lastText + "3");
        }                                      
    
        private void taghsim1ActionPerformed(java.awt.event.ActionEvent evt) {                                         
            String lastText = text.getText();
            text.setText(lastText + "7");
        }                                        
    
        private void jam1ActionPerformed(java.awt.event.ActionEvent evt) {                                     
            String lastText = text.getText();
            text.setText(lastText + "5");
        }                                    
    
        private void zarb2ActionPerformed(java.awt.event.ActionEvent evt) {                                      
            String lastText = text.getText();
            text.setText(lastText + "2");
        }                                     
    
        private void menha2ActionPerformed(java.awt.event.ActionEvent evt) {                                       
            String lastText = text.getText();
            text.setText(lastText + "1");
        }                                      
    
        private void nextActionPerformed(java.awt.event.ActionEvent evt) {                                     
            try {
                heaight = Double.parseDouble(text.getText());
                text.setText("");
    
                double heaight1 = Math.pow(heaight, 2);
                result = mass / heaight1;
                String result1 = String.valueOf(result);
                text.setText(result1);
            } catch (Exception e) {
                JOptionPane.showMessageDialog(null, " whooooops!!! please enter your heaight ." , "Error" , JOptionPane.ERROR_MESSAGE);
            }
        }                                    
    
        private void taghsim2ActionPerformed(java.awt.event.ActionEvent evt) {                                         
            String lastText = text.getText();
            text.setText(lastText + "4");
        }                                        
    
        private void jam2ActionPerformed(java.awt.event.ActionEvent evt) {                                     
            String lastText = text.getText();
            text.setText(lastText + "6");
        }                                    
    
        private void menha4ActionPerformed(java.awt.event.ActionEvent evt) {                                       
            String lastText = text.getText();
            text.setText(lastText + ".");
        }                                      
    
        private void helpActionPerformed(java.awt.event.ActionEvent evt) {                                     
            new TableExample();
        }                                    
    
        private void menha6ActionPerformed(java.awt.event.ActionEvent evt) {                                       
            String lastText = text.getText();
            text.setText(lastText + "8");
        }                                      
    
        public static void main(String args[]) {
    
            try {
                for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                    if ("Nimbus".equals(info.getName())) {
                        javax.swing.UIManager.setLookAndFeel(info.getClassName());
                        break;
                    }
                }
            } catch (ClassNotFoundException ex) {
                java.util.logging.Logger.getLogger(nextbmi.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            } catch (InstantiationException ex) {
                java.util.logging.Logger.getLogger(nextbmi.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            } catch (IllegalAccessException ex) {
                java.util.logging.Logger.getLogger(nextbmi.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            } catch (javax.swing.UnsupportedLookAndFeelException ex) {
                java.util.logging.Logger.getLogger(nextbmi.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            }
            //</editor-fold>
    
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new nextbmi().setVisible(true);
                }
            });
        }
    
        // Variables declaration - do not modify                     
        private javax.swing.JButton back;
        private javax.swing.JButton help;
        private javax.swing.JLabel jLabel1;
        private javax.swing.JLabel jLabel2;
        private javax.swing.JLabel jLabel3;
        private javax.swing.JButton jam1;
        private javax.swing.JButton jam2;
        private javax.swing.JButton menha;
        private javax.swing.JButton menha1;
        private javax.swing.JButton menha2;
        private javax.swing.JButton menha4;
        private javax.swing.JButton menha6;
        private javax.swing.JButton next;
        private javax.swing.JButton taghsim1;
        private javax.swing.JButton taghsim2;
        private javax.swing.JTextField text;
        private javax.swing.JButton zarb1;
        private javax.swing.JButton zarb2;
        // End of variables declaration                   
    }
    
  • من تازه جاوا رو شروع کردم و دارم یه برنامه گرافیکی ساده که bmi رو حساب میکنه میسازم . این برنامه من دو تا فرم داره که تو فرم اول وزن رو از کاربر میگیره و در متغیری به اسم mass ذخیره میکنه و وقتی کاربر وزن خودشو وارد کرد و بر روی دکمه next زد وارد فرم (JFrame) دوم میشه که اونجا باید قدش رو وارد کنه و وقتی روی دکمه result زد نتیجه بهش نمایش داده بشه . حالا من می خوام داده ای رو که از فرم اول (وزن) بدست آوردم رو در فرم دوم استفاده کنم . وقتی در فرم دوم متدی که متغیر mass (وزن ) وجود داره رو صدا میزنم و آن متغیر رو صدا میکنم ، و آن متغیر رو در فرمول میذارم و وقتی که برنامه رو اجرا میکنم جواب صفر رو نشون میده .علت چیه ؟؟؟ ممنون میشم دوستان راهنماییم کنن .

  • @behzad این کد رو باید کجا بزنیم ؟