Hello guys, sorry to repost

  • (2 Pages)
  • +
  • 1
  • 2

22 Replies - 477 Views - Last Post: 16 August 2012 - 01:52 AM Rate Topic: -----

#1 tawilovejessicalawrent  Icon User is offline

  • D.I.C Head

Reputation: -11
  • View blog
  • Posts: 122
  • Joined: 08-April 12

Hello guys, sorry to repost

Posted 13 August 2012 - 10:46 AM

/**
 *
 * @author Tawi
 */
import javax.swing.*;
import java.awt.*;
import java.awt.GridLayout;
import java.sql.*;


public class ProgramServerTesis extends JFrame {
     JTextField nama = new JTextField();
     JPasswordField password = new JPasswordField();
     JLabel namaPengguna = new JLabel("Nama");
     JLabel passwordPengguna = new JLabel("Password");
     JButton tombolMasuk = new JButton("Masuk");
     JButton tombolHubungkankePadukData = new JButton("Hubungkan ke Paduk Data");
     JButton tombolUbahPadukData = new JButton("Hubungkan ke Paduk Data");
     JButton tombolBatal = new JButton("Batal");
     JButton tombolKeluar = new JButton("Keluar");
     JLabel statusKoneksi = new JLabel("Tidak ada Koneksi ke Paduk Data");
     JLabel padukData = new JLabel("Paduk Data Belum Diubah");
     JTextField[][] alternatifSakit = new JTextField[20][2];
     JTextField[][] kriteriaSakit = new JTextField[2][4];
     JLabel[][] tandaAlternatif = new JLabel[2][5];
     JLabel[][] tandaKriteria = new JLabel[2][4];
     JTextArea info = new JTextArea();
     private Connection connection;
     private Statement statement;
     JComboBox jcboURL = new JComboBox (new String[] {"jdbc:odbc:DatabaseKlinik"});
     JComboBox jcboDriver = new JComboBox (new String[] {"sun.jdbc.odbc.JdbcOdbcDriver"});
     int i = 0; int j = 0; int k = 0; int l = 0;
     JPanel[] p = new JPanel[21];

public void ProgramServerTesis() {
         setLayout(new GridLayout(24, 80, 1, 1));
         for (i = 0; i < 2; i++)
          {
              tandaAlternatif[i][0].setText("Alternatif Utama");
              tandaAlternatif[i][1].setText("Alternatif Kedua");
              tandaAlternatif[i][2].setText("Alternatif Ketiga");
              tandaAlternatif[i][3].setText("Alternatif Keempat");
              tandaAlternatif[i][4].setText("Alternatif Kelima");
              tandaKriteria[i][0].setText("Harga");
              tandaKriteria[i][1].setText("Efek Samping");
              tandaKriteria[i][2].setText("Kualitas");
              tandaKriteria[i][3].setText("Ketersediaan");
              kriteriaSakit[i][0] = new JTextField(10);
              kriteriaSakit[i][1] = new JTextField(10);
              kriteriaSakit[i][2] = new JTextField(10);
              kriteriaSakit[i][3] = new JTextField(10);
          }
         for (j = 0; j < 20; j++)
         {
              alternatifSakit[j][0] = new JTextField(10);
              alternatifSakit[j][1] = new JTextField(10);
              p[j].setVisible(true);
          }
         for (k = 0; k < 21 ; k++)
          {
              p[k].setLayout(new GridLayout(1, 4, 1, 1));
          }
          p[1].add(namaPengguna);
          p[1].add(nama);
          p[1].add(password);
          p[1].add(passwordPengguna);
          p[1].add(tombolMasuk);
          p[2].add(statusKoneksi);
          p[2].add(tombolHubungkankePadukData);
          p[2].add(tombolBatal);
          p[2].add(tombolKeluar);
          p[3].add(padukData);
          p[3].add(new JLabel(""));
          p[4].add(new JLabel(""));
          p[4].add(new JLabel("Harga"));
          p[4].add(new JLabel(""));
          p[4].add(new JLabel("Efek Samping"));
          p[4].add(new JLabel(""));
          p[4].add(new JLabel("Kualitas"));
          p[4].add(new JLabel(""));
          p[4].add(new JLabel("Ketersediaan"));
          p[5].add(new JLabel("Myocardial Infarction"));
          p[6].add(tandaKriteria[0][0]);
          p[6].add(kriteriaSakit[0][0]);
          for (l = 0; l < 5; l++)
          {
              p[6].add(tandaAlternatif[l][0]);
              p[6].add(alternatifSakit[l][0]);
          }
          p[7].add(tandaKriteria[0][1]);
          p[7].add(kriteriaSakit[0][1]);
          for (int m = 5; m < 10; m++)
          {
              p[7].add(tandaAlternatif[m][0]);
              p[7].add(alternatifSakit[m][0]);
          }
          p[8].add(tandaKriteria[0][2]);
          p[8].add(kriteriaSakit[0][2]);
          for (int n = 10; n < 15; n++)
          {
              p[8].add(tandaAlternatif[n][0]);
              p[8].add(alternatifSakit[n][0]);
          }
          p[9].add(tandaKriteria[0][3]);
          p[9].add(kriteriaSakit[0][3]);
          for (int m = 15; m < 20; m++)
          {
              p[9].add(tandaAlternatif[m][0]);
              p[9].add(alternatifSakit[m][0]);
          }
          p[10].add(new JLabel("Stroke"));
          p[11].add(tandaKriteria[1][0]);
          p[11].add(kriteriaSakit[1][0]);
          for (int m = 0; m < 5; m++)
          {
              p[11].add(tandaAlternatif[m][1]);
              p[11].add(alternatifSakit[m][1]);
          }
          p[12].add(tandaKriteria[1][1]);
          p[12].add(kriteriaSakit[1][1]);
          for (int n = 5; n < 10; n++)
          {
              p[12].add(tandaAlternatif[n][1]);
              p[12].add(alternatifSakit[n][1]);
          }
          p[13].add(tandaKriteria[1][2]);
          p[13].add(kriteriaSakit[1][2]);
          for (int m = 10; m < 15; m++)
          {
              p[13].add(tandaAlternatif[m][1]);
              p[13].add(alternatifSakit[m][1]);
          }
          p[14].add(tandaKriteria[1][3]);
          p[14].add(kriteriaSakit[1][3]);
          for (int n = 15; n < 20; n++)
          {
              p[14].add(tandaAlternatif[n][1]);
              p[14].add(alternatifSakit[n][1]);
          }
          for (int o = 0; o < 15; o++)
          {
              add(p[o], BorderLayout.WEST);
          }        
}

public static void main(String[] args)
{
    ProgramServerTesis frame = new ProgramServerTesis();
    frame.setTitle("Program Pemilihan Obat Menggunakan Algoritma Analytic Hierarchycal Process");
    frame.setLocationRelativeTo(null);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setSize(1024, 768);
    frame.setVisible(true);
}
}



I run this codes and I got blank screen but no error messages, can any folks help me with this? What is wrong with this? I tried plenty of revisions but still cannot find the best codes to solve this.

Is This A Good Question/Topic? 0
  • +

Replies To: Hello guys, sorry to repost

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 6627
  • View blog
  • Posts: 23,984
  • Joined: 12-June 08

Re: Hello guys, sorry to repost

Posted 13 August 2012 - 10:49 AM

Seriously? You are not reading the posts given?

Perhaps, and this is just an off the wall suggestion, if you have repeated something action twice with one result, and you are not getting your expected result, perhaps change how you are are proceeding.
Was This Post Helpful? 0
  • +
  • -

#3 tawilovejessicalawrent  Icon User is offline

  • D.I.C Head

Reputation: -11
  • View blog
  • Posts: 122
  • Joined: 08-April 12

Re: Hello guys, sorry to repost

Posted 13 August 2012 - 10:52 AM

Yeah, like what?
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 6627
  • View blog
  • Posts: 23,984
  • Joined: 12-June 08

Re: Hello guys, sorry to repost

Posted 13 August 2012 - 10:55 AM

If it was me I would address the first and third bullet points on those reasons why the last two topics have been closed.
Was This Post Helpful? 0
  • +
  • -

#5 tawilovejessicalawrent  Icon User is offline

  • D.I.C Head

Reputation: -11
  • View blog
  • Posts: 122
  • Joined: 08-April 12

Re: Hello guys, sorry to repost

Posted 13 August 2012 - 11:02 AM

I know it, I change it all, don't I?
Was This Post Helpful? 0
  • +
  • -

#6 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 6627
  • View blog
  • Posts: 23,984
  • Joined: 12-June 08

Re: Hello guys, sorry to repost

Posted 13 August 2012 - 11:04 AM

I don't see much in the way of changes from this post in comparison to the last two. How about your explain to me why this isn't the same as the other two that were closed down and adheres to the bullet points I pointed out. You.. you are aware of _WHAT_ bullet points I am talking about, right? You *ARE* reading those links I gave, right?
Was This Post Helpful? 0
  • +
  • -

#7 no2pencil  Icon User is offline

  • Original Digital Gansta
  • member icon

Reputation: 4503
  • View blog
  • Posts: 24,971
  • Joined: 10-May 07

Re: Hello guys, sorry to repost

Posted 13 August 2012 - 11:09 AM

You should change the topic from "Sorry To Repost" to "Sorry To Not Read, & Waste Your Time".
Was This Post Helpful? 0
  • +
  • -

#8 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 9161
  • View blog
  • Posts: 33,981
  • Joined: 27-December 08

Re: Hello guys, sorry to repost

Posted 13 August 2012 - 11:10 AM

This is a habit with this member, to not read and continually ask the same questions.
Was This Post Helpful? 0
  • +
  • -

#9 g00se  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2148
  • View blog
  • Posts: 8,925
  • Joined: 20-September 08

Re: Hello guys, sorry to repost

Posted 13 August 2012 - 01:35 PM

Your ctor will never be called, since it contains the keyword void
IOW, it's not a ctor
Was This Post Helpful? 1
  • +
  • -

#10 tawilovejessicalawrent  Icon User is offline

  • D.I.C Head

Reputation: -11
  • View blog
  • Posts: 122
  • Joined: 08-April 12

Re: Hello guys, sorry to repost

Posted 15 August 2012 - 12:57 AM

I omit void. Now I am getting:

Exception in thread "main" java.lang.NullPointerException
at ProgramServerTesis.<init>(ProgramServerTesis.java:40)
at ProgramServerTesis.main(ProgramServerTesis.java:153)
Java Result: 1
BUILD SUCCESSFUL (total time: 7 seconds)

How to solve this?
Was This Post Helpful? 0
  • +
  • -

#11 g00se  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2148
  • View blog
  • Posts: 8,925
  • Joined: 20-September 08

Re: Hello guys, sorry to repost

Posted 15 August 2012 - 02:16 AM

Something is null on line 40. Make sure you've created any instance that's meant to be at a certain index in any of your many arrays
Was This Post Helpful? 0
  • +
  • -

#12 tawilovejessicalawrent  Icon User is offline

  • D.I.C Head

Reputation: -11
  • View blog
  • Posts: 122
  • Joined: 08-April 12

Re: Hello guys, sorry to repost

Posted 15 August 2012 - 03:02 AM

The other codes are the same with the first codes that was posted by me so what should I do to handle this error? I can't figure out about how I am going to solve this problem. I put all of the things you want me to put, don't I?

This post has been edited by tawilovejessicalawrent: 15 August 2012 - 03:27 AM

Was This Post Helpful? 0
  • +
  • -

#13 g00se  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2148
  • View blog
  • Posts: 8,925
  • Joined: 20-September 08

Re: Hello guys, sorry to repost

Posted 15 August 2012 - 04:09 AM

Quote

The other codes are the same with the first codes that was posted by me so what should I do to handle this error?

I just told you, quite precisely. Read what i said more carefully
Was This Post Helpful? 0
  • +
  • -

#14 tawilovejessicalawrent  Icon User is offline

  • D.I.C Head

Reputation: -11
  • View blog
  • Posts: 122
  • Joined: 08-April 12

Re: Hello guys, sorry to repost

Posted 15 August 2012 - 04:17 AM

Well, I read your post but I did not understand your post yet, can you be more specific? Can you add any details?
Was This Post Helpful? -1
  • +
  • -

#15 no2pencil  Icon User is offline

  • Original Digital Gansta
  • member icon

Reputation: 4503
  • View blog
  • Posts: 24,971
  • Joined: 10-May 07

Re: Hello guys, sorry to repost

Posted 15 August 2012 - 06:30 AM

By specific he means, just type the corrected code for him.
Was This Post Helpful? 1
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2