1. Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Aug 2010
    Location
    Eastern Florida
    Posts
    3,711
    Rep Power
    347
    The code won't compile without the FrameBaru class.

    You have not explained what the posted code does that is not what you want to happen.

    The TOTAL lines for the program should be 400 lines.
    Make a small version of the FrameBaru class or remove it from the extends clause.
  2. No Profile Picture
    Permanently Banned
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    257
    Rep Power
    0
    In this code, I want my user to login. After that, they will need to fill in the criteria of sickness and medicine alternatives. You can use google translate to translate them to English. After the user click the lanjut button, I want user's input in criteria to be the content of the JLabel that will show up. After those JLabels show up, show correct text and the user click the next lanjut button, I want the user's input in alternatives to be the text of the JLabels that will show up. Can you analyze this first?
  3. Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Aug 2010
    Location
    Eastern Florida
    Posts
    3,711
    Rep Power
    347
    Can you make a small, simple program that compiles, executes and shows the problem.
    What you have posted is too big for testing. The TOTAL number of lines under 400 would be good.
    Also I do not have a DB for testing with the posted code. I made one for the first versions of your question and was able to use that. Now the code uses a different DB and mine does not work.
    If the problem is NOT because of the DB, make a program for testing that does NOT require a DB.
  4. No Profile Picture
    Permanently Banned
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    257
    Rep Power
    0
    Code:
    package programtesisbaru;
    
    import javax.swing.*;
    
    /**
     *
     * @author Tawi
     */
    class FrameBaru extends JFrame {  
         JLabel tampilKriteria = new JLabel("");  
         JLabel tampilKriteria1 = new JLabel("");  
         JButton ubah = new JButton("Ubah Paduk Data");  
         JButton kembali = new JButton("Kembali ke Menu Utama");  
         JButton lanjutlah = new JButton("Lanjut");  
         JButton lanjutlah1 = new JButton("Lanjut");  
         JButton perhitunganKriteria = new JButton("Perhitungan Kriteria");  
         JButton perhitunganKriteria1 = new JButton("Perhitungan Kriteria");  
         JButton kmbl = new JButton("");  
         JButton kmbl1 = new JButton("");  
         JButton update = new JButton("Update Paduk Data");  
         JButton update1 = new JButton("Update Paduk Data");  
         JLabel myocardInfarc = new JLabel("Myocardial Infarction");  
         JLabel stroke1 = new JLabel("Stroke");  
         JTextField[][] jawabKriteria1 = new JTextField[16][2];  
         JTextField[][] jawabAlternatif1 = new JTextField[25][2];  
         JLabel[][] labelLuarKriteria = new JLabel[4][2];  
         JLabel[][] labelLuarAlternatif = new JLabel[5][2];  
         JLabel[][] labelLuarAlternatif1 = new JLabel[5][2];  
        String[][] lblKriteria = new String[4][2];  
        String[][] lblAlternatif = new String[5][2];  
        JLabel labelLuarKriteria1[][] = new JLabel[4][2];  
        int xyz = 0;  
        int xyz1 = 3;  
        JButton kriteriaLanjut = new JButton("");  
        JButton kriteriaLanjut1 = new JButton("");  
        String[][] variabelTampung = new String[100][2];  
     public  FrameBaru() {    
            setSize(1024,768);  
            setVisible(true);  
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);  
            setLocationRelativeTo(null);  
      
    setLayout(null);  
    for (int ijk = 0; ijk < labelLuarKriteria.length; ijk++) {    
        for (int ikj = 0; ikj < labelLuarKriteria[ijk].length; ikj++) {    
            labelLuarKriteria[ijk][ikj] = new JLabel();    
        }    
    }  
    for (int ijbak = 0; ijbak < labelLuarAlternatif.length; ijbak++) {    
        for (int ikbaj = 0; ikbaj < labelLuarAlternatif[ijbak].length; ikbaj++) {    
            labelLuarAlternatif[ijbak][ikbaj] = new JLabel();    
        }    
    }  
    for (int ijbaki = 0; ijbaki < labelLuarAlternatif1.length; ijbaki++) {    
        for (int ikbaji = 0; ikbaji < labelLuarAlternatif1[ijbaki].length; ikbaji++) {    
            labelLuarAlternatif1[ijbaki][ikbaji] = new JLabel();    
        }    
    }  
    for (int ijak = 0; ijak < labelLuarKriteria1.length; ijak++) {    
        for (int ikaj = 0; ikaj < labelLuarKriteria1[ijak].length; ikaj++) {    
            labelLuarKriteria1[ijak][ikaj] = new JLabel();    
        }    
    }  
    for (int ijka = 0; ijka < lblKriteria.length; ijka++) {    
        for (int ikja = 0; ikja < lblKriteria[ijka].length; ikja++) {    
            lblKriteria[ijka][ikja] = new String();    
        }    
    }  
    for (int ijkab = 0; ijkab < lblAlternatif.length; ijkab++) {    
        for (int ikjab = 0; ikjab < lblAlternatif[ijkab].length; ikjab++) {    
            lblAlternatif[ijkab][ikjab] = new String();    
        }    
    }  
    for (int ijkabl = 0; ijkabl < lblAlternatif.length; ijkabl++) {    
        for (int ikjabl = 0; ikjabl < lblAlternatif[ijkabl].length; ikjabl++) {    
            lblAlternatif[ijkabl][ikjabl] = new String();    
        }    
    }  
    for (int kijk = 0; kijk < jawabKriteria1.length; kijk++) {    
        for (int kikj = 0; kikj < jawabKriteria1[kijk].length; kikj++) {    
            jawabKriteria1[kijk][kikj] = new JTextField();    
        }    
    }  
    for (int kabijk = 0; kabijk < jawabAlternatif1.length; kabijk++) {    
        for (int kabikj = 0; kabikj < jawabAlternatif1[kabijk].length; kabikj++) {    
            jawabAlternatif1[kabijk][kabikj] = new JTextField();    
        }    
    }  
    tampilKriteria.setText(lblKriteria[0][0]);  
    tampilKriteria1.setText(lblKriteria[0][0]);  
    for (int olp = 0; olp <4; olp++)  
    {  
        labelLuarKriteria[olp][0].setText(lblKriteria[olp][0]);  
        labelLuarKriteria1[olp][0].setText(lblKriteria[olp][0]);  
    }  
    for (int olt = 0; olt < 4; olt++)  
    {  
        labelLuarKriteria[olt][1].setText(lblKriteria[olt][1]);  
        labelLuarKriteria1[olt][1].setText(lblKriteria[olt][1]);  
    }  
    for (int olta = 0; olta < 5; olta++)  
    {  
        labelLuarAlternatif[olta][1].setText(lblAlternatif[olta][1]);  
        labelLuarAlternatif1[olta][1].setText(lblAlternatif[olta][1]);  
    }  
    for (int oltab = 0; oltab < 5; oltab++)  
    {  
        labelLuarAlternatif[oltab][0].setText(lblAlternatif[oltab][0]);  
        labelLuarAlternatif1[oltab][0].setText(lblAlternatif[oltab][0]);  
    }  
    myocardInfarc.setBounds(0,0,200,25);    
    labelLuarKriteria[0][0].setBounds(0,150,100,25);  
    labelLuarKriteria[1][0].setBounds(0,180,100,25);  
    labelLuarKriteria[2][0].setBounds(0,210,100,25);  
    labelLuarKriteria[3][0].setBounds(0,240,100,25);  
    labelLuarKriteria1[0][0].setBounds(101,100,100,25);  
    labelLuarKriteria1[1][0].setBounds(202,100,100,25);  
    labelLuarKriteria1[2][0].setBounds(303,100,100,25);  
    labelLuarKriteria1[3][0].setBounds(404,100,100,25);  
    jawabKriteria1[0][0].setBounds(101,180,100,25);  
    jawabKriteria1[1][0].setBounds(101,210,100,25);  
    jawabKriteria1[2][0].setBounds(101,240,100,25);  
    jawabKriteria1[3][0].setBounds(101,270,100,25);  
    jawabKriteria1[4][0].setBounds(202,180,100,25);  
    jawabKriteria1[5][0].setBounds(202,210,100,25);  
    jawabKriteria1[6][0].setBounds(202,240,100,25);  
    jawabKriteria1[7][0].setBounds(202,270,100,25);  
    jawabKriteria1[8][0].setBounds(303,180,100,25);  
    jawabKriteria1[9][0].setBounds(303,210,100,25);  
    jawabKriteria1[10][0].setBounds(303,240,100,25);  
    jawabKriteria1[11][0].setBounds(303,270,100,25);  
    jawabKriteria1[12][0].setBounds(404,180,100,25);  
    jawabKriteria1[13][0].setBounds(404,210,100,25);  
    jawabKriteria1[14][0].setBounds(404,240,100,25);  
    jawabKriteria1[15][0].setBounds(404,270,100,25);  
    labelLuarAlternatif[0][0].setBounds(405,150,100,25);  
    labelLuarAlternatif[1][0].setBounds(405,180,100,25);  
    labelLuarAlternatif[2][0].setBounds(405,210,100,25);  
    labelLuarAlternatif[3][0].setBounds(405,240,100,25);  
    labelLuarAlternatif[4][0].setBounds(405,270,100,25);  
    labelLuarAlternatif1[0][0].setBounds(506,100,100,25);  
    labelLuarAlternatif1[1][0].setBounds(607,100,100,25);  
    labelLuarAlternatif1[2][0].setBounds(708,100,100,25);  
    labelLuarAlternatif1[3][0].setBounds(809,100,100,25);  
    labelLuarAlternatif1[4][0].setBounds(910,100,100,25);  
    lanjutlah.setBounds(403,270,100,25);  
    add(lanjutlah);  
    jawabAlternatif1[0][0].setBounds(506,150,100,25);  
    jawabAlternatif1[1][0].setBounds(506,180,100,25);  
    jawabAlternatif1[2][0].setBounds(506,210,100,25);  
    jawabAlternatif1[3][0].setBounds(506,240,100,25);  
    jawabAlternatif1[4][0].setBounds(506,270,100,25);  
    jawabAlternatif1[5][0].setBounds(607,150,100,25);  
    jawabAlternatif1[6][0].setBounds(607,180,100,25);  
    jawabAlternatif1[7][0].setBounds(607,210,100,25);  
    jawabAlternatif1[8][0].setBounds(607,240,100,25);  
    jawabAlternatif1[9][0].setBounds(607,270,100,25);  
    jawabAlternatif1[10][0].setBounds(708,150,100,25);  
    jawabAlternatif1[11][0].setBounds(708,180,100,25);  
    jawabAlternatif1[12][0].setBounds(708,210,100,25);  
    jawabAlternatif1[13][0].setBounds(708,240,100,25);  
    jawabAlternatif1[14][0].setBounds(708,270,100,25);  
    jawabAlternatif1[15][0].setBounds(809,150,100,25);  
    jawabAlternatif1[16][0].setBounds(809,180,100,25);  
    jawabAlternatif1[17][0].setBounds(809,210,100,25);  
    jawabAlternatif1[18][0].setBounds(809,240,100,25);  
    jawabAlternatif1[19][0].setBounds(809,270,100,25);  
    jawabAlternatif1[20][0].setBounds(910,150,100,25);  
    jawabAlternatif1[21][0].setBounds(910,180,100,25);  
    jawabAlternatif1[22][0].setBounds(910,210,100,25);  
    jawabAlternatif1[23][0].setBounds(910,240,100,25);  
    jawabAlternatif1[24][0].setBounds(910,270,100,25);  
    perhitunganKriteria.setBounds(506,330,200,25);  
    perhitunganKriteria1.setBounds(506,430,200,25); 
    update.setBounds(809,330,200,25);  
    tampilKriteria.setBounds(708,330,100,25);  
    tampilKriteria1.setBounds(708,630,100,25);  
    update.setVisible(false);  
    update1.setVisible(false);  
    tampilKriteria.setVisible(false);  
    tampilKriteria1.setVisible(false);  
    update1.setBounds(809,630,200,25);  
    kmbl.setBounds(506,300,251,25);  
    kmbl1.setBounds(506,600,251,25);  
    kriteriaLanjut.setBounds(758,300,251,25);  
    kriteriaLanjut1.setBounds(758,600,251,25);  
    kriteriaLanjut.setVisible(false);  
    kriteriaLanjut1.setVisible(false);  
    add(kmbl);  
    add(kmbl1);  
    add(kriteriaLanjut);  
    add(kriteriaLanjut1);  
    add(update);  
    add(update1);  
    add(tampilKriteria);  
    add(tampilKriteria1);  
    kmbl.setVisible(false);  
    kmbl1.setVisible(false);  
    perhitunganKriteria.setVisible(false);  
    add(perhitunganKriteria);  
    perhitunganKriteria1.setVisible(false); 
    add(perhitunganKriteria1);
    for (int mnjk = 0; mnjk < 25; mnjk++)  
    {  
        add(jawabAlternatif1[mnjk][0]);  
        jawabAlternatif1[mnjk][0].setVisible(false);  
        add(jawabAlternatif1[mnjk][1]);  
        jawabAlternatif1[mnjk][1].setVisible(false);  
    }  
    add(myocardInfarc);  
    for (int yul = 0; yul < 4; yul++)  
    {  
        add(labelLuarKriteria[yul][0]);  
        add(labelLuarKriteria1[yul][0]);  
    }  
    for (int yulp = 0; yulp < 5; yulp++)  
    {  
        add(labelLuarAlternatif[yulp][0]);  
        add(labelLuarAlternatif1[yulp][0]);  
        add(labelLuarAlternatif[yulp][1]);  
        add(labelLuarAlternatif1[yulp][1]);  
        labelLuarAlternatif[yulp][0].setVisible(false);  
        labelLuarAlternatif1[yulp][0].setVisible(false);  
        labelLuarAlternatif[yulp][1].setVisible(false);  
        labelLuarAlternatif1[yulp][1].setVisible(false);  
    }  
    for (int s = 0; s < 16; s++)  
    {  
        add(jawabKriteria1[s][0]);  
    }    
    stroke1.setBounds(0,360,200,25);  
    labelLuarKriteria[0][1].setBounds(0,450,100,25);  
    labelLuarKriteria[1][1].setBounds(0,480,100,25);  
    labelLuarKriteria[2][1].setBounds(0,510,100,25);  
    labelLuarKriteria[3][1].setBounds(0,540,100,25);  
    labelLuarKriteria1[0][1].setBounds(101,400,100,25);  
    labelLuarKriteria1[1][1].setBounds(202,400,100,25);  
    labelLuarKriteria1[2][1].setBounds(303,400,100,25);  
    labelLuarKriteria1[3][1].setBounds(404,400,100,25);  
    jawabKriteria1[0][1].setBounds(101,450,100,25);  
    jawabKriteria1[1][1].setBounds(101,480,100,25);  
    jawabKriteria1[2][1].setBounds(101,510,100,25);  
    jawabKriteria1[3][1].setBounds(101,540,100,25);  
    jawabKriteria1[4][1].setBounds(202,450,100,25);  
    jawabKriteria1[5][1].setBounds(202,480,100,25);  
    jawabKriteria1[6][1].setBounds(202,510,100,25);  
    jawabKriteria1[7][1].setBounds(202,540,100,25);  
    jawabKriteria1[8][1].setBounds(303,450,100,25);  
    jawabKriteria1[9][1].setBounds(303,480,100,25);  
    jawabKriteria1[10][1].setBounds(303,510,100,25);  
    jawabKriteria1[11][1].setBounds(303,540,100,25);  
    jawabKriteria1[12][1].setBounds(404,450,100,25);  
    jawabKriteria1[13][1].setBounds(404,480,100,25);  
    jawabKriteria1[14][1].setBounds(404,510,100,25);  
    jawabKriteria1[15][1].setBounds(404,540,100,25);  
    labelLuarAlternatif[0][1].setBounds(405,450,100,25);  
    labelLuarAlternatif[1][1].setBounds(405,480,100,25);  
    labelLuarAlternatif[2][1].setBounds(405,510,100,25);  
    labelLuarAlternatif[3][1].setBounds(405,540,100,25);  
    labelLuarAlternatif[4][1].setBounds(405,570,100,25);  
    labelLuarAlternatif1[0][1].setBounds(506,400,100,25);  
    labelLuarAlternatif1[1][1].setBounds(607,400,100,25);  
    labelLuarAlternatif1[2][1].setBounds(708,400,100,25);  
    labelLuarAlternatif1[3][1].setBounds(809,400,100,25);  
    labelLuarAlternatif1[4][1].setBounds(910,400,100,25);  
    jawabAlternatif1[0][1].setBounds(506,450,100,25);  
    jawabAlternatif1[1][1].setBounds(506,480,100,25);  
    jawabAlternatif1[2][1].setBounds(506,510,100,25);  
    jawabAlternatif1[3][1].setBounds(506,540,100,25);  
    jawabAlternatif1[4][1].setBounds(506,570,100,25);  
    jawabAlternatif1[5][1].setBounds(607,450,100,25);  
    jawabAlternatif1[6][1].setBounds(607,480,100,25);  
    jawabAlternatif1[7][1].setBounds(607,510,100,25);  
    jawabAlternatif1[8][1].setBounds(607,540,100,25);  
    jawabAlternatif1[9][1].setBounds(607,570,100,25);  
    jawabAlternatif1[10][1].setBounds(708,450,100,25);  
    jawabAlternatif1[11][1].setBounds(708,480,100,25);  
    jawabAlternatif1[12][1].setBounds(708,510,100,25);  
    jawabAlternatif1[13][1].setBounds(708,540,100,25);  
    jawabAlternatif1[14][1].setBounds(708,570,100,25);  
    jawabAlternatif1[15][1].setBounds(809,450,100,25);  
    jawabAlternatif1[16][1].setBounds(809,480,100,25);  
    jawabAlternatif1[17][1].setBounds(809,510,100,25);  
    jawabAlternatif1[18][1].setBounds(809,540,100,25);  
    jawabAlternatif1[19][1].setBounds(809,570,100,25);  
    jawabAlternatif1[20][1].setBounds(910,450,100,25);  
    jawabAlternatif1[21][1].setBounds(910,480,100,25);  
    jawabAlternatif1[22][1].setBounds(910,510,100,25);  
    jawabAlternatif1[23][1].setBounds(910,540,100,25);  
    jawabAlternatif1[24][1].setBounds(910,570,100,25);  
    lanjutlah1.setBounds(404,570,100,25);  
    kembali.setBounds(0,700,200,25);  
    add(lanjutlah1);  
    add(kembali);  
    lanjutlah.addActionListener(new java.awt.event.ActionListener() {          
                @Override  
                public void actionPerformed(java.awt.event.ActionEvent evt) {   
                    for (int hulap = 0; hulap < 16; hulap++)  
                    {  
                        jawabKriteria1[hulap][0].setVisible(false);  
                    }  
                    for (int hulapa = 0; hulapa < 4; hulapa++)  
                    {  
                        labelLuarKriteria[hulapa][0].setVisible(false);  
                        labelLuarKriteria1[hulapa][0].setVisible(false);  
                    }  
                    for (int hulapar = 0; hulapar < 5; hulapar++)  
                    {  
                        labelLuarAlternatif[hulapar][0].setVisible(true);  
                        labelLuarAlternatif1[hulapar][0].setVisible(true);  
                    }  
                    lanjutlah.setVisible(false);  
                    perhitunganKriteria.setVisible(true);  
                    tampilKriteria.setVisible(true);  
                    kriteriaLanjut.setVisible(true);  
                    update.setVisible(true);  
                    kmbl.setVisible(true);  
                    kmbl.setEnabled(false);  
                    for (int mnjka = 0; mnjka < 25; mnjka++)  
                    {  
                        jawabAlternatif1[mnjka][0].setVisible(true);  
                    }  
                }  
        });  
    lanjutlah1.addActionListener(new java.awt.event.ActionListener() {          
                @Override  
                public void actionPerformed(java.awt.event.ActionEvent evt) {   
                    for (int hulapl = 0; hulapl < 16; hulapl++)  
                    {  
                        jawabKriteria1[hulapl][1].setVisible(false);  
                    }  
                    for (int hulapak = 0; hulapak < 4; hulapak++)  
                    {  
                        labelLuarKriteria[hulapak][1].setVisible(false);  
                        labelLuarKriteria1[hulapak][1].setVisible(false);  
                    }  
                    for (int hulapark = 0; hulapark < 5; hulapark++)  
                    {  
                        labelLuarAlternatif[hulapark][1].setVisible(true);  
                        labelLuarAlternatif1[hulapark][1].setVisible(true);  
                    }  
                    lanjutlah1.setVisible(false);  
                    perhitunganKriteria1.setVisible(true);  
                    tampilKriteria1.setVisible(true);  
                    update1.setVisible(true);  
                    kriteriaLanjut1.setVisible(true);  
                    kmbl1.setVisible(true);  
                    kmbl1.setEnabled(false);  
                    for (int mnjkap = 0; mnjkap < 25; mnjkap++)  
                    {  
                        jawabAlternatif1[mnjkap][1].setVisible(true);  
                    }  
                }  
        });  
    kembali.addActionListener(new java.awt.event.ActionListener() {          
                @Override  
                public void actionPerformed(java.awt.event.ActionEvent evt) {   
                    setTitle("Program Pemilihan Obat dengan Cara Analytic Hierarchycal Process");  
                    setSize(1024,768);  
                    setVisible(true);  
                    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);  
                    setLocationRelativeTo(null);  
                    /*lblNama.setVisible(false); 
                    txtNama.setVisible(false); 
                    kataSandi.setVisible(false); 
                    sandiKata.setVisible(false); 
     masuk.setVisible(false); 
     keluar.setVisible(false); 
     tombolHubungkankePadukData.setVisible(false); 
     putuskanKoneksiKePadukData.setVisible(false); 
     tombolUbahPadukData.setVisible(false); 
     tombolBatal.setVisible(false); 
     lanjut.setVisible(false); 
     jcboURL.setVisible(false); 
     jcboDriver.setVisible(false); 
     statusKoneksi.setVisible(false); 
     padukData.setVisible(false); 
     myocardialInfarction.setVisible(false); 
     stroke.setVisible(false); 
     for (int hklma = 0; hklma < kriteria.length; hklma++) {   
        for (int nyola = 0; nyola < kriteria[hklma].length; nyola++) {   
            kriteria[hklma][nyola].setVisible(true);   
        }   
    } 
     for (int hklma = 0; hklma < alternatif.length; hklma++) {   
        for (int nyola = 0; nyola < alternatif[hklma].length; nyola++) {   
            alternatif[hklma][nyola].setVisible(true);   
        }   
    } 
     statusMasuk.setVisible(false);*/    
         tampilKriteria.setVisible(false);  
         tampilKriteria1.setVisible(false);  
         ubah.setVisible(false);  
         kembali.setVisible(false);  
         lanjutlah.setVisible(false);  
         lanjutlah1.setVisible(false);  
         perhitunganKriteria.setVisible(false);  
         perhitunganKriteria1.setVisible(false);  
         kmbl.setVisible(false);  
         kmbl1.setVisible(false);  
         update.setVisible(false);  
         update1.setVisible(false);  
         myocardInfarc.setVisible(false);  
         stroke1.setVisible(false);  
        for (int hklma = 0; hklma < jawabKriteria1.length; hklma++) {    
        for (int nyola = 0; nyola < jawabKriteria1[hklma].length; nyola++) {    
            jawabKriteria1[hklma][nyola].setVisible(false);    
        }    
    }  
        for (int hklma = 0; hklma < jawabAlternatif1.length; hklma++) {    
        for (int nyola = 0; nyola < jawabAlternatif1[hklma].length; nyola++) {    
            jawabAlternatif1[hklma][nyola].setVisible(false);    
        }    
    }  
         for (int hklma = 0; hklma < labelLuarKriteria.length; hklma++) {    
        for (int nyola = 0; nyola < labelLuarKriteria[hklma].length; nyola++) {    
            labelLuarKriteria[hklma][nyola].setVisible(false);    
        }    
    }  
         for (int hklma = 0; hklma < labelLuarAlternatif.length; hklma++) {    
        for (int nyola = 0; nyola < labelLuarAlternatif[hklma].length; nyola++) {    
            labelLuarAlternatif[hklma][nyola].setVisible(false);    
        }    
    }  
         for (int hklma = 0; hklma < labelLuarAlternatif1.length; hklma++) {    
        for (int nyola = 0; nyola < labelLuarAlternatif1[hklma].length; nyola++) {    
            labelLuarAlternatif1[hklma][nyola].setVisible(false);    
        }    
    }  
         for (int hklm = 0; hklm < labelLuarKriteria1.length; hklm++) {    
        for (int nyol = 0; nyol < labelLuarKriteria1[hklm].length; nyol++) {    
            labelLuarKriteria1[hklm][nyol].setVisible(false);    
        }    
    }  
         kriteriaLanjut.setVisible(false);  
         kriteriaLanjut1.setVisible(false);  
                }  
        });  
    perhitunganKriteria.addActionListener(new java.awt.event.ActionListener() {          
                @Override  
                public void actionPerformed(java.awt.event.ActionEvent evt) {   
                    for (int hulapr = 0; hulapr < 16; hulapr++)  
                    {  
                        jawabKriteria1[hulapr][0].setVisible(true);  
                    }  
                    for (int hulapae = 0; hulapae < 4; hulapae++)  
                    {  
                        labelLuarKriteria[hulapae][0].setVisible(true);  
                        labelLuarKriteria1[hulapae][0].setVisible(true);  
                    }  
                    for (int hulapars = 0; hulapars < 5; hulapars++)  
                    {  
                        labelLuarAlternatif[hulapars][0].setVisible(false);  
                        labelLuarAlternatif1[hulapars][0].setVisible(false);  
                    }  
                    lanjutlah.setVisible(true);  
                    perhitunganKriteria.setVisible(false);  
                    update.setVisible(false);  
                    tampilKriteria.setVisible(false);  
                    kriteriaLanjut.setVisible(false);  
                    kmbl.setVisible(false);  
                    kmbl.setEnabled(true);  
                    for (int mnjkas = 0; mnjkas < 25; mnjkas++)  
                    {  
                        jawabAlternatif1[mnjkas][0].setVisible(false);  
                    }  
                }  
        });  
    perhitunganKriteria1.addActionListener(new java.awt.event.ActionListener() {          
                @Override  
                public void actionPerformed(java.awt.event.ActionEvent evt) {   
                    for (int hulapla = 0; hulapla < 16; hulapla++)  
                    {  
                        jawabKriteria1[hulapla][1].setVisible(true);  
                    }  
                    for (int hulapaka = 0; hulapaka < 4; hulapaka++)  
                    {  
                        labelLuarKriteria[hulapaka][1].setVisible(true);  
                        labelLuarKriteria1[hulapaka][1].setVisible(true);  
                    }  
                    for (int hulaparka = 0; hulaparka < 5; hulaparka++)  
                    {  
                        labelLuarAlternatif[hulaparka][1].setVisible(false);  
                        labelLuarAlternatif1[hulaparka][1].setVisible(false);  
                    }  
                    lanjutlah1.setVisible(true);  
                    perhitunganKriteria1.setVisible(false);  
                    update1.setVisible(false);  
                    kriteriaLanjut1.setVisible(false);  
                    tampilKriteria1.setVisible(false);  
                    kmbl1.setVisible(false);  
                    kmbl1.setEnabled(false);  
                    for (int mnjkapa = 0; mnjkapa < 25; mnjkapa++)  
                    {  
                        jawabAlternatif1[mnjkapa][1].setVisible(false);  
                    }  
                }  
        });  
    kriteriaLanjut.addActionListener(new java.awt.event.ActionListener() {          
                @Override  
                public void actionPerformed(java.awt.event.ActionEvent evt) {   
                    xyz = xyz++;  
                    kriteriaLanjut.setText(lblKriteria[xyz][0]);  
                    for (int dlp = 0; dlp < 25; dlp++)  
                    {  
                        variabelTampung[dlp + ((xyz-1)*25)][0] = jawabAlternatif1[dlp][0].getText();  
                    }  
                    kmbl.setText(lblKriteria[xyz-1][0]);  
                    if (xyz > 3)  
                      {  
                        xyz--;  
                        kmbl.setText(lblKriteria[xyz-1][0]);  
                        JOptionPane.showMessageDialog(null, "Akhir Kriteria", "Pesan Kesalahan", JOptionPane.INFORMATION_MESSAGE);  
                      }  
                }  
        });  
    kmbl.addActionListener(new java.awt.event.ActionListener() {          
                @Override  
                public void actionPerformed(java.awt.event.ActionEvent evt) {   
                    if (xyz != 0) {
                    xyz--;  
                    kriteriaLanjut.setText(lblKriteria[xyz][0]);  
                    for (int dlp = 0; dlp < 25; dlp++)  
                    {  
                        jawabAlternatif1[dlp][0].setText(variabelTampung[dlp + ((xyz * 25))][0]);  
                    }  
                    if (xyz - 1 == 0) {
                    kmbl.setText("");}}  
                    else  
                    {  
                        kmbl.setText("");  
                        xyz++;  
                        JOptionPane.showMessageDialog(null, "Awal Kriteria", "Pesan Kesalahan", JOptionPane.INFORMATION_MESSAGE);  
                    }  
                }  
        });  
    kmbl1.addActionListener(new java.awt.event.ActionListener() {          
                @Override  
                public void actionPerformed(java.awt.event.ActionEvent evt) {   
                    xyz1--;  
                    kriteriaLanjut1.setText(lblKriteria[xyz1][1]);  
                    for (int dlp = 0; dlp < 25; dlp++)  
                    {  
                        jawabAlternatif1[dlp][1].setText(variabelTampung[dlp + ((xyz1 * 25))][1]);  
                    }  
                    kmbl.setText(lblKriteria[xyz1-1][1]);  
                    if (xyz1 == 0)  
                    {  
                        kmbl1.setText("");  
                        xyz1++;  
                        for (int dlp = 0; dlp < 25; dlp++)  
                    {  
                        jawabAlternatif1[dlp][1].setText(variabelTampung[dlp + ((xyz1 * 25))][1]);  
                    }  
                        JOptionPane.showMessageDialog(null, "Awal Kriteria", "Pesan Kesalahan", JOptionPane.INFORMATION_MESSAGE);  
                    }  
                }});  
    kriteriaLanjut1.addActionListener(new java.awt.event.ActionListener() {          
                @Override  
                public void actionPerformed(java.awt.event.ActionEvent evt) {   
                    xyz1 = xyz1++;  
                    kriteriaLanjut1.setText(lblKriteria[xyz1][1]);  
                    for (int dlp = 0; dlp < 25; dlp++)  
                    {  
                        variabelTampung[dlp + ((xyz1-1)*25)][1] = jawabAlternatif1[dlp][1].getText();  
                    }  
                    kmbl1.setText(lblKriteria[xyz1-1][1]);  
                    if (xyz1 > 3)  
    {  
    xyz1--;  
    kmbl1.setText(lblKriteria[xyz1-1][1]);  
    for (int dlp = 0; dlp < 25; dlp++)  
    {  
    variabelTampung[dlp + ((xyz1)*25)][1] = jawabAlternatif1[dlp][1].getText();  
    }  
    JOptionPane.showMessageDialog(null, "Akhir Kriteria", "Pesan Kesalahan", JOptionPane.INFORMATION_MESSAGE);  
    }  
    }  
    });  
    add(stroke1);  
    for (int kul = 0; kul < 4; kul++)  
    {  
    add(labelLuarKriteria[kul][1]);  
    add(labelLuarKriteria1[kul][1]);  
    }  
    for (int s = 0; s < 16; s++)  
    {  
    add(jawabKriteria1[s][1]);  
    }  
    }  
    }
    This FrameBaru is not a long code. I do not optimize it. This should be a small code only. Please analyze it because I have no time to optimize it ok?
  5. Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Aug 2010
    Location
    Eastern Florida
    Posts
    3,711
    Rep Power
    347
    sorry, that makes the total lines for the program too big.
    Make the testing classes small enough so that the TOTAL lines for all the code is near 400 lines.
  6. No Profile Picture
    Permanently Banned
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    257
    Rep Power
    0
    Originally Posted by NormR
    sorry, that makes the total lines for the program too big.
    Make the testing classes small enough so that the TOTAL lines for all the code is near 400 lines.
    From NewProgramTesisBaru, what code do you think can make the Perhitungan Kriteria to show up at the beginning timeat the time I run the code?
  7. Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Aug 2010
    Location
    Eastern Florida
    Posts
    3,711
    Rep Power
    347
    What code controls when "Perhitungan Kriteria" shows? I see that String used in 3 places in the posted code. Which one of the three are you asking about?
    Where in the frame is "Perhitungan Kriteria" supposed to show?
  8. No Profile Picture
    Permanently Banned
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    257
    Rep Power
    0
    Originally Posted by NormR
    What code controls when "Perhitungan Kriteria" shows? I see that String used in 3 places in the posted code. Which one of the three are you asking about?
    Where in the frame is "Perhitungan Kriteria" supposed to show?
    The "Perhitungan Kriteria" is supposed to show in NewProgramTesisBaru frame but not in the beginning of the code. I set it to show up after the user click the lanjut button after the code run, what is the problem that makes the "Perhitungan Kriteria" to show up in the beginning of the code?
  9. Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Aug 2010
    Location
    Eastern Florida
    Posts
    3,711
    Rep Power
    347
    supposed to show in NewProgramTesisBaru frame but not in the beginning
    Which of the 3 places that the String is used is the problem? What is the name of the variable that shows the message?

    When you find which variable is the one that is showing the message at the wrong time, then see why it is being shown.
    what is the problem that makes the "Perhitungan Kriteria" to show up in the beginning of the code?
    Is this a label that is supposed to be setVisible(false)? Make sure that the code calls setVisible(false) for the label.
    Try debugging the code by adding a call to the println() method next to ALL the places where the setVisible() method is called so you can see which setVisible() method is called last and then you will know why the String is being shown.
  10. No Profile Picture
    Permanently Banned
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    257
    Rep Power
    0
    Originally Posted by NormR
    Which of the 3 places that the String is used is the problem? What is the name of the variable that shows the message?

    When you find which variable is the one that is showing the message at the wrong time, then see why it is being shown.

    Is this a label that is supposed to be setVisible(false)? Make sure that the code calls setVisible(false) for the label.
    Try debugging the code by adding a call to the println() method next to ALL the places where the setVisible() method is called so you can see which setVisible() method is called last and then you will know why the String is being shown.
    Alright, that problem is solved with copying the code to the old ProgramTesisBaru but the question is how can this become like this?

    How to access the components in ProgramTesisBaru from FrameBaru?
  11. No Profile Picture
    Permanently Banned
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    257
    Rep Power
    0
    Alright, problems solved by moving the code to new files. The question is how can this method solve the problem?

    How to access the component in other files from a files?
  12. Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Aug 2010
    Location
    Eastern Florida
    Posts
    3,711
    Rep Power
    347
    How to access the component in other files from a files?
    Please make a small simple set of files that show the problem and post them.

    For a class in one file to access the contents of a class in another file, you can use the new statement to create an instance of the other class and use the reference to that class to access its contents.
  13. No Profile Picture
    Permanently Banned
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    257
    Rep Power
    0
    Originally Posted by NormR
    Please make a small simple set of files that show the problem and post them.

    For a class in one file to access the contents of a class in another file, you can use the new statement to create an instance of the other class and use the reference to that class to access its contents.
    Can you give me an example?
  14. Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Aug 2010
    Location
    Eastern Florida
    Posts
    3,711
    Rep Power
    347
    Here is an example of code in one class accessing code in another class:
    Code:
    class First {
       void method() {
        Second sec = new Second();  //  create an instance of other class
        sec.method2();                    //  access a method in other class
       }
    } //  end class First
    Code:
      class Second {
         void method2() {
            // ...
         }
      } //  end class Second
  15. No Profile Picture
    Permanently Banned
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    257
    Rep Power
    0
    Originally Posted by NormR
    Here is an example of code in one class accessing code in another class:
    Code:
    class First {
       void method() {
        Second sec = new Second();  //  create an instance of other class
        sec.method2();                    //  access a method in other class
       }
    } //  end class First
    Code:
      class Second {
         void method2() {
            // ...
         }
      } //  end class Second
    The problem is it opens a new frame. How to avoid it to open a new frame?

IMN logo majestic logo threadwatch logo seochat tools logo