Page 11 of 11 FirstFirst ... 91011
Results 201 to 219 of 219
Like Tree22Likes

Thread: How to do this?

  1. #201
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,423
    Rep Power
    25

    Default Re: How to do this?

    @Konrad Congratulations!!! This thread has made it to 200 replies.
    If you don't understand my response, don't ignore it, ask a question.

  2. #202
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    947
    Rep Power
    2

    Default Re: How to do this?

    Quote Originally Posted by Tawi View Post
    NaN
    NaN
    NaN
    NaN
    NaN
    NaN
    NaN
    NaN
    NaN
    NaN
    NaN
    NaN
    NaN
    NaN
    NaN
    NaN
    NaN
    NaN
    NaN
    NaN
    NaN
    NaN
    NaN
    NaN
    NaN
    It's the theme of Batman!
    gimbal2 and JosAH like this.
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2™ © 2013

  3. #203
    kneitzel is offline Senior Member
    Join Date
    Feb 2014
    Posts
    447
    Rep Power
    1

    Default Re: How to do this?

    Quote Originally Posted by Norm View Post
    @Konrad Congratulations!!! This thread has made it to 200 replies.
    Hmm ... is there a special price for posting #200? :)

    With kind regards,

    Konrad

  4. #204
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,030
    Rep Power
    6

    Default Re: How to do this?

    Quote Originally Posted by kneitzel View Post
    Hmm ... is there a special price for posting #200? :)
    A warm, heartfelt facepalm of the epic variety.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  5. #205
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,616
    Rep Power
    5

    Default Re: How to do this?

    I believe it is time to euthanize this thread.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  6. #206
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,526
    Blog Entries
    7
    Rep Power
    20

    Default Re: How to do this?

    Quote Originally Posted by jim829 View Post
    I believe it is time to euthanize this thread.
    With an axe ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  7. #207
    Tawi is offline Senior Member
    Join Date
    Feb 2013
    Posts
    118
    Rep Power
    0

    Default Re: How to do this?

    Guys, why do these happen?

    run:
    4 javax.swing.JLabel[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,bor der=,flags=8388608,maximumSize=,minimumSize=,prefe rredSize=,defaultIcon=,disabledIcon=,horizontalAli gnment=LEADING,horizontalTextPosition=TRAILING,ico nTextGap=4,labelFor=,text=Kriteria 1,verticalAlignment=CENTER,verticalTextPosition=CE NTER]
    5 javax.swing.JLabel[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,bor der=,flags=8388608,maximumSize=,minimumSize=,prefe rredSize=,defaultIcon=,disabledIcon=,horizontalAli gnment=LEADING,horizontalTextPosition=TRAILING,ico nTextGap=4,labelFor=,text=Kriteria 2,verticalAlignment=CENTER,verticalTextPosition=CE NTER]
    6 javax.swing.JLabel[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,bor der=,flags=8388608,maximumSize=,minimumSize=,prefe rredSize=,defaultIcon=,disabledIcon=,horizontalAli gnment=LEADING,horizontalTextPosition=TRAILING,ico nTextGap=4,labelFor=,text=Kriteria 3,verticalAlignment=CENTER,verticalTextPosition=CE NTER]
    7 javax.swing.JLabel[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,bor der=,flags=8388608,maximumSize=,minimumSize=,prefe rredSize=,defaultIcon=,disabledIcon=,horizontalAli gnment=LEADING,horizontalTextPosition=TRAILING,ico nTextGap=4,labelFor=,text=Kriteria 4,verticalAlignment=CENTER,verticalTextPosition=CE NTER]
    8 javax.swing.JLabel[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,bor der=,flags=8388608,maximumSize=,minimumSize=,prefe rredSize=,defaultIcon=,disabledIcon=,horizontalAli gnment=LEADING,horizontalTextPosition=TRAILING,ico nTextGap=4,labelFor=,text=Alternatif 1,verticalAlignment=CENTER,verticalTextPosition=CE NTER]
    9 javax.swing.JLabel[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,bor der=,flags=8388608,maximumSize=,minimumSize=,prefe rredSize=,defaultIcon=,disabledIcon=,horizontalAli gnment=LEADING,horizontalTextPosition=TRAILING,ico nTextGap=4,labelFor=,text=Alternatif 2,verticalAlignment=CENTER,verticalTextPosition=CE NTER]
    10 javax.swing.JLabel[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,bor der=,flags=8388608,maximumSize=,minimumSize=,prefe rredSize=,defaultIcon=,disabledIcon=,horizontalAli gnment=LEADING,horizontalTextPosition=TRAILING,ico nTextGap=4,labelFor=,text=Alternatif 3,verticalAlignment=CENTER,verticalTextPosition=CE NTER]
    11 javax.swing.JLabel[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,bor der=,flags=8388608,maximumSize=,minimumSize=,prefe rredSize=,defaultIcon=,disabledIcon=,horizontalAli gnment=LEADING,horizontalTextPosition=TRAILING,ico nTextGap=4,labelFor=,text=Alternatif 4,verticalAlignment=CENTER,verticalTextPosition=CE NTER]
    12 javax.swing.JLabel[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,bor der=,flags=8388608,maximumSize=,minimumSize=,prefe rredSize=,defaultIcon=,disabledIcon=,horizontalAli gnment=LEADING,horizontalTextPosition=TRAILING,ico nTextGap=4,labelFor=,text=Alternatif 5,verticalAlignment=CENTER,verticalTextPosition=CE NTER]
    4 javax.swing.JLabel[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,bor der=,flags=8388608,maximumSize=,minimumSize=,prefe rredSize=,defaultIcon=,disabledIcon=,horizontalAli gnment=LEADING,horizontalTextPosition=TRAILING,ico nTextGap=4,labelFor=,text=Kriteria 1,verticalAlignment=CENTER,verticalTextPosition=CE NTER]
    5 javax.swing.JLabel[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,bor der=,flags=8388608,maximumSize=,minimumSize=,prefe rredSize=,defaultIcon=,disabledIcon=,horizontalAli gnment=LEADING,horizontalTextPosition=TRAILING,ico nTextGap=4,labelFor=,text=Kriteria 2,verticalAlignment=CENTER,verticalTextPosition=CE NTER]
    6 javax.swing.JLabel[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,bor der=,flags=8388608,maximumSize=,minimumSize=,prefe rredSize=,defaultIcon=,disabledIcon=,horizontalAli gnment=LEADING,horizontalTextPosition=TRAILING,ico nTextGap=4,labelFor=,text=Kriteria 3,verticalAlignment=CENTER,verticalTextPosition=CE NTER]
    7 javax.swing.JLabel[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,bor der=,flags=8388608,maximumSize=,minimumSize=,prefe rredSize=,defaultIcon=,disabledIcon=,horizontalAli gnment=LEADING,horizontalTextPosition=TRAILING,ico nTextGap=4,labelFor=,text=Kriteria 4,verticalAlignment=CENTER,verticalTextPosition=CE NTER]
    8 javax.swing.JLabel[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,bor der=,flags=8388608,maximumSize=,minimumSize=,prefe rredSize=,defaultIcon=,disabledIcon=,horizontalAli gnment=LEADING,horizontalTextPosition=TRAILING,ico nTextGap=4,labelFor=,text=Alternatif 1,verticalAlignment=CENTER,verticalTextPosition=CE NTER]
    9 javax.swing.JLabel[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,bor der=,flags=8388608,maximumSize=,minimumSize=,prefe rredSize=,defaultIcon=,disabledIcon=,horizontalAli gnment=LEADING,horizontalTextPosition=TRAILING,ico nTextGap=4,labelFor=,text=Alternatif 2,verticalAlignment=CENTER,verticalTextPosition=CE NTER]
    10 javax.swing.JLabel[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,bor der=,flags=8388608,maximumSize=,minimumSize=,prefe rredSize=,defaultIcon=,disabledIcon=,horizontalAli gnment=LEADING,horizontalTextPosition=TRAILING,ico nTextGap=4,labelFor=,text=Alternatif 3,verticalAlignment=CENTER,verticalTextPosition=CE NTER]
    11 javax.swing.JLabel[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,bor der=,flags=8388608,maximumSize=,minimumSize=,prefe rredSize=,defaultIcon=,disabledIcon=,horizontalAli gnment=LEADING,horizontalTextPosition=TRAILING,ico nTextGap=4,labelFor=,text=Alternatif 4,verticalAlignment=CENTER,verticalTextPosition=CE NTER]
    12 javax.swing.JLabel[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,bor der=,flags=8388608,maximumSize=,minimumSize=,prefe rredSize=,defaultIcon=,disabledIcon=,horizontalAli gnment=LEADING,horizontalTextPosition=TRAILING,ico nTextGap=4,labelFor=,text=Alternatif 5,verticalAlignment=CENTER,verticalTextPosition=CE NTER]
    1 javax.swing.JLabel[,800,10,200x25,invalid,alignmentX=0.0,alignmentY=0 .0,border=,flags=8388608,maximumSize=,minimumSize= ,preferredSize=,defaultIcon=,disabledIcon=,horizon talAlignment=LEADING,horizontalTextPosition=TRAILI NG,iconTextGap=4,labelFor=,text=Terhubung ke Paduk Data,verticalAlignment=CENTER,verticalTextPosition =CENTER]
    1 javax.swing.JLabel[,800,10,200x25,invalid,alignmentX=0.0,alignmentY=0 .0,border=,flags=8388608,maximumSize=,minimumSize= ,preferredSize=,defaultIcon=,disabledIcon=,horizon talAlignment=LEADING,horizontalTextPosition=TRAILI NG,iconTextGap=4,labelFor=,text=Terhubung ke Paduk Data,verticalAlignment=CENTER,verticalTextPosition =CENTER]

    This is the proyektesis.java:

    Java Code:
    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
    package proyektesis;
    
    /**
     *
     * @author Tawi
     */
    import java.sql.*;
    import javax.swing.*;
    
    public class ProyekTesis extends BaruFrame {
    int i; 
    
          
    public void connectToDB() { 
                    try {  
                        Class.forName(driver);  
                        connection = DriverManager.getConnection(uniRL, usrname, psswrd);  
                        statusKoneksi.setText("Terhubung ke Paduk Data"); 
                        System.out.println("1 " + statusKoneksi);}  
                    catch (Exception ex) { 
                        ex.printStackTrace();
                        statusKoneksi.setText("Gagal Terhubung ke Paduk Data");
                        System.out.println("2 " + statusKoneksi);}}
    public ProyekTesis() {
    this.setLayout(null);
    for (int itlo = 0; itlo < 2; itlo++) {lblPerhitunganKriteria[itlo] = new JLabel("Perhitungan Kriteria"); }
    for (int tlo = 0; tlo < 2; tlo++) {
           kriteria[0][tlo] = new JLabel("Kriteria 1");
           System.out.println("4 " + kriteria[0][tlo]);
           kriteria[1][tlo] = new JLabel("Kriteria 2"); 
           System.out.println("5 " + kriteria[1][tlo]);
           kriteria[2][tlo] = new JLabel("Kriteria 3");  
           System.out.println("6 " + kriteria[2][tlo]);
           kriteria[3][tlo] = new JLabel("Kriteria 4");
           System.out.println("7 " + kriteria[3][tlo]);
           alternatif[0][tlo] = new JLabel("Alternatif 1"); 
           System.out.println("8 " + alternatif[0][tlo]);
           alternatif[1][tlo] = new JLabel("Alternatif 2");  
           System.out.println("9 " + alternatif[1][tlo]);
           alternatif[2][tlo] = new JLabel("Alternatif 3"); 
           System.out.println("10 " + alternatif[2][tlo]);
           alternatif[3][tlo] = new JLabel("Alternatif 4");  
           System.out.println("11 " + alternatif[3][tlo]);
           alternatif[4][tlo] = new JLabel("Alternatif 5");
           System.out.println("12 " + alternatif[4][tlo]);}   
    for (int klof = 0; klof < 5; klof++) {for (int mobil = 0; mobil < 2; mobil++) {jawabAlternatif[klof][mobil] = new JTextField(10); }}
    for (int plof = 0; plof < 4; plof++) {for (int kekar = 0; kekar < 2; kekar++) {jawabKriteria[plof][kekar] = new JTextField(10); }}
    for (int m = 0; m <5; m++)  {for (int prodi = 0; prodi < 2; prodi++)  {
          jawabAlternatif[m][prodi].setEditable(false);    
          jawabAlternatif[m][prodi].setVisible(false); }}  
    for (int hki = 0; hki < 4; hki++)  {for (int hse = 0; hse < 2; hse++) {
          jawabKriteria[hki][hse].setEditable(false);    
          jawabKriteria[hki][hse].setVisible(false);}}   
    kriteria[0][0].setBounds(1,210,100,25);  
    kriteria[1][0].setBounds(1,240,100,25);  
    kriteria[2][0].setBounds(1,270,100,25);  
    kriteria[3][0].setBounds(1,300,100,25);  
    for (int lop = 0; lop < 4; lop++) {this.add(kriteria[lop][0]); }    
    jawabKriteria[0][0].setBounds(101,210,100,25);  
    jawabKriteria[1][0].setBounds(101,240,100,25);  
    jawabKriteria[2][0].setBounds(101,270,100,25);  
    jawabKriteria[3][0].setBounds(101,300,100,25);  
    for (int jki = 0; jki < 4; jki++) {this.add(jawabKriteria[jki][0]); }  
    alternatif[0][0].setBounds(200,210,100,25);  
    alternatif[1][0].setBounds(200,240,100,25);  
    alternatif[2][0].setBounds(200,270,100,25);  
    alternatif[3][0].setBounds(200,300,100,25);  
    alternatif[4][0].setBounds(200,330,100,25);  
    for (int loyo = 0; loyo < 5; loyo++) {this.add(alternatif[loyo][0]); }  
    jawabAlternatif[0][0].setBounds(360,210,70,25);  
    jawabAlternatif[1][0].setBounds(360,240,70,25);  
    jawabAlternatif[2][0].setBounds(360,270,70,25);  
    jawabAlternatif[3][0].setBounds(360,300,70,25);  
    jawabAlternatif[4][0].setBounds(360,330,70,25);  
    for (int gfk = 0; gfk < 5; gfk++) {this.add(jawabAlternatif[gfk][0]); }  
    stroke.setBounds(0,355,200,25);
    kriteria[0][1].setBounds(1,420,100,25);  
    kriteria[1][1].setBounds(1,450,100,25);  
    kriteria[2][1].setBounds(1,480,100,25);  
    kriteria[3][1].setBounds(1,510,100,25);  
    for (int gdu = 0; gdu < 4; gdu++) {this.add(kriteria[gdu][1]); }   
    jawabKriteria[0][1].setBounds(101,420,100,25);  
    jawabKriteria[1][1].setBounds(101,450,100,25);  
    jawabKriteria[2][1].setBounds(101,480,100,25);  
    jawabKriteria[3][1].setBounds(101,510,100,25);  
    for (int jku = 0; jku < 4; jku++) {this.add(jawabKriteria[jku][1]); }  
    alternatif[0][1].setBounds(200,420,100,25);  
    alternatif[1][1].setBounds(200,450,100,25);  
    alternatif[2][1].setBounds(200,480,100,25);  
    alternatif[3][1].setBounds(200,510,100,25);  
    alternatif[4][1].setBounds(200,540,100,25);  
    for (int loyom = 0; loyom < 5; loyom++) {this.add(alternatif[loyom][1]); }  
    jawabAlternatif[0][1].setBounds(360,420,70,25);  
    jawabAlternatif[1][1].setBounds(360,450,70,25);  
    jawabAlternatif[2][1].setBounds(360,480,70,25);  
    jawabAlternatif[3][1].setBounds(360,510,70,25);  
    jawabAlternatif[4][1].setBounds(360,540,70,25);  
    for (int gfki = 0; gfki < 5; gfki++) {this.add(jawabAlternatif[gfki][1]); }  
    this.add(logOff);
    this.add(lanjut);  
    lanjut.setEnabled(false);  
    lblNama.setBounds(0,10,100,25);  
    this.add(lblNama);  
    txtNama.setBounds(130,10,200,25);  
    this.add(txtNama);  
    kataSandi.setBounds(330,10,100,25);  
    this.add(kataSandi);  
    sandiKata.setBounds(410,10,200,25);  
    this.add(sandiKata);  
    masuk.setBounds(600,10,100,25);  
    this.add(masuk);  
    keluar.setBounds(700,10,100,25);  
    this.add(keluar);  
    myocardialInfarction.setBounds(0,90,200,25);
    lblPerhitunganKriteria[0].setBounds(0, 80, 200, 25);
    lblPerhitunganKriteria[1].setBounds(0, 375, 200, 25);
    for (int celt = 0; celt < 2; celt++) {
        lblPerhitunganKriteria[celt].setVisible(false);
        this.add(lblPerhitunganKriteria[celt]);
        lanjutlah[celt].setVisible(false);  
        perhitunganKriteria[celt].setVisible(false);  
        kmbl[celt].setVisible(false);  
        update[celt].setVisible(false); 
        kriteriaLanjut[celt].setVisible(false);}
    this.add(myocardialInfarction);
    tombolHubungkankePadukData.setBounds(0,50,250,25);  
    this.add(tombolHubungkankePadukData);  
    putuskanKoneksiKePadukData.setBounds(250,50,250,25);  
    this.add(putuskanKoneksiKePadukData);  
    tombolUbahPadukData.setBounds(480,50,250,25);  
    this.add(tombolUbahPadukData);  
    tombolBatal.setBounds(730,50,250,25);  
    this.add(tombolBatal);  
    statusKoneksi.setBounds(800,10,200,25);  
    this.add(statusKoneksi);  
    statusMasuk.setBounds(0,70,200,25);
    this.add(statusMasuk);
    tombolHubungkankePadukData.setEnabled(false);  
    putuskanKoneksiKePadukData.setEnabled(false);  
    tombolUbahPadukData.setEnabled(false);    
    tombolBatal.setEnabled(false);   
    statusKoneksi.setVisible(true);  
    lblNama.setVisible(true);  
    txtNama.setVisible(true);  
    kataSandi.setVisible(true);  
    sandiKata.setVisible(true);  
    masuk.setVisible(true);  
    keluar.setVisible(true);
    awal.setVisible(false);
    tombolHubungkankePadukData.setVisible(true);  
    putuskanKoneksiKePadukData.setVisible(true);  
    tombolUbahPadukData.setVisible(true);  
    tombolBatal.setVisible(true);  
    lanjut.setBounds(880,560,100,25);  
    this.add(lanjut);  
    lanjut.setEnabled(false);
    lanjut.setVisible(false);  
    //jcboURL.setVisible(true);  
    //jcboDriver.setVisible(true);  
    statusKoneksi.setVisible(true);
    padukData.setVisible(true);  
    myocardialInfarction.setVisible(false);  
    stroke.setVisible(false);  
    this.add(stroke); 
        for (JLabel[] kriteria1 : kriteria) {  
            for (int kloaka = 0; kloaka < 2; kloaka++) {
                kriteria1[kloaka].setVisible(false);
            }
        }
        for (JLabel[] alternatif1 : alternatif) {     
            for (int kock = 0; kock <2; kock++) {
                alternatif1[kock].setVisible(false);
            }
        }
    statusMasuk.setVisible(true);  
    ubah.setVisible(false);  
        for (JTextField[] jawabKriteria11 : jawabKriteria1) {
            for (JTextField item : jawabKriteria11) {
                item.setVisible(false);
            }
        }
        for (JTextField[] jawabAlternatif11 : jawabAlternatif1) {
            for (JTextField item : jawabAlternatif11) {
                item.setVisible(false);
            }
        }
        for (JLabel[] labelLuarKriteria2 : labelLuarKriteria) {
            for (JLabel item : labelLuarKriteria2) {
                item.setVisible(false);
            }
        }
        for (JLabel[] labelLuarAlternatif2 : labelLuarAlternatif) {
            for (JLabel item : labelLuarAlternatif2) {
                item.setVisible(false);
            }
        }
        for (JLabel[] labelLuarAlternatif11 : labelLuarAlternatif1) {
            for (JLabel item : labelLuarAlternatif11) {
                item.setVisible(false);
            }
        }
        for (JLabel[] labelLuarKriteria11 : labelLuarKriteria1) {
            for (JLabel item : labelLuarKriteria11) {
                item.setVisible(false);
            }
        }
    masuk.addActionListener(new java.awt.event.ActionListener() {  
                String loginName;  
                String loginPassword;    
                String passwrd;
                @Override  
                public void actionPerformed(java.awt.event.ActionEvent evt) {  
                    usrname = txtNama.getText().trim();  
                    psswrd = new String(sandiKata.getPassword());
                    for (int celtf = 0; celtf < 2; celtf++) {lblPerhitunganKriteria[celtf].setVisible(false); }
                    if (("".equals(usrname)) && ("".equals(psswrd)))  {  
                                   tombolHubungkankePadukData.setEnabled(false);  
                                   putuskanKoneksiKePadukData.setEnabled(false);  
                                   tombolUbahPadukData.setEnabled(false);  
                                   tombolBatal.setEnabled(false);  
                                   masuk.setEnabled(true);
                                   statusKoneksi.setText(fx);
                                   keluar.setEnabled(true);  
                                   putuskanKoneksiKePadukData.setEnabled(false); 
                                   JOptionPane.showMessageDialog(null, cx, ex, JOptionPane.INFORMATION_MESSAGE); }  
                    else if ((!"".equals(usrname)) && ("".equals(psswrd))) {  
                                   JOptionPane.showMessageDialog(null, ax, ex, JOptionPane.INFORMATION_MESSAGE);  
                                   tombolHubungkankePadukData.setEnabled(false);  
                                   putuskanKoneksiKePadukData.setEnabled(false);  
                                   tombolUbahPadukData.setEnabled(false);  
                                   tombolBatal.setEnabled(false); 
                                   masuk.setEnabled(true);
                                   statusKoneksi.setText(fx);
                                   keluar.setEnabled(true);  
                                   putuskanKoneksiKePadukData.setEnabled(false); }  
                    else if ((("".equals(usrname)) && (!"".equals(psswrd)))) {      
                                   tombolHubungkankePadukData.setEnabled(false);  
                                   putuskanKoneksiKePadukData.setEnabled(false);  
                                   tombolUbahPadukData.setEnabled(false);  
                                   tombolBatal.setEnabled(false);  
                                   keluar.setEnabled(true);  
                                   masuk.setEnabled(true);
                                   statusKoneksi.setText(fx);
                                   putuskanKoneksiKePadukData.setEnabled(false);  
                                   JOptionPane.showMessageDialog(null, bx, ex, JOptionPane.INFORMATION_MESSAGE); }       
                    else if ((!"".equals(usrname)) && (!"".equals(psswrd))) {connectToDB(); }
                    masuklah(); }  
                private void masuklah() {  
                    try {
                        if (connection.isClosed()) {  
                            masuk.setEnabled(true);  
                            entryPrg(); }  
                        else {
                            masuk.setEnabled(false);
                            entryPrg(); }
                    } catch (Exception ex) {ex.printStackTrace(); }}   
                private void entryPrg() {  
                          connectToDB();
                          try {
                              statement = connection.createStatement();
                              pernyataan = connection.createStatement();
                              loginName = "select Nama_Dokter from tblDokterAhli where Nama_Dokter = '"+usrname+"'";  
                              loginPassword = "select Kata_Kunci from tblDokterAhli where Kata_Kunci = '"+psswrd+"' and Nama_Dokter = '"+usrname+"'";
                              ResultSet logName = statement.executeQuery(loginName);  
                              ResultSet logPassword = pernyataan.executeQuery(loginPassword);
                              while (logName.next()) {namaPengguna1 = logName.getString("Nama_Dokter"); }  
                              while (logPassword.next()) {passwordPengguna1 = logPassword.getString("Kata_Kunci"); }  
                              if ((!"".equals(namaPengguna1)) && (!"".equals(passwordPengguna1))) {  
                                   tombolHubungkankePadukData.setEnabled(true);  
                                   putuskanKoneksiKePadukData.setEnabled(true);  
                                   tombolUbahPadukData.setEnabled(true);  
                                   tombolBatal.setEnabled(true);  
                                   masuk.setEnabled(false);
                                   statusKoneksi.setText("Belum Terhubung ke Paduk Data");
                                   statusMasuk.setText("Sudah Masuk");
                                   keluar.setEnabled(true);  
                                   putuskanKoneksiKePadukData.setEnabled(true);  
                                   statement.close();
                                   connection.close();
                                   connection = null;
                                   pernyataan.close(); }  
                              else if (("".equals(namaPengguna1)) && (!"".equals(passwordPengguna1))) {  
                                   tombolHubungkankePadukData.setEnabled(false);  
                                   putuskanKoneksiKePadukData.setEnabled(false);  
                                   tombolUbahPadukData.setEnabled(false);  
                                   tombolBatal.setEnabled(false);  
                                   keluar.setEnabled(true);
                                   masuk.setEnabled(true);
                                   statusKoneksi.setText(fx);
                                   putuskanKoneksiKePadukData.setEnabled(false);  
                                   JOptionPane.showMessageDialog(null, dx, ex, JOptionPane.INFORMATION_MESSAGE);  
                                   connection.close();
                                   connection = null;
                                   statement.close();
                                   pernyataan.close(); }  
                             else if ((!"".equals(namaPengguna1)) && ("".equals(passwordPengguna1))) {  
                                   tombolHubungkankePadukData.setEnabled(false);  
                                   putuskanKoneksiKePadukData.setEnabled(false);  
                                   tombolUbahPadukData.setEnabled(false);  
                                   tombolBatal.setEnabled(false);
                                   masuk.setEnabled(true);
                                   statusKoneksi.setText(fx);
                                   keluar.setEnabled(true);  
                                   putuskanKoneksiKePadukData.setEnabled(false);  
                                   JOptionPane.showMessageDialog(null, dx, ex, JOptionPane.INFORMATION_MESSAGE);  
                                   connection.close();
                                   connection = null;
                                   statement.close();
                                   pernyataan.close(); }
                             else if (("".equals(namaPengguna1)) && ("".equals(passwordPengguna1)))  {  
                                   tombolHubungkankePadukData.setEnabled(false);  
                                   putuskanKoneksiKePadukData.setEnabled(false);  
                                   tombolUbahPadukData.setEnabled(false);  
                                   tombolBatal.setEnabled(false);
                                   masuk.setEnabled(true);
                                   statusKoneksi.setText(fx);
                                   keluar.setEnabled(true);  
                                   putuskanKoneksiKePadukData.setEnabled(false);  
                                   JOptionPane.showMessageDialog(null, dx, ex, JOptionPane.INFORMATION_MESSAGE);  
                                   connection.close();
                                   connection = null;
                                   statement.close();
                                   pernyataan.close(); }}  
                          catch (Exception ex) { 
                              ex.printStackTrace();
                              statusMasuk.setText("Gagal Masuk");  }}});
    putuskanKoneksiKePadukData.addActionListener(new java.awt.event.ActionListener() {  
                @Override  
                public void actionPerformed(java.awt.event.ActionEvent evt) {  
                    try {putuskan(); } catch (Exception ex) {ex.printStackTrace();}}  
                private void putuskan() throws SQLException {      
                    if (connection != null)  {  
                         statusKoneksi.setText("Koneksi ke Paduk Data sudah Terputus");  
                      for (int lko = 0; lko < 4; lko++) {for (int ten = 0; ten < 2; ten++) {
                              kriteria[lko][ten].setVisible(false);
                              jawabKriteria[lko][ten].setEditable(false);  
                              jawabKriteria[lko][ten].setVisible(false); }}  
                      for (int lok = 0; lok < 5; lok++) {for (int songo = 0; songo < 2; songo++) {
                             alternatif[lok][songo].setVisible(false);
                             jawabAlternatif[lok][songo].setEditable(false);   
                             jawabAlternatif[lok][songo].setVisible(false); }}      
                      connection.close();
                      connection = null;
                      statement.close();
                      pernyataan.close();
                      lanjut.setVisible(false);
                      lanjut.setEnabled(false);}
                    else {
                       statusKoneksi.setText(fx);  
                       myocardialInfarction.setVisible(false);
                       stroke.setVisible(false);
                       for (int ltu = 0; ltu < 4; ltu++) {for (int wolu = 0; wolu < 2; wolu++) {
                               kriteria[ltu][wolu].setVisible(false);
                               jawabKriteria[ltu][wolu].setEditable(false);  
                               jawabKriteria[ltu][wolu].setVisible(false); }}  
                       for (int tlu = 0; tlu < 5; tlu++) {for (int papat = 0; papat < 2; papat++) {
                               jawabAlternatif[tlu][papat].setEditable(false);  
                               jawabAlternatif[tlu][papat].setVisible(false);  
                               alternatif[tlu][papat].setVisible(false); }}}  
                    myocardialInfarction.setVisible(false);
                    stroke.setVisible(false); }});  
    keluar.addActionListener(new java.awt.event.ActionListener() {  
             @Override  
             public void actionPerformed(java.awt.event.ActionEvent evt) {keluar();}  
             private void keluar() {System.exit(0);}});  
    tombolHubungkankePadukData.addActionListener(new java.awt.event.ActionListener() {  
                @Override  
                public void actionPerformed(java.awt.event.ActionEvent evt) {  
                        if (connection != null) {statusKoneksi.setText("Sudah Terhubung ke Paduk Data");}  
                        else {connectToDB(); }}});  
    tombolBatal.addActionListener(new java.awt.event.ActionListener() {  
                @Override  
                public void actionPerformed(java.awt.event.ActionEvent evt) {batal();  }  
                private void batal() { 
                        if (connection != null) {                      
                          myocardialInfarction.setVisible(false);
                          stroke.setVisible(false);
                          for (int k = 0; k < 4; k++)  {for (int kipas = 0; kipas < 2; kipas++) {
                                jawabKriteria[k][kipas].setText("");   
                                kriteria[k][kipas].setVisible(false); }}  
                          for (int lkm = 0; lkm < 5; lkm++) {for (int kitas = 0; kitas < 2; kitas++) {
                                jawabAlternatif[lkm][kitas].setText("");  
                                alternatif[lkm][kitas].setVisible(false); }}  
                          for (int lqj = 0; lqj < 4; lqj++) {for (int lopker = 0; lopker < 2; lopker++) {
                                jawabKriteria[lqj][lopker].setEditable(false);  
                                jawabKriteria[lqj][lopker].setVisible(false); }}  
                          for (int ljq = 0; ljq < 5; ljq++) {for (int klopker = 0; klopker < 2; klopker++){
                                jawabAlternatif[ljq][klopker].setEditable(false);    
                                jawabAlternatif[ljq][klopker].setVisible(false); }}
                                lanjut.setEnabled(false); 
                                lanjut.setVisible(false);}
                        else {JOptionPane.showMessageDialog(null, "Hubungkan Dahulu ke Paduk Data", fx, JOptionPane.INFORMATION_MESSAGE); }}});  
    lanjut.addActionListener(new java.awt.event.ActionListener() {  
          @Override  
          public void actionPerformed(java.awt.event.ActionEvent evt) {kontinu(); }  
          private void kontinu() {  
              setSize(1024,768);  
              setVisible(true);
              setTitle("Penghitungan Data");
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);  
              setLocationRelativeTo(null);  
              String[][] passCriteriaVariables = new String[4][2];  
              String[][] passAlternativeVariables = new String[5][2];  
              for (String[] passCriteriaVariable : passCriteriaVariables) {  
                  for (int ikjl = 0; ikjl < passCriteriaVariable.length; ikjl++) {
                      passCriteriaVariable[ikjl] = new String();
                  }
              }
              for (int aijkl = 0; aijkl < 4; aijkl++) {for (int aikjl = 0; aikjl < 2; aikjl++) {passCriteriaVariables[aijkl][aikjl] = jawabKriteria[aijkl][aikjl].getText();  }}  
              for (String[] passAlternativeVariable : passAlternativeVariables) {  
                  for (int laikjl = 0; laikjl < passAlternativeVariable.length; laikjl++) {
                      passAlternativeVariable[laikjl] = new String();
                  }
              }
              for (int lijkl = 0; lijkl < 5; lijkl++) {for (int likjl = 0; likjl < 2; likjl++) {passAlternativeVariables[lijkl][likjl] = jawabAlternatif[lijkl][likjl].getText(); }}  
              posisiKriteria();
              lblKriteria = passCriteriaVariables;
              System.out.println(lblKriteria);
              lblAlternatif = passAlternativeVariables;
              System.out.println(lblAlternatif);
              for (int olp = 0; olp <4; olp++) {  
                   labelLuarKriteria[olp][0].setText(lblKriteria[olp][0]);  
                   labelLuarKriteria1[olp][0].setText(lblKriteria[olp][0]); 
                   System.out.println(labelLuarKriteria[olp][0]);}  
              for (int olt = 0; olt < 4; olt++) {  
                   labelLuarKriteria[olt][1].setText(lblKriteria[olt][1]);  
                   labelLuarKriteria1[olt][1].setText(lblKriteria[olt][1]); 
                   System.out.println(labelLuarKriteria[olt][1]);}  
              for (int yul = 0; yul < 4; yul++) {
                   labelLuarKriteria[yul][0].setVisible(true);  
                   labelLuarKriteria1[yul][0].setVisible(true);  
                   labelLuarKriteria[yul][1].setVisible(true);  
                   labelLuarKriteria1[yul][1].setVisible(true);}
              logOff.setBounds(506,700,200,25);
              lblNama.setVisible(false);  
              txtNama.setVisible(false);  
              kataSandi.setVisible(false);  
              sandiKata.setVisible(false);  
              masuk.setVisible(false);  
              keluar.setVisible(false); 
              awal.setVisible(true);
              myocardialInfarction.setBounds(0,60,200,25);
              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(true);  
              stroke.setVisible(true);  
              for (JLabel[] kriteria1 : kriteria) {
                  for (JLabel item : kriteria1) {
                      item.setVisible(false);
                  }
              }  
              for (JTextField[] jawabAlternatif11 : jawabAlternatif1) {
                  for (JTextField item : jawabAlternatif11) {
                      item.setVisible(false);
                  }
              }  
              for (JLabel[] alternatif1 : alternatif) {
                  for (JLabel item : alternatif1) {
                      item.setVisible(false);
                  }
              }  
              statusMasuk.setVisible(false);  
              for (JLabel lblPerhitunganKriteria1 : lblPerhitunganKriteria) { 
                  lblPerhitunganKriteria1.setVisible(true);
              }
              ubah.setVisible(true);
              System.out.println(ubah);
              for (int okb = 0; okb < 2; okb++){
                  lanjutlah[okb].setVisible(true); 
                  System.out.println(lanjutlah[okb]);
                  perhitunganKriteria[okb].setVisible(false);  
                  System.out.println(perhitunganKriteria[okb]);
                  kmbl[okb].setVisible(false); 
                  System.out.println(kmbl[okb]);
                  update[okb].setVisible(false);  
                  System.out.println(update[okb]);
                  kriteriaLanjut[okb].setVisible(false); 
                  jawabKriteria1[0][okb].setEnabled(false);
                  jawabKriteria1[0][okb].setVisible(true);
                  jawabKriteria1[0][okb].setText("1");
                  System.out.println(jawabKriteria1[0][okb]);
                  jawabKriteria1[5][okb].setEnabled(false);
                  jawabKriteria1[5][okb].setVisible(true);
                  jawabKriteria1[5][okb].setText("1");
                  System.out.println(jawabKriteria1[0][okb]);
                  jawabKriteria1[10][okb].setEnabled(false);
                  jawabKriteria1[10][okb].setVisible(true);
                  jawabKriteria1[10][okb].setText("1");
                  System.out.println(jawabKriteria1[0][okb]);
                  jawabKriteria1[15][okb].setEnabled(false);
                  jawabKriteria1[15][okb].setVisible(true);
                  jawabKriteria1[15][okb].setText("1");
                  System.out.println(jawabKriteria1[0][okb]);}  
              logOff.setVisible(true);
              for (int tql = 1; tql < 4; tql++){for (JTextField item : jawabKriteria1[tql]) {
                      item.setEnabled(false);
                      System.out.println(item);
                      item.setVisible(true);
                  }
    }
              for (int tql = 6; tql < 8; tql++){for (JTextField item : jawabKriteria1[tql]) {
                      item.setEnabled(false);
                      System.out.println(item);
                      item.setVisible(true);
                  }
    }
              for (JTextField item : jawabKriteria1[11]) {
                  item.setEnabled(false);
                  System.out.println(item);
                  item.setVisible(true);     
              }
              for (int hklma = 12; hklma < 15; hklma++) {for (JTextField item : jawabKriteria1[hklma]) {
                      item.setVisible(true);
                      item.setText("");
                      System.out.println(item);
                      item.setEnabled(true);
                  }
    }
              for (int hklma = 8; hklma < 10; hklma++) {for (JTextField item : jawabKriteria1[hklma]) {
                      item.setText("");
                      System.out.println(item);
                      item.setEnabled(true);
                      item.setVisible(true);
                  }
    }
              for (JTextField item : jawabKriteria1[4]) {
                  item.setVisible(true);
                  item.setText("");
                  System.out.println(item);
                  item.setEnabled(true);
              }
              for (JLabel[] labelLuarKriteria2 : labelLuarKriteria) {
                  for (JLabel item : labelLuarKriteria2) {
                      item.setVisible(true);
                  }
              }  
              for (JLabel[] labelLuarAlternatif2 : labelLuarAlternatif) {
                  for (JLabel item : labelLuarAlternatif2) {
                      item.setVisible(true);
                  }
              }  
              for (JLabel[] labelLuarAlternatif11 : labelLuarAlternatif1) {
                  for (JLabel item : labelLuarAlternatif11) {
                      item.setVisible(true);
                  }
              }  
              for (JLabel[] labelLuarKriteria11 : labelLuarKriteria1) {
                  for (JLabel item : labelLuarKriteria11) {
                      item.setVisible(true);
                  }
              }  
              for (JTextField[] jawabKriteria2 : jawabKriteria) {
                  for (JTextField item : jawabKriteria2) {
                      item.setVisible(false);
                  }
              }  
              for (JTextField[] jawabAlternatif2 : jawabAlternatif) {
                  for (JTextField item : jawabAlternatif2) {
                      item.setVisible(false);
                  }
              }
    }}); //FrameBaru baru = new FrameBaru(passCriteriaVariables, passAlternativeVariables); // I want to make a class that is named FrameBaru to be visible   
    tombolUbahPadukData.addActionListener(new java.awt.event.ActionListener() {  
       @Override  
       public void actionPerformed(java.awt.event.ActionEvent evt) {  
           try {ubah();
           } catch (Exception ex) {
               ex.printStackTrace();
               statusKoneksi.setText("Gagal Terhubung dengan Paduk Data"); 
               System.out.println(statusKoneksi);}}   
       private void ubah() throws SQLException { 
               if (connection != null) {
                      for (int lmo = 0; lmo < 4; lmo++) {  
                          for (int jmo = 0; jmo < 2; jmo++){
                              jawabKriteria[lmo][jmo].setEditable(true);
                              jawabKriteria[lmo][jmo].setVisible(true);
                              jawabKriteria[lmo][jmo].setText("");
                              System.out.println(jawabKriteria[lmo][jmo]);
                              kriteria[lmo][jmo].setVisible(true); 
                              kriteria[lmo][jmo].setEnabled(true);}}  
                     for (int mlo = 0; mlo < 5; mlo++)  {
                         for (int hlok = 0; hlok < 2; hlok++) {
                              jawabAlternatif[mlo][hlok].setEditable(true);  
                              jawabAlternatif[mlo][hlok].setVisible(true);
                              jawabAlternatif[mlo][hlok].setText("");
                              System.out.println(jawabAlternatif[mlo][hlok]);
                              alternatif[mlo][hlok].setVisible(true);
                              alternatif[mlo][hlok].setEnabled(true); }}  
                     lanjut.setEnabled(true); 
                     lanjut.setVisible(true);
                     logOff.setBounds(880,600,100,25);
                     logOff.setVisible(true);
                     myocardialInfarction.setBounds(0, 160, 200, 25);
                     myocardialInfarction.setVisible(true);
                     System.out.println(myocardialInfarction);
                     stroke.setVisible(true); }
               else {JOptionPane.showMessageDialog(null, "Hubungkan Dahulu ke Paduk Data", fx, JOptionPane.INFORMATION_MESSAGE); }}});}
    public static void main(String[] args) {  
            ProyekTesis tesis = new ProyekTesis();   
            tesis.setTitle("Program Pemilihan Obat dengan Cara Analytic Hierarchycal Process");  
            tesis.setSize(1024,768);  
            tesis.setVisible(true);  
            tesis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);  
            tesis.setLocationRelativeTo(null); }}

  8. #208
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,526
    Blog Entries
    7
    Rep Power
    20

    Default Re: How to do this?

    Quote Originally Posted by Tawi View Post
    Guys, why do these happen?

    run:
    4 javax.swing.JLabel[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,bor der=,flags=8388608,maximumSize=,minimumSize=,prefe rredSize=,defaultIcon=,disabledIcon=,horizontalAli gnment=LEADING,horizontalTextPosition=TRAILING,ico nTextGap=4,labelFor=,text=Kriteria 1,verticalAlignment=CENTER,verticalTextPosition=CE NTER]
    That's how a JLabel prints itself and it happens because you have made your program to do it; and please, please, please stop flooding this forum with wallpaper of code; nobody is going to read 100s of lines of badly formatted crap like that.
    cenosillicaphobia: the fear for an empty beer glass

  9. #209
    Tawi is offline Senior Member
    Join Date
    Feb 2013
    Posts
    118
    Rep Power
    0

    Default Re: How to do this?

    Quote Originally Posted by JosAH View Post
    That's how a JLabel prints itself and it happens because you have made your program to do it; and please, please, please stop flooding this forum with wallpaper of code; nobody is going to read 100s of lines of badly formatted crap like that.
    What do you mean?

  10. #210
    Tawi is offline Senior Member
    Join Date
    Feb 2013
    Posts
    118
    Rep Power
    0

    Default Re: How to do this?

    Ok, I changed my style. What is wrong with this? Why do I get NPE?

    Java Code:
    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
    package proyektesis;
    
    /**
     *
     * @author Tawi
     */
    import java.sql.*;
    import javax.swing.*;
    
    public class ProyekTesis extends BaruFrame {
    int i; 
    
          
    public void connectToDB() { 
                    try {  
                        Class.forName(driver);  
                        connection = DriverManager.getConnection(uniRL, usrname, psswrd);  
                        statusKoneksi.setText("Terhubung ke Paduk Data"); 
                        System.out.println("1 " + statusKoneksi);
                    }  
                    catch (Exception ex) { 
                        ex.printStackTrace();
                        statusKoneksi.setText("Gagal Terhubung ke Paduk Data");
                        System.out.println("2 " + statusKoneksi);
                    }
    }
    
    public ProyekTesis() {
    this.setLayout(null);
    for (int itlo = 0; itlo < 2; itlo++) {
        lblPerhitunganKriteria[itlo] = new JLabel("Perhitungan Kriteria"); 
    }
    
    for (int tlo = 0; tlo < 2; tlo++) {
           kriteria[0][tlo] = new JLabel("Kriteria 1");
           System.out.println("4 " + kriteria[0][tlo]);
           kriteria[1][tlo] = new JLabel("Kriteria 2"); 
           System.out.println("5 " + kriteria[1][tlo]);
           kriteria[2][tlo] = new JLabel("Kriteria 3");  
           System.out.println("6 " + kriteria[2][tlo]);
           kriteria[3][tlo] = new JLabel("Kriteria 4");
           System.out.println("7 " + kriteria[3][tlo]);
           alternatif[0][tlo] = new JLabel("Alternatif 1"); 
           System.out.println("8 " + alternatif[0][tlo]);
           alternatif[1][tlo] = new JLabel("Alternatif 2");  
           System.out.println("9 " + alternatif[1][tlo]);
           alternatif[2][tlo] = new JLabel("Alternatif 3"); 
           System.out.println("10 " + alternatif[2][tlo]);
           alternatif[3][tlo] = new JLabel("Alternatif 4");  
           System.out.println("11 " + alternatif[3][tlo]);
           alternatif[4][tlo] = new JLabel("Alternatif 5");
           System.out.println("12 " + alternatif[4][tlo]);
    }
    
    for (int klof = 0; klof < 5; klof++) {
        for (int mobil = 0; mobil < 2; mobil++) {
            jawabAlternatif[klof][mobil] = new JTextField(10); 
        }
    }
    
    for (int plof = 0; plof < 4; plof++) {
        for (int kekar = 0; kekar < 2; kekar++) {
            jawabKriteria[plof][kekar] = new JTextField(10); 
        }
    }
    
    for (int m = 0; m <5; m++)  {
        for (int prodi = 0; prodi < 2; prodi++)  {
          jawabAlternatif[m][prodi].setEditable(false);    
          jawabAlternatif[m][prodi].setVisible(false); 
        }
    }  
    
    for (int hki = 0; hki < 4; hki++)  {
        for (int hse = 0; hse < 2; hse++) {
          jawabKriteria[hki][hse].setEditable(false);    
          jawabKriteria[hki][hse].setVisible(false);
        }
    }   
    
    kriteria[0][0].setBounds(1,210,100,25);  
    kriteria[1][0].setBounds(1,240,100,25);  
    kriteria[2][0].setBounds(1,270,100,25);  
    kriteria[3][0].setBounds(1,300,100,25);  
    for (int lop = 0; lop < 4; lop++) {
        this.add(kriteria[lop][0]); 
    }
    
    jawabKriteria[0][0].setBounds(101,210,100,25);  
    jawabKriteria[1][0].setBounds(101,240,100,25);  
    jawabKriteria[2][0].setBounds(101,270,100,25);  
    jawabKriteria[3][0].setBounds(101,300,100,25);  
    
    for (int jki = 0; jki < 4; jki++) {
        this.add(jawabKriteria[jki][0]); 
    }  
    
    alternatif[0][0].setBounds(200,210,100,25);  
    alternatif[1][0].setBounds(200,240,100,25);  
    alternatif[2][0].setBounds(200,270,100,25);  
    alternatif[3][0].setBounds(200,300,100,25);  
    alternatif[4][0].setBounds(200,330,100,25);  
    
    for (int loyo = 0; loyo < 5; loyo++) {
        this.add(alternatif[loyo][0]); 
    }  
    
    jawabAlternatif[0][0].setBounds(360,210,70,25);  
    jawabAlternatif[1][0].setBounds(360,240,70,25);  
    jawabAlternatif[2][0].setBounds(360,270,70,25);  
    jawabAlternatif[3][0].setBounds(360,300,70,25);  
    jawabAlternatif[4][0].setBounds(360,330,70,25);  
    for (int gfk = 0; gfk < 5; gfk++) {
        this.add(jawabAlternatif[gfk][0]); 
    }  
    
    stroke.setBounds(0,355,200,25);
    kriteria[0][1].setBounds(1,420,100,25);  
    kriteria[1][1].setBounds(1,450,100,25);  
    kriteria[2][1].setBounds(1,480,100,25);  
    kriteria[3][1].setBounds(1,510,100,25);  
    for (int gdu = 0; gdu < 4; gdu++) {
        this.add(kriteria[gdu][1]); 
    }   
    
    jawabKriteria[0][1].setBounds(101,420,100,25);  
    jawabKriteria[1][1].setBounds(101,450,100,25);  
    jawabKriteria[2][1].setBounds(101,480,100,25);  
    jawabKriteria[3][1].setBounds(101,510,100,25);  
    
    for (int jku = 0; jku < 4; jku++) {
        this.add(jawabKriteria[jku][1]); 
    }  
    
    alternatif[0][1].setBounds(200,420,100,25);  
    alternatif[1][1].setBounds(200,450,100,25);  
    alternatif[2][1].setBounds(200,480,100,25);  
    alternatif[3][1].setBounds(200,510,100,25);  
    alternatif[4][1].setBounds(200,540,100,25);  
    
    for (int loyom = 0; loyom < 5; loyom++) {
        this.add(alternatif[loyom][1]); 
    }  
    
    jawabAlternatif[0][1].setBounds(360,420,70,25);  
    jawabAlternatif[1][1].setBounds(360,450,70,25);  
    jawabAlternatif[2][1].setBounds(360,480,70,25);  
    jawabAlternatif[3][1].setBounds(360,510,70,25);  
    jawabAlternatif[4][1].setBounds(360,540,70,25);
    
    for (int gfki = 0; gfki < 5; gfki++) {
        this.add(jawabAlternatif[gfki][1]); 
    }  
    
    this.add(logOff);
    this.add(lanjut);  
    lanjut.setEnabled(false);  
    lblNama.setBounds(0,10,100,25);  
    this.add(lblNama);  
    txtNama.setBounds(130,10,200,25);  
    this.add(txtNama);  
    kataSandi.setBounds(330,10,100,25);  
    this.add(kataSandi);  
    sandiKata.setBounds(410,10,200,25);  
    this.add(sandiKata);  
    masuk.setBounds(600,10,100,25);  
    this.add(masuk);  
    keluar.setBounds(700,10,100,25);  
    this.add(keluar);  
    myocardialInfarction.setBounds(0,90,200,25);
    lblPerhitunganKriteria[0].setBounds(0, 80, 200, 25);
    lblPerhitunganKriteria[1].setBounds(0, 375, 200, 25);
    
    for (int celt = 0; celt < 2; celt++) {
        lblPerhitunganKriteria[celt].setVisible(false);
        this.add(lblPerhitunganKriteria[celt]);
        lanjutlah[celt].setVisible(false);  
        perhitunganKriteria[celt].setVisible(false);  
        kmbl[celt].setVisible(false);  
        update[celt].setVisible(false); 
        kriteriaLanjut[celt].setVisible(false);
    }
    
    this.add(myocardialInfarction);
    tombolHubungkankePadukData.setBounds(0,50,250,25);  
    this.add(tombolHubungkankePadukData);  
    putuskanKoneksiKePadukData.setBounds(250,50,250,25);  
    this.add(putuskanKoneksiKePadukData);  
    tombolUbahPadukData.setBounds(480,50,250,25);  
    this.add(tombolUbahPadukData);  
    tombolBatal.setBounds(730,50,250,25);  
    this.add(tombolBatal);  
    statusKoneksi.setBounds(800,10,200,25);  
    this.add(statusKoneksi);  
    statusMasuk.setBounds(0,70,200,25);
    this.add(statusMasuk);
    tombolHubungkankePadukData.setEnabled(false);  
    putuskanKoneksiKePadukData.setEnabled(false);  
    tombolUbahPadukData.setEnabled(false);    
    tombolBatal.setEnabled(false);   
    statusKoneksi.setVisible(true);  
    lblNama.setVisible(true);  
    txtNama.setVisible(true);  
    kataSandi.setVisible(true);  
    sandiKata.setVisible(true);  
    masuk.setVisible(true);  
    keluar.setVisible(true);
    awal.setVisible(false);
    tombolHubungkankePadukData.setVisible(true);  
    putuskanKoneksiKePadukData.setVisible(true);  
    tombolUbahPadukData.setVisible(true);  
    tombolBatal.setVisible(true);  
    lanjut.setBounds(880,560,100,25);  
    this.add(lanjut);  
    lanjut.setEnabled(false);
    lanjut.setVisible(false);  
    //jcboURL.setVisible(true);  
    //jcboDriver.setVisible(true);  
    statusKoneksi.setVisible(true);
    padukData.setVisible(true);  
    myocardialInfarction.setVisible(false);  
    stroke.setVisible(false);  
    this.add(stroke); 
        for (JLabel[] kriteria1 : kriteria) {  
            for (int kloaka = 0; kloaka < 2; kloaka++) {
                kriteria1[kloaka].setVisible(false);
            }
        }
        for (JLabel[] alternatif1 : alternatif) {     
            for (int kock = 0; kock <2; kock++) {
                alternatif1[kock].setVisible(false);
            }
        }
    statusMasuk.setVisible(true);  
    ubah.setVisible(false);  
        for (JTextField[] jawabKriteria11 : jawabKriteria1) {
            for (JTextField item : jawabKriteria11) {
                item.setVisible(false);
            }
        }
        for (JTextField[] jawabAlternatif11 : jawabAlternatif1) {
            for (JTextField item : jawabAlternatif11) {
                item.setVisible(false);
            }
        }
        for (JLabel[] labelLuarKriteria2 : labelLuarKriteria) {
            for (JLabel item : labelLuarKriteria2) {
                item.setVisible(false);
            }
        }
        for (JLabel[] labelLuarAlternatif2 : labelLuarAlternatif) {
            for (JLabel item : labelLuarAlternatif2) {
                item.setVisible(false);
            }
        }
        for (JLabel[] labelLuarAlternatif11 : labelLuarAlternatif1) {
            for (JLabel item : labelLuarAlternatif11) {
                item.setVisible(false);
            }
        }
        for (JLabel[] labelLuarKriteria11 : labelLuarKriteria1) {
            for (JLabel item : labelLuarKriteria11) {
                item.setVisible(false);
            }
        }
    masuk.addActionListener(new java.awt.event.ActionListener() {  
                String loginName;  
                String loginPassword;    
                String passwrd;
                @Override  
                public void actionPerformed(java.awt.event.ActionEvent evt) {  
                    usrname = txtNama.getText().trim();  
                    psswrd = new String(sandiKata.getPassword());
                    for (int celtf = 0; celtf < 2; celtf++) {lblPerhitunganKriteria[celtf].setVisible(false); }
                    if (("".equals(usrname)) && ("".equals(psswrd)))  {  
                       tombolHubungkankePadukData.setEnabled(false);  
                       putuskanKoneksiKePadukData.setEnabled(false);  
                       tombolUbahPadukData.setEnabled(false);  
                       tombolBatal.setEnabled(false);  
                       masuk.setEnabled(true);
                       statusKoneksi.setText(fx);
                       System.out.println("13 " + statusKoneksi);
                       keluar.setEnabled(true);  
                       putuskanKoneksiKePadukData.setEnabled(false); 
                       JOptionPane.showMessageDialog(null, cx, ex, JOptionPane.INFORMATION_MESSAGE); 
                    }  
                    else if ((!"".equals(usrname)) && ("".equals(psswrd))) {  
                       JOptionPane.showMessageDialog(null, ax, ex, JOptionPane.INFORMATION_MESSAGE);  
                       tombolHubungkankePadukData.setEnabled(false);  
                       putuskanKoneksiKePadukData.setEnabled(false);  
                       tombolUbahPadukData.setEnabled(false);  
                       tombolBatal.setEnabled(false); 
                       masuk.setEnabled(true);
                       statusKoneksi.setText(fx);
                       System.out.println("14 " + statusKoneksi);
                       keluar.setEnabled(true);  
                       putuskanKoneksiKePadukData.setEnabled(false); 
                    }  
                    else if ((("".equals(usrname)) && (!"".equals(psswrd)))) {      
                       tombolHubungkankePadukData.setEnabled(false);  
                       putuskanKoneksiKePadukData.setEnabled(false);  
                       tombolUbahPadukData.setEnabled(false);  
                       tombolBatal.setEnabled(false);  
                       keluar.setEnabled(true);  
                       masuk.setEnabled(true);
                       statusKoneksi.setText(fx);
                       System.out.println("15 " + statusKoneksi);
                       putuskanKoneksiKePadukData.setEnabled(false);  
                       JOptionPane.showMessageDialog(null, bx, ex, JOptionPane.INFORMATION_MESSAGE); 
                    }       
                    else if ((!"".equals(usrname)) && (!"".equals(psswrd))) {
                        connectToDB(); 
                    }
                    masuklah(); }  
                private void masuklah() {  
                    try {
                        if (connection.isClosed()) {  
                            masuk.setEnabled(true);  
                            entryPrg(); 
                        }  
                        else {
                            masuk.setEnabled(false);
                            entryPrg(); 
                        }
                    } catch (Exception ex) {
                        ex.printStackTrace(); 
                    }
                }   
                
                private void entryPrg() {  
                    connectToDB();
                    try {
                         statement = connection.createStatement();
                         pernyataan = connection.createStatement();
                         loginName = "select Nama_Dokter from tblDokterAhli where Nama_Dokter = '"+usrname+"'";  
                         loginPassword = "select Kata_Kunci from tblDokterAhli where Kata_Kunci = '"+psswrd+"' and Nama_Dokter = '"+usrname+"'";
                         ResultSet logName = statement.executeQuery(loginName);  
                         ResultSet logPassword = pernyataan.executeQuery(loginPassword);
                         while (logName.next()) {namaPengguna1 = logName.getString("Nama_Dokter"); }  
                         while (logPassword.next()) {passwordPengguna1 = logPassword.getString("Kata_Kunci"); }  
                         if ((!"".equals(namaPengguna1)) && (!"".equals(passwordPengguna1))) {  
                             tombolHubungkankePadukData.setEnabled(true);  
                             putuskanKoneksiKePadukData.setEnabled(true);  
                             tombolUbahPadukData.setEnabled(true);  
                             tombolBatal.setEnabled(true);  
                             masuk.setEnabled(false);
                             statusKoneksi.setText("Belum Terhubung ke Paduk Data");
                             statusMasuk.setText("Sudah Masuk");
                             System.out.println("16 " + statusKoneksi);
                             System.out.println("17 " + statusMasuk);
                             keluar.setEnabled(true);  
                             putuskanKoneksiKePadukData.setEnabled(true);  
                             statement.close();
                             connection.close();
                             connection = null;
                             pernyataan.close(); 
                         }  
                         else if (("".equals(namaPengguna1)) && (!"".equals(passwordPengguna1))) {  
                                tombolHubungkankePadukData.setEnabled(false);  
                                putuskanKoneksiKePadukData.setEnabled(false);  
                                tombolUbahPadukData.setEnabled(false);  
                                tombolBatal.setEnabled(false);  
                                keluar.setEnabled(true);
                                masuk.setEnabled(true);
                                statusKoneksi.setText(fx);
                                System.out.println("18 " + statusKoneksi);
                                putuskanKoneksiKePadukData.setEnabled(false);  
                                JOptionPane.showMessageDialog(null, dx, ex, JOptionPane.INFORMATION_MESSAGE);  
                                connection.close();
                                connection = null;
                                statement.close();
                                pernyataan.close(); }  
                         else if ((!"".equals(namaPengguna1)) && ("".equals(passwordPengguna1))) {  
                                tombolHubungkankePadukData.setEnabled(false);  
                                putuskanKoneksiKePadukData.setEnabled(false);  
                                tombolUbahPadukData.setEnabled(false);  
                                tombolBatal.setEnabled(false);
                                masuk.setEnabled(true);
                                statusKoneksi.setText(fx);
                                System.out.println("19 " + statusKoneksi);
                                keluar.setEnabled(true);  
                                putuskanKoneksiKePadukData.setEnabled(false);  
                                JOptionPane.showMessageDialog(null, dx, ex, JOptionPane.INFORMATION_MESSAGE);  
                                connection.close();
                                connection = null;
                                statement.close();
                                pernyataan.close(); }
                         else if (("".equals(namaPengguna1)) && ("".equals(passwordPengguna1)))  {  
                                tombolHubungkankePadukData.setEnabled(false);  
                                putuskanKoneksiKePadukData.setEnabled(false);  
                                tombolUbahPadukData.setEnabled(false);  
                                tombolBatal.setEnabled(false);
                                masuk.setEnabled(true);
                                statusKoneksi.setText(fx);
                                System.out.println("20 " + statusKoneksi);
                                keluar.setEnabled(true);  
                                putuskanKoneksiKePadukData.setEnabled(false);  
                                JOptionPane.showMessageDialog(null, dx, ex, JOptionPane.INFORMATION_MESSAGE);  
                                connection.close();
                                connection = null;
                                statement.close();
                                   pernyataan.close(); 
                         }
                    }  
                    catch (Exception ex) { 
                         ex.printStackTrace();
                         statusMasuk.setText("Gagal Masuk");  
                    }
                }
    }
    );
    
    putuskanKoneksiKePadukData.addActionListener(new java.awt.event.ActionListener() {  
                @Override  
                public void actionPerformed(java.awt.event.ActionEvent evt) {  
                    try {
                        putuskan(); 
                    } catch (Exception ex) {
                        ex.printStackTrace();
                    }
                }
                
                private void putuskan() throws SQLException {      
                    if (connection != null)  {  
                       statusKoneksi.setText("Koneksi ke Paduk Data sudah Terputus");  
                       System.out.println("21 " + statusKoneksi);
                       for (int lko = 0; lko < 4; lko++) {
                           for (int ten = 0; ten < 2; ten++) {
                               kriteria[lko][ten].setVisible(false);
                               jawabKriteria[lko][ten].setEditable(false);  
                               jawabKriteria[lko][ten].setVisible(false); 
                           }
                       }  
                       for (int lok = 0; lok < 5; lok++) {
                           for (int songo = 0; songo < 2; songo++) {
                               alternatif[lok][songo].setVisible(false);
                               jawabAlternatif[lok][songo].setEditable(false);   
                               jawabAlternatif[lok][songo].setVisible(false); 
                           }
                       }      
                       connection.close();
                       connection = null;
                       statement.close();
                       pernyataan.close();
                       lanjut.setVisible(false);
                       lanjut.setEnabled(false);
                    }
                    else {
                       statusKoneksi.setText(fx); 
                       System.out.println("22 " + statusKoneksi);
                       myocardialInfarction.setVisible(false);
                       stroke.setVisible(false);
                       for (int ltu = 0; ltu < 4; ltu++) {
                           for (int wolu = 0; wolu < 2; wolu++) {
                               kriteria[ltu][wolu].setVisible(false);
                               jawabKriteria[ltu][wolu].setEditable(false);  
                               jawabKriteria[ltu][wolu].setVisible(false); 
                           }
                       }  
                       for (int tlu = 0; tlu < 5; tlu++) {
                           for (int papat = 0; papat < 2; papat++) {
                               jawabAlternatif[tlu][papat].setEditable(false);  
                               jawabAlternatif[tlu][papat].setVisible(false);  
                               alternatif[tlu][papat].setVisible(false); 
                           }
                       }
                    }  
                    myocardialInfarction.setVisible(false);
                    stroke.setVisible(false); 
                }
    }
    );  
    keluar.addActionListener(new java.awt.event.ActionListener() {  
             @Override  
             public void actionPerformed(java.awt.event.ActionEvent evt) {
                 keluar();
             }  
             private void keluar() {
                 System.exit(0);
             }
    }
    );  
    tombolHubungkankePadukData.addActionListener(new java.awt.event.ActionListener() {  
             @Override  
             public void actionPerformed(java.awt.event.ActionEvent evt) {  
                 if (connection != null) {
                    statusKoneksi.setText("Sudah Terhubung ke Paduk Data");
                    System.out.println("23 " + statusKoneksi);
                 }
                 else {
                     connectToDB(); 
                 }
             }
    }
    );  
    
    tombolBatal.addActionListener(new java.awt.event.ActionListener() {  
             @Override  
             public void actionPerformed(java.awt.event.ActionEvent evt) {batal();  }  
             private void batal() { 
                 if (connection != null) {                      
                     myocardialInfarction.setVisible(false);
                     stroke.setVisible(false);
                     for (int k = 0; k < 4; k++)  {
                         for (int kipas = 0; kipas < 2; kipas++) {
                                jawabKriteria[k][kipas].setText("");  
                                System.out.println("24 " + jawabKriteria[k][kipas]);
                                kriteria[k][kipas].setVisible(false); 
                         }
                     }  
                     for (int lkm = 0; lkm < 5; lkm++) {
                         for (int kitas = 0; kitas < 2; kitas++) {
                                jawabAlternatif[lkm][kitas].setText(""); 
                                System.out.println("25 " + jawabKriteria[lkm][kitas]);
                                alternatif[lkm][kitas].setVisible(false); 
                         }
                     }  
                     for (int lqj = 0; lqj < 4; lqj++) {
                         for (int lopker = 0; lopker < 2; lopker++) {
                              jawabKriteria[lqj][lopker].setEditable(false);  
                              jawabKriteria[lqj][lopker].setVisible(false); 
                         }
                     }  
                     for (int ljq = 0; ljq < 5; ljq++) {
                         for (int klopker = 0; klopker < 2; klopker++){
                             jawabAlternatif[ljq][klopker].setEditable(false);    
                             jawabAlternatif[ljq][klopker].setVisible(false); 
                         }
                     }
                     lanjut.setEnabled(false); 
                     lanjut.setVisible(false);
                 }
                 else {JOptionPane.showMessageDialog(null, "Hubungkan Dahulu ke Paduk Data", fx, JOptionPane.INFORMATION_MESSAGE); 
                 }
             }
    }
    );  
    
    lanjut.addActionListener(new java.awt.event.ActionListener() {  
          @Override  
          public void actionPerformed(java.awt.event.ActionEvent evt) {kontinu(); }  
          private void kontinu() {  
              setSize(1024,768);  
              setVisible(true);
              setTitle("Penghitungan Data");
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);  
              setLocationRelativeTo(null);  
              String[][] passCriteriaVariables = new String[4][2];  
              String[][] passAlternativeVariables = new String[5][2];  
              for (String[] passCriteriaVariable : passCriteriaVariables) {  
                  for (int ikjl = 0; ikjl < passCriteriaVariable.length; ikjl++) {
                      passCriteriaVariable[ikjl] = new String();
                  }
              }
              for (int aijkl = 0; aijkl < 4; aijkl++) {
                  for (int aikjl = 0; aikjl < 2; aikjl++) {
                      passCriteriaVariables[aijkl][aikjl] = jawabKriteria[aijkl][aikjl].getText();  
                      System.out.println("26 " + passCriteriaVariables[aijkl][aikjl]);
                  }
              }  
              for (int aijkl = 0; aijkl < passAlternativeVariables.length; aijkl++) {
                  for (int aikjl = 0; aikjl < passAlternativeVariables[aijkl].length; aikjl++) {
                       passAlternativeVariables[aijkl][aikjl] = jawabAlternatif[aijkl][aikjl].getText();  
                       System.out.println("27 " + passAlternativeVariables[aijkl][aikjl]);
                  }
              } 
              posisiKriteria();
              for (int aijkl = 0; aijkl < 4; aijkl++) {
                  for (int aikjl = 0; aikjl < 2; aikjl++) {
                       lblKriteria[aijkl][aikjl] = passCriteriaVariables[aijkl][aikjl];  
                       System.out.println("28 " + lblKriteria[aijkl][aikjl]);
                  }
              }  
              for (int aijkl = 0; aijkl < lblAlternatif.length; aijkl++) {
                  for (int aikjl = 0; aikjl < lblAlternatif[aijkl].length; aikjl++) {
                       lblAlternatif[aijkl][aikjl] = passAlternativeVariables[aijkl][aikjl];  
                       System.out.println("29 " + lblAlternatif[aijkl][aikjl]);
                  }
              }  
              for (int olp = 0; olp <4; olp++) {  
                   labelLuarKriteria[olp][0].setText(lblKriteria[olp][0]);  
                   labelLuarKriteria1[olp][0].setText(lblKriteria[olp][0]); 
                   System.out.println("30 " + labelLuarKriteria[olp][0]);
                   System.out.println("31 " + labelLuarKriteria1[olp][0]);
              }  
              for (int olt = 0; olt < 4; olt++) {  
                   labelLuarKriteria[olt][1].setText(lblKriteria[olt][1]);  
                   labelLuarKriteria1[olt][1].setText(lblKriteria[olt][1]); 
                   System.out.println("32 " + labelLuarKriteria[olt][1]);
                   System.out.println("33 " + labelLuarKriteria1[olt][1]);
              }  
              for (int yul = 0; yul < 4; yul++) {
                   labelLuarKriteria[yul][0].setVisible(true);  
                   labelLuarKriteria1[yul][0].setVisible(true);  
                   labelLuarKriteria[yul][1].setVisible(true);  
                   labelLuarKriteria1[yul][1].setVisible(true);
              }
              logOff.setBounds(506,700,200,25);
              lblNama.setVisible(false);  
              txtNama.setVisible(false);  
              kataSandi.setVisible(false);  
              sandiKata.setVisible(false);  
              masuk.setVisible(false);  
              keluar.setVisible(false); 
              awal.setVisible(true);
              myocardialInfarction.setBounds(0,60,200,25);
              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(true);  
              stroke.setVisible(true);  
              for (JLabel[] kriteria1 : kriteria) {
                  for (JLabel item : kriteria1) {
                      item.setVisible(false);
                  }
              }  
              for (JTextField[] jawabAlternatif11 : jawabAlternatif1) {
                  for (JTextField item : jawabAlternatif11) {
                      item.setVisible(false);
                  }
              }  
              for (JLabel[] alternatif1 : alternatif) {
                  for (JLabel item : alternatif1) {
                      item.setVisible(false);
                  }
              }  
              statusMasuk.setVisible(false);  
              for (JLabel lblPerhitunganKriteria1 : lblPerhitunganKriteria) { 
                  lblPerhitunganKriteria1.setVisible(true);
              }
              ubah.setVisible(true);
              System.out.println(ubah);
              for (int okb = 0; okb < 2; okb++){
                  lanjutlah[okb].setVisible(true); 
                  System.out.println(lanjutlah[okb]);
                  perhitunganKriteria[okb].setVisible(false);  
                  System.out.println(perhitunganKriteria[okb]);
                  kmbl[okb].setVisible(false); 
                  System.out.println(kmbl[okb]);
                  update[okb].setVisible(false);  
                  System.out.println(update[okb]);
                  kriteriaLanjut[okb].setVisible(false); 
                  jawabKriteria1[0][okb].setEnabled(false);
                  jawabKriteria1[0][okb].setVisible(true);
                  jawabKriteria1[0][okb].setText("1");
                  System.out.println(jawabKriteria1[0][okb]);
                  jawabKriteria1[5][okb].setEnabled(false);
                  jawabKriteria1[5][okb].setVisible(true);
                  jawabKriteria1[5][okb].setText("1");
                  System.out.println(jawabKriteria1[0][okb]);
                  jawabKriteria1[10][okb].setEnabled(false);
                  jawabKriteria1[10][okb].setVisible(true);
                  jawabKriteria1[10][okb].setText("1");
                  System.out.println(jawabKriteria1[0][okb]);
                  jawabKriteria1[15][okb].setEnabled(false);
                  jawabKriteria1[15][okb].setVisible(true);
                  jawabKriteria1[15][okb].setText("1");
                  System.out.println(jawabKriteria1[0][okb]);
              }  
              logOff.setVisible(true);
              for (int tql = 1; tql < 4; tql++){
                  for (JTextField item : jawabKriteria1[tql]) {
                      item.setEnabled(false);
                      System.out.println(item);
                      item.setVisible(true);
                  }
              }
              for (int tql = 6; tql < 8; tql++){
                  for (JTextField item : jawabKriteria1[tql]) {
                      item.setEnabled(false);
                      System.out.println(item);
                      item.setVisible(true);
                  }
              }
              for (JTextField item : jawabKriteria1[11]) {
                  item.setEnabled(false);
                  System.out.println(item);
                  item.setVisible(true);     
              }
              for (int hklma = 12; hklma < 15; hklma++) {
                  for (JTextField item : jawabKriteria1[hklma]) {
                      item.setVisible(true);
                      item.setText("");
                      System.out.println(item);
                      item.setEnabled(true);
                  }
              }
              for (int hklma = 8; hklma < 10; hklma++) {
                  for (JTextField item : jawabKriteria1[hklma]) {
                      item.setText("");
                      System.out.println(item);
                      item.setEnabled(true);
                      item.setVisible(true);
                  }
              }
              for (JTextField item : jawabKriteria1[4]) {
                  item.setVisible(true);
                  item.setText("");
                  System.out.println(item);
                  item.setEnabled(true);
              }
              for (JLabel[] labelLuarKriteria2 : labelLuarKriteria) {
                  for (JLabel item : labelLuarKriteria2) {
                      item.setVisible(true);
                  }
              }  
              for (JLabel[] labelLuarAlternatif2 : labelLuarAlternatif) {
                  for (JLabel item : labelLuarAlternatif2) {
                      item.setVisible(true);
                  }
              }  
              for (JLabel[] labelLuarAlternatif11 : labelLuarAlternatif1) {
                  for (JLabel item : labelLuarAlternatif11) {
                      item.setVisible(true);
                  }
              }  
              for (JLabel[] labelLuarKriteria11 : labelLuarKriteria1) {
                  for (JLabel item : labelLuarKriteria11) {
                      item.setVisible(true);
                  }
              }  
              for (JTextField[] jawabKriteria2 : jawabKriteria) {
                  for (JTextField item : jawabKriteria2) {
                      item.setVisible(false);
                  }
              }  
              for (JTextField[] jawabAlternatif2 : jawabAlternatif) {
                  for (JTextField item : jawabAlternatif2) {
                      item.setVisible(false);
                  }
              }
          }
    }
    ); //FrameBaru baru = new FrameBaru(passCriteriaVariables, passAlternativeVariables); // I want to make a class that is named FrameBaru to be visible   
    
    tombolUbahPadukData.addActionListener(new java.awt.event.ActionListener() {  
       @Override  
       public void actionPerformed(java.awt.event.ActionEvent evt) {  
           try {
               ubah();
           } catch (Exception ex) {
               ex.printStackTrace();
               statusKoneksi.setText("Gagal Terhubung dengan Paduk Data"); 
               System.out.println(statusKoneksi);
           }
       }   
       
       private void ubah() throws SQLException { 
               if (connection != null) {
                  for (int lmo = 0; lmo < 4; lmo++) {  
                     for (int jmo = 0; jmo < 2; jmo++){
                         jawabKriteria[lmo][jmo].setEditable(true);
                         jawabKriteria[lmo][jmo].setVisible(true);
                         jawabKriteria[lmo][jmo].setText("");
                         System.out.println(jawabKriteria[lmo][jmo]);
                         kriteria[lmo][jmo].setVisible(true); 
                         kriteria[lmo][jmo].setEnabled(true);
                     }
                  }  
                  for (int mlo = 0; mlo < 5; mlo++)  {
                      for (int hlok = 0; hlok < 2; hlok++) {
                          jawabAlternatif[mlo][hlok].setEditable(true);  
                          jawabAlternatif[mlo][hlok].setVisible(true);
                          jawabAlternatif[mlo][hlok].setText("");
                          System.out.println(jawabAlternatif[mlo][hlok]);
                          alternatif[mlo][hlok].setVisible(true);
                          alternatif[mlo][hlok].setEnabled(true); 
                      }
                  }  
                  lanjut.setEnabled(true); 
                  lanjut.setVisible(true);
                  logOff.setBounds(880,600,100,25);
                  logOff.setVisible(true);
                  myocardialInfarction.setBounds(0, 160, 200, 25);
                  myocardialInfarction.setVisible(true);
                  System.out.println(myocardialInfarction);
                  stroke.setVisible(true); 
               }
               else {JOptionPane.showMessageDialog(null, "Hubungkan Dahulu ke Paduk Data", fx, JOptionPane.INFORMATION_MESSAGE); 
               }
       }
    }
    );
    }
    
    public static void main(String[] args) {  
            ProyekTesis tesis = new ProyekTesis();   
            tesis.setTitle("Program Pemilihan Obat dengan Cara Analytic Hierarchycal Process");  
            tesis.setSize(1024,768);  
            tesis.setVisible(true);  
            tesis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);  
            tesis.setLocationRelativeTo(null); 
    }
    }
    I have two frames and a component. Let's say that they are frame A, frame B and component C. Can frame A and frame B add component C?
    Last edited by Tawi; 03-16-2014 at 10:48 AM.

  11. #211
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    947
    Rep Power
    2

    Default Re: How to do this?

    Can you make a printscreen of the userinterface that this code is producing? I am really curious what it looks like.
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2™ © 2013

  12. #212
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,526
    Blog Entries
    7
    Rep Power
    20

    Default Re: How to do this?

    Quote Originally Posted by Tawi View Post
    Ok, I changed my style. What is wrong with this? Why do I get NPE?
    Do you want us to find a NPE in 804 lines of that code without any indication what is null (and shouldn't be) and where the NPE happened? Get real; don't post any more of that gibberish because you are very close to a ban.

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  13. #213
    Tawi is offline Senior Member
    Join Date
    Feb 2013
    Posts
    118
    Rep Power
    0

    Default Re: How to do this?

    It is at the time I click the masuk button, can you help me to get rid the NPE?

  14. #214
    Tawi is offline Senior Member
    Join Date
    Feb 2013
    Posts
    118
    Rep Power
    0

    Default Re: How to do this?

    Quote Originally Posted by JosAH View Post
    Do you want us to find a NPE in 804 lines of that code without any indication what is null (and shouldn't be) and where the NPE happened? Get real; don't post any more of that gibberish because you are very close to a ban.

    Jos
    What do you mean? I write my other problems already, correct? I have other problem which is frame A and B problem so? I don't remember and know how to reproduce the NPE so?
    Last edited by Tawi; 03-16-2014 at 11:59 AM.

  15. #215
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,526
    Blog Entries
    7
    Rep Power
    20

    Default Re: How to do this?

    Quote Originally Posted by Tawi View Post
    What do you mean? I write my other problems already, correct? I have other problem which is frame A and B problem so? I don't remember and know how to reproduce the NPE so?
    So? This is so: I will close this thread if it goes on like this; more than 200 replies and kazillion lines of unreadable code is ridiculous.

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  16. #216
    Tawi is offline Senior Member
    Join Date
    Feb 2013
    Posts
    118
    Rep Power
    0

    Default Re: How to do this?

    Quote Originally Posted by JosAH View Post
    So? This is so: I will close this thread if it goes on like this; more than 200 replies and kazillion lines of unreadable code is ridiculous.

    Jos

    I changed the code so it was the same with the code that you want, what is wrong again?

  17. #217
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,423
    Rep Power
    25

    Default Re: How to do this?

    what is wrong again?
    You need to copy the full text of the error message and paste it here.
    If you don't understand my response, don't ignore it, ask a question.

  18. #218
    Tawi is offline Senior Member
    Join Date
    Feb 2013
    Posts
    118
    Rep Power
    0

    Default Re: How to do this?

    Quote Originally Posted by Norm View Post
    You need to copy the full text of the error message and paste it here.
    The problem is I do not know how to reproduce the NPE so? How about the two frames and a component?

  19. #219
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,423
    Rep Power
    25

    Default Re: How to do this?

    How about the two frames and a component?
    Please explain what you mean.
    If you don't understand my response, don't ignore it, ask a question.

Page 11 of 11 FirstFirst ... 91011

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •