Java Applet Ile Jlabel Ve Imageicon Kullanımı
Java applet ile jlabel ve imageicon kullanımı
Kod;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.Image;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JApplet;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
public class jlabelimageicon extends JApplet {
JLabel Adana = new JLabel();
JLabel Adıyaman = new JLabel();
JLabel Afyon = new JLabel();
JLabel Ağrı = new JLabel();
JLabel Aksaray = new JLabel();
JLabel Amasya = new JLabel();
JLabel Ankara = new JLabel();
JLabel Antalya = new JLabel();
JLabel Ardahan = new JLabel();
JLabel Artvin = new JLabel();
JLabel Aydın = new JLabel();
JLabel Balıkesir = new JLabel();
JLabel Bartın = new JLabel();
JLabel Batman = new JLabel();
JLabel Bayburt = new JLabel();
JLabel Bilecik = new JLabel();
JLabel Bingöl = new JLabel();
JLabel Bitlis = new JLabel();
JLabel Bolu = new JLabel();
JLabel Burdur = new JLabel();
JLabel Bursa = new JLabel();
JLabel Çanakkale = new JLabel();
JLabel Çankırı = new JLabel();
JLabel Çorum = new JLabel();
JLabel Denizli = new JLabel();
JLabel Diyarbakır = new JLabel();
JLabel Düzce = new JLabel();
JLabel Edirne = new JLabel();
JLabel Elazığ = new JLabel();
JLabel Erzincan = new JLabel();
JLabel Erzurum = new JLabel();
JLabel Eskişehir = new JLabel();
JLabel Gaziantep = new JLabel();
JLabel Giresun = new JLabel();
JLabel Gümüşhane = new JLabel();
JLabel Hakkari = new JLabel();
JLabel Hatay = new JLabel();
JLabel Iğdır = new JLabel();
JLabel Isparta = new JLabel();
JLabel İstanbul = new JLabel();
JLabel İzmir = new JLabel();
JLabel KahramanMaraş = new JLabel();
JLabel Karabük = new JLabel();
JLabel Karaman = new JLabel();
JLabel Kars = new JLabel();
JLabel Kastamonu = new JLabel();
JLabel Kayseri = new JLabel();
JLabel Kilis = new JLabel();
JLabel Kırıkkale = new JLabel();
JLabel Kırklareli = new JLabel();
JLabel Kırşehir = new JLabel();
JLabel Kocaeli = new JLabel();
JLabel Konya = new JLabel();
JLabel Kütahya = new JLabel();
JLabel Malatya = new JLabel();
JLabel Manisa = new JLabel();
JLabel Mardin = new JLabel();
JLabel Mersin = new JLabel();
JLabel Muğla = new JLabel();
JLabel Muş = new JLabel();
JLabel Nevşehir = new JLabel();
JLabel Niğde = new JLabel();
JLabel Ordu = new JLabel();
JLabel Osmaniye = new JLabel();
JLabel Rize = new JLabel();
JLabel Sakarya = new JLabel();
JLabel Samsun = new JLabel();
JLabel Siirt = new JLabel();
JLabel Sinop = new JLabel();
JLabel Sivas = new JLabel();
JLabel ŞanlıUrfa = new JLabel();
JLabel Şırnak = new JLabel();
JLabel Tekirdağ = new JLabel();
JLabel Tokat = new JLabel();
JLabel Trabzon = new JLabel();
JLabel Tunceli = new JLabel();
JLabel Uşak = new JLabel();
JLabel Van = new JLabel();
JLabel Yalova = new JLabel();
JLabel Yozgat = new JLabel();
JLabel Zonguldak = new JLabel();
public void init() {
String Tarayıcı = JOptionPane.showInputDialog(this, "Türkiyeden Bir İl Giriniz");
if (Tarayıcı.equalsIgnoreCase("Adana")) {
setLayout(new FlowLayout());
Adana.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Adana.png")));
Adana.setVerticalTextPosition(JLabel.BOTTOM);
Adana.setHorizontalTextPosition(JLabel.CENTER);
Adana.setForeground(Color.BLUE);
Adana.setText("Adana");
add(Adana);
} else if (Tarayıcı.equalsIgnoreCase("Adıyaman")) {
setLayout(new FlowLayout());
Adıyaman.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Adıyaman.png")));
Adıyaman.setVerticalTextPosition(JLabel.BOTTOM);
Adıyaman.setHorizontalTextPosition(JLabel.CENTER);
Adıyaman.setForeground(Color.BLUE);
Adıyaman.setText("Adıyaman");
add(Adıyaman);
} else if (Tarayıcı.equalsIgnoreCase("Afyon")) {
setLayout(new FlowLayout());
Afyon.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Afyon.png")));
Afyon.setVerticalTextPosition(JLabel.BOTTOM);
Afyon.setHorizontalTextPosition(JLabel.CENTER);
Afyon.setForeground(Color.BLUE);
Afyon.setText("Afyon");
add(Afyon);
} else if (Tarayıcı.equalsIgnoreCase("Ağrı")) {
setLayout(new FlowLayout());
Ağrı.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Ağrı.png")));
Ağrı.setVerticalTextPosition(JLabel.BOTTOM);
Ağrı.setHorizontalTextPosition(JLabel.CENTER);
Ağrı.setForeground(Color.BLUE);
Ağrı.setText("Ağrı");
add(Ağrı);
} else if (Tarayıcı.equalsIgnoreCase("Aksaray")) {
setLayout(new FlowLayout());
Aksaray.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Aksaray.png")));
Aksaray.setVerticalTextPosition(JLabel.BOTTOM);
Aksaray.setHorizontalTextPosition(JLabel.CENTER);
Aksaray.setForeground(Color.BLUE);
Aksaray.setText("Aksaray");
add(Aksaray);
} else if (Tarayıcı.equalsIgnoreCase("Amasya")) {
setLayout(new FlowLayout());
Amasya.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Amasya.png")));
Amasya.setVerticalTextPosition(JLabel.BOTTOM);
Amasya.setHorizontalTextPosition(JLabel.CENTER);
Amasya.setForeground(Color.BLUE);
Amasya.setText("Amasya");
add(Amasya);
} else if (Tarayıcı.equalsIgnoreCase("Ankara")) {
setLayout(new FlowLayout());
Ankara.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Ankara.png")));
Ankara.setVerticalTextPosition(JLabel.BOTTOM);
Ankara.setHorizontalTextPosition(JLabel.CENTER);
Ankara.setForeground(Color.BLUE);
Ankara.setText("Ankara");
add(Ankara);
} else if (Tarayıcı.equalsIgnoreCase("Antalya")) {
setLayout(new FlowLayout());
Antalya.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Antalya.png")));
Antalya.setVerticalTextPosition(JLabel.BOTTOM);
Antalya.setHorizontalTextPosition(JLabel.CENTER);
Antalya.setForeground(Color.BLUE);
Antalya.setText("Antalya");
add(Antalya);
} else if (Tarayıcı.equalsIgnoreCase("Ardahan")) {
setLayout(new FlowLayout());
Ardahan.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Ardahan.png")));
Ardahan.setVerticalTextPosition(JLabel.BOTTOM);
Ardahan.setHorizontalTextPosition(JLabel.CENTER);
Ardahan.setForeground(Color.BLUE);
Ardahan.setText("Ardahan");
add(Ardahan);
} else if (Tarayıcı.equalsIgnoreCase("Artvin")) {
setLayout(new FlowLayout());
Artvin.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Artvin.png")));
Artvin.setVerticalTextPosition(JLabel.BOTTOM);
Artvin.setHorizontalTextPosition(JLabel.CENTER);
Artvin.setForeground(Color.BLUE);
Artvin.setText("Artvin");
add(Artvin);
} else if (Tarayıcı.equalsIgnoreCase("Aydın")) {
setLayout(new FlowLayout());
Aydın.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Aydın.png")));
Aydın.setVerticalTextPosition(JLabel.BOTTOM);
Aydın.setHorizontalTextPosition(JLabel.CENTER);
Aydın.setForeground(Color.BLUE);
Aydın.setText("Aydın");
add(Aydın);
} else if (Tarayıcı.equalsIgnoreCase("Balıkesir")) {
setLayout(new FlowLayout());
Balıkesir.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Balıkesir.png")));
Balıkesir.setVerticalTextPosition(JLabel.BOTTOM);
Balıkesir.setHorizontalTextPosition(JLabel.CENTER);
Balıkesir.setForeground(Color.BLUE);
Balıkesir.setText("Balıkesir");
add(Balıkesir);
} else if (Tarayıcı.equalsIgnoreCase("Bartın")) {
setLayout(new FlowLayout());
Bartın.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Bartın.png")));
Bartın.setVerticalTextPosition(JLabel.BOTTOM);
Bartın.setHorizontalTextPosition(JLabel.CENTER);
Bartın.setForeground(Color.BLUE);
Bartın.setText("Bartın");
add(Bartın);
} else if (Tarayıcı.equalsIgnoreCase("Batman")) {
setLayout(new FlowLayout());
Batman.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Batman.png")));
Batman.setVerticalTextPosition(JLabel.BOTTOM);
Batman.setHorizontalTextPosition(JLabel.CENTER);
Batman.setForeground(Color.BLUE);
Batman.setText("Batman");
add(Batman);
} else if (Tarayıcı.equalsIgnoreCase("Bayburt")) {
setLayout(new FlowLayout());
Bayburt.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Bayburt.png")));
Bayburt.setVerticalTextPosition(JLabel.BOTTOM);
Bayburt.setHorizontalTextPosition(JLabel.CENTER);
Bayburt.setForeground(Color.BLUE);
Bayburt.setText("Bayburt");
add(Bayburt);
} else if (Tarayıcı.equalsIgnoreCase("Bilecik")) {
setLayout(new FlowLayout());
Bilecik.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Bilecik.png")));
Bilecik.setVerticalTextPosition(JLabel.BOTTOM);
Bilecik.setHorizontalTextPosition(JLabel.CENTER);
Bilecik.setForeground(Color.BLUE);
Bilecik.setText("Bilecik");
add(Bilecik);
} else if (Tarayıcı.equalsIgnoreCase("Bingöl")) {
setLayout(new FlowLayout());
Bingöl.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Bingöl.png")));
Bingöl.setVerticalTextPosition(JLabel.BOTTOM);
Bingöl.setHorizontalTextPosition(JLabel.CENTER);
Bingöl.setForeground(Color.BLUE);
Bingöl.setText("Bingöl");
add(Bingöl);
} else if (Tarayıcı.equalsIgnoreCase("Bitlis")) {
setLayout(new FlowLayout());
Bitlis.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Bitlis.png")));
Bitlis.setVerticalTextPosition(JLabel.BOTTOM);
Bitlis.setHorizontalTextPosition(JLabel.CENTER);
Bitlis.setForeground(Color.BLUE);
Bitlis.setText("Bitlis");
add(Bitlis);
} else if (Tarayıcı.equalsIgnoreCase("Bolu")) {
setLayout(new FlowLayout());
Bolu.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Bolu.png")));
Bolu.setVerticalTextPosition(JLabel.BOTTOM);
Bolu.setHorizontalTextPosition(JLabel.CENTER);
Bolu.setForeground(Color.BLUE);
Bolu.setText("Bolu");
add(Bolu);
} else if (Tarayıcı.equalsIgnoreCase("Burdur")) {
setLayout(new FlowLayout());
Burdur.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Burdur.png")));
Burdur.setVerticalTextPosition(JLabel.BOTTOM);
Burdur.setHorizontalTextPosition(JLabel.CENTER);
Burdur.setForeground(Color.BLUE);
Burdur.setText("Burdur");
add(Burdur);
} else if (Tarayıcı.equalsIgnoreCase("Bursa")) {
setLayout(new FlowLayout());
Bursa.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Bursa.png")));
Bursa.setVerticalTextPosition(JLabel.BOTTOM);
Bursa.setHorizontalTextPosition(JLabel.CENTER);
Bursa.setForeground(Color.BLUE);
Bursa.setText("Bursa");
add(Bursa);
} else if (Tarayıcı.equalsIgnoreCase("Çanakkale")) {
setLayout(new FlowLayout());
Çanakkale.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Çanakkale.png")));
Çanakkale.setVerticalTextPosition(JLabel.BOTTOM);
Çanakkale.setHorizontalTextPosition(JLabel.CENTER);
Çanakkale.setForeground(Color.BLUE);
Çanakkale.setText("Çanakkale");
add(Çanakkale);
} else if (Tarayıcı.equalsIgnoreCase("Çankırı")) {
setLayout(new FlowLayout());
Çankırı.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Çankırı.png")));
Çankırı.setVerticalTextPosition(JLabel.BOTTOM);
Çankırı.setHorizontalTextPosition(JLabel.CENTER);
Çankırı.setForeground(Color.BLUE);
Çankırı.setText("Çankırı");
add(Çankırı);
} else if (Tarayıcı.equalsIgnoreCase("Çorum")) {
setLayout(new FlowLayout());
Çorum.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Çorum.png")));
Çorum.setVerticalTextPosition(JLabel.BOTTOM);
Çorum.setHorizontalTextPosition(JLabel.CENTER);
Çorum.setForeground(Color.BLUE);
Çorum.setText("Çorum");
add(Çorum);
} else if (Tarayıcı.equalsIgnoreCase("Denizli")) {
setLayout(new FlowLayout());
Denizli.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Denizli.png")));
Denizli.setVerticalTextPosition(JLabel.BOTTOM);
Denizli.setHorizontalTextPosition(JLabel.CENTER);
Denizli.setForeground(Color.BLUE);
Denizli.setText("Denizli");
add(Denizli);
} else if (Tarayıcı.equalsIgnoreCase("Diyarbakır")) {
setLayout(new FlowLayout());
Diyarbakır.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Diyarbakır.png")));
Diyarbakır.setVerticalTextPosition(JLabel.BOTTOM);
Diyarbakır.setHorizontalTextPosition(JLabel.CENTER);
Diyarbakır.setForeground(Color.BLUE);
Diyarbakır.setText("Diyarbakır");
add(Diyarbakır);
} else if (Tarayıcı.equalsIgnoreCase("Düzce")) {
setLayout(new FlowLayout());
Düzce.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Düzce.png")));
Düzce.setVerticalTextPosition(JLabel.BOTTOM);
Düzce.setHorizontalTextPosition(JLabel.CENTER);
Düzce.setForeground(Color.BLUE);
Düzce.setText("Düzce");
add(Düzce);
} else if (Tarayıcı.equalsIgnoreCase("Edirne")) {
setLayout(new FlowLayout());
Edirne.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Edirne.png")));
Edirne.setVerticalTextPosition(JLabel.BOTTOM);
Edirne.setHorizontalTextPosition(JLabel.CENTER);
Edirne.setForeground(Color.BLUE);
Edirne.setText("Edirne");
add(Edirne);
} else if (Tarayıcı.equalsIgnoreCase("Elazığ")) {
setLayout(new FlowLayout());
Elazığ.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Elazığ.png")));
Elazığ.setVerticalTextPosition(JLabel.BOTTOM);
Elazığ.setHorizontalTextPosition(JLabel.CENTER);
Elazığ.setForeground(Color.BLUE);
Elazığ.setText("Elazığ");
add(Elazığ);
} else if (Tarayıcı.equalsIgnoreCase("Erzincan")) {
setLayout(new FlowLayout());
Erzincan.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Erzincan.png")));
Erzincan.setVerticalTextPosition(JLabel.BOTTOM);
Erzincan.setHorizontalTextPosition(JLabel.CENTER);
Erzincan.setForeground(Color.BLUE);
Erzincan.setText("Erzincan");
add(Erzincan);
} else if (Tarayıcı.equalsIgnoreCase("Erzurum")) {
setLayout(new FlowLayout());
Erzurum.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Erzurum.png")));
Erzurum.setVerticalTextPosition(JLabel.BOTTOM);
Erzurum.setHorizontalTextPosition(JLabel.CENTER);
Erzurum.setForeground(Color.BLUE);
Erzurum.setText("Erzurum");
add(Erzurum);
} else if (Tarayıcı.equalsIgnoreCase("Eskişehir")) {
setLayout(new FlowLayout());
Eskişehir.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Eskişehir.png")));
Eskişehir.setVerticalTextPosition(JLabel.BOTTOM);
Eskişehir.setHorizontalTextPosition(JLabel.CENTER);
Eskişehir.setForeground(Color.BLUE);
Eskişehir.setText("Eskişehir");
add(Eskişehir);
} else if (Tarayıcı.equalsIgnoreCase("Gaziantep")) {
setLayout(new FlowLayout());
Gaziantep.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Gaziantep.png")));
Gaziantep.setVerticalTextPosition(JLabel.BOTTOM);
Gaziantep.setHorizontalTextPosition(JLabel.CENTER);
Gaziantep.setForeground(Color.BLUE);
Gaziantep.setText("Gaziantep");
add(Gaziantep);
} else if (Tarayıcı.equalsIgnoreCase("Giresun")) {
setLayout(new FlowLayout());
Giresun.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Giresun.png")));
Giresun.setVerticalTextPosition(JLabel.BOTTOM);
Giresun.setHorizontalTextPosition(JLabel.CENTER);
Giresun.setForeground(Color.BLUE);
Giresun.setText("Giresun");
add(Giresun);
} else if (Tarayıcı.equalsIgnoreCase("Gümüşhane")) {
setLayout(new FlowLayout());
Gümüşhane.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Gümüşhane.png")));
Gümüşhane.setVerticalTextPosition(JLabel.BOTTOM);
Gümüşhane.setHorizontalTextPosition(JLabel.CENTER);
Gümüşhane.setForeground(Color.BLUE);
Gümüşhane.setText("Gümüşhane");
add(Gümüşhane);
} else if (Tarayıcı.equalsIgnoreCase("Hakkari")) {
setLayout(new FlowLayout());
Hakkari.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Hakkari.png")));
Hakkari.setVerticalTextPosition(JLabel.BOTTOM);
Hakkari.setHorizontalTextPosition(JLabel.CENTER);
Hakkari.setForeground(Color.BLUE);
Hakkari.setText("Hakkari");
add(Hakkari);
} else if (Tarayıcı.equalsIgnoreCase("Hatay")) {
setLayout(new FlowLayout());
Hatay.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Hatay.png")));
Hatay.setVerticalTextPosition(JLabel.BOTTOM);
Hatay.setHorizontalTextPosition(JLabel.CENTER);
Hatay.setForeground(Color.BLUE);
Hatay.setText("Hatay");
add(Hatay);
} else if (Tarayıcı.equalsIgnoreCase("Iğdır")) {
setLayout(new FlowLayout());
Iğdır.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Iğdır.png")));
Iğdır.setVerticalTextPosition(JLabel.BOTTOM);
Iğdır.setHorizontalTextPosition(JLabel.CENTER);
Iğdır.setForeground(Color.BLUE);
Iğdır.setText("Iğdır");
add(Iğdır);
} else if (Tarayıcı.equalsIgnoreCase("Isparta")) {
setLayout(new FlowLayout());
Isparta.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Isparta.png")));
Isparta.setVerticalTextPosition(JLabel.BOTTOM);
Isparta.setHorizontalTextPosition(JLabel.CENTER);
Isparta.setForeground(Color.BLUE);
Isparta.setText("Isparta");
add(Isparta);
} else if (Tarayıcı.equalsIgnoreCase("İstanbul")) {
setLayout(new FlowLayout());
İstanbul.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/İstanbul.png")));
İstanbul.setVerticalTextPosition(JLabel.BOTTOM);
İstanbul.setHorizontalTextPosition(JLabel.CENTER);
İstanbul.setForeground(Color.BLUE);
İstanbul.setText("İstanbul");
add(İstanbul);
} else if (Tarayıcı.equalsIgnoreCase("İzmir")) {
setLayout(new FlowLayout());
İzmir.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/İzmir.png")));
İzmir.setVerticalTextPosition(JLabel.BOTTOM);
İzmir.setHorizontalTextPosition(JLabel.CENTER);
İzmir.setForeground(Color.BLUE);
İzmir.setText("İzmir");
add(İzmir);
} else if (Tarayıcı.equalsIgnoreCase("Kahraman Maraş")) {
setLayout(new FlowLayout());
KahramanMaraş.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Kahraman Maraş.png")));
KahramanMaraş.setVerticalTextPosition(JLabel.BOTTOM);
KahramanMaraş.setHorizontalTextPosition(JLabel.CENTER);
KahramanMaraş.setForeground(Color.BLUE);
KahramanMaraş.setText("Kahraman Maraş");
add(KahramanMaraş);
} else if (Tarayıcı.equalsIgnoreCase("Karabük")) {
setLayout(new FlowLayout());
Karabük.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Karabük.png")));
Karabük.setVerticalTextPosition(JLabel.BOTTOM);
Karabük.setHorizontalTextPosition(JLabel.CENTER);
Karabük.setForeground(Color.BLUE);
Karabük.setText("Karabük");
add(Karabük);
} else if (Tarayıcı.equalsIgnoreCase("Karaman")) {
setLayout(new FlowLayout());
Karaman.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Karaman.png")));
Karaman.setVerticalTextPosition(JLabel.BOTTOM);
Karaman.setHorizontalTextPosition(JLabel.CENTER);
Karaman.setForeground(Color.BLUE);
Karaman.setText("Karaman");
add(Karaman);
} else if (Tarayıcı.equalsIgnoreCase("Kars")) {
setLayout(new FlowLayout());
Kars.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Kars.png")));
Kars.setVerticalTextPosition(JLabel.BOTTOM);
Kars.setHorizontalTextPosition(JLabel.CENTER);
Kars.setForeground(Color.BLUE);
Kars.setText("Kars");
add(Kars);
} else if (Tarayıcı.equalsIgnoreCase("Kastamonu")) {
setLayout(new FlowLayout());
Kastamonu.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Kastamonu.png")));
Kastamonu.setVerticalTextPosition(JLabel.BOTTOM);
Kastamonu.setHorizontalTextPosition(JLabel.CENTER);
Kastamonu.setForeground(Color.BLUE);
Kastamonu.setText("Kastamonu");
add(Kastamonu);
} else if (Tarayıcı.equalsIgnoreCase("Kayseri")) {
setLayout(new FlowLayout());
Kayseri.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Kayseri.png")));
Kayseri.setVerticalTextPosition(JLabel.BOTTOM);
Kayseri.setHorizontalTextPosition(JLabel.CENTER);
Kayseri.setForeground(Color.BLUE);
Kayseri.setText("Kayseri");
add(Kayseri);
} else if (Tarayıcı.equalsIgnoreCase("Kilis")) {
setLayout(new FlowLayout());
Kilis.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Kilis.png")));
Kilis.setVerticalTextPosition(JLabel.BOTTOM);
Kilis.setHorizontalTextPosition(JLabel.CENTER);
Kilis.setForeground(Color.BLUE);
Kilis.setText("Kilis");
add(Kilis);
} else if (Tarayıcı.equalsIgnoreCase("Kırıkkale")) {
setLayout(new FlowLayout());
Kırıkkale.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Kırıkkale.png")));
Kırıkkale.setVerticalTextPosition(JLabel.BOTTOM);
Kırıkkale.setHorizontalTextPosition(JLabel.CENTER);
Kırıkkale.setForeground(Color.BLUE);
Kırıkkale.setText("Kırıkkale");
add(Kırıkkale);
} else if (Tarayıcı.equalsIgnoreCase("Kırklareli")) {
setLayout(new FlowLayout());
Kırklareli.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Kırklareli.png")));
Kırklareli.setVerticalTextPosition(JLabel.BOTTOM);
Kırklareli.setHorizontalTextPosition(JLabel.CENTER);
Kırklareli.setForeground(Color.BLUE);
Kırklareli.setText("Kırklareli");
add(Kırklareli);
} else if (Tarayıcı.equalsIgnoreCase("Kırşehir")) {
setLayout(new FlowLayout());
Kırşehir.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Kırşehir.png")));
Kırşehir.setVerticalTextPosition(JLabel.BOTTOM);
Kırşehir.setHorizontalTextPosition(JLabel.CENTER);
Kırşehir.setForeground(Color.BLUE);
Kırşehir.setText("Kırşehir");
add(Kırşehir);
} else if (Tarayıcı.equalsIgnoreCase("Kocaeli")) {
setLayout(new FlowLayout());
Kocaeli.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Kocaeli.png")));
Kocaeli.setVerticalTextPosition(JLabel.BOTTOM);
Kocaeli.setHorizontalTextPosition(JLabel.CENTER);
Kocaeli.setForeground(Color.BLUE);
Kocaeli.setText("Kocaeli");
add(Kocaeli);
} else if (Tarayıcı.equalsIgnoreCase("Konya")) {
setLayout(new FlowLayout());
Konya.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Konya.png")));
Konya.setVerticalTextPosition(JLabel.BOTTOM);
Konya.setHorizontalTextPosition(JLabel.CENTER);
Konya.setForeground(Color.BLUE);
Konya.setText("Konya");
add(Konya);
} else if (Tarayıcı.equalsIgnoreCase("Kütahya")) {
setLayout(new FlowLayout());
Kütahya.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Kütahya.png")));
Kütahya.setVerticalTextPosition(JLabel.BOTTOM);
Kütahya.setHorizontalTextPosition(JLabel.CENTER);
Kütahya.setForeground(Color.BLUE);
Kütahya.setText("Kütahya");
add(Kütahya);
} else if (Tarayıcı.equalsIgnoreCase("Malatya")) {
setLayout(new FlowLayout());
Malatya.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Malatya.png")));
Malatya.setVerticalTextPosition(JLabel.BOTTOM);
Malatya.setHorizontalTextPosition(JLabel.CENTER);
Malatya.setForeground(Color.BLUE);
Malatya.setText("Malatya");
add(Malatya);
} else if (Tarayıcı.equalsIgnoreCase("Manisa")) {
setLayout(new FlowLayout());
Manisa.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Manisa.png")));
Manisa.setVerticalTextPosition(JLabel.BOTTOM);
Manisa.setHorizontalTextPosition(JLabel.CENTER);
Manisa.setForeground(Color.BLUE);
Manisa.setText("Manisa");
add(Manisa);
} else if (Tarayıcı.equalsIgnoreCase("Mardin")) {
setLayout(new FlowLayout());
Mardin.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Mardin.png")));
Mardin.setVerticalTextPosition(JLabel.BOTTOM);
Mardin.setHorizontalTextPosition(JLabel.CENTER);
Mardin.setForeground(Color.BLUE);
Mardin.setText("Mardin");
add(Mardin);
} else if (Tarayıcı.equalsIgnoreCase("Mersin")) {
setLayout(new FlowLayout());
Mersin.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Mersin.png")));
Mersin.setVerticalTextPosition(JLabel.BOTTOM);
Mersin.setHorizontalTextPosition(JLabel.CENTER);
Mersin.setForeground(Color.BLUE);
Mersin.setText("Mersin");
add(Mersin);
} else if (Tarayıcı.equalsIgnoreCase("Muğla")) {
setLayout(new FlowLayout());
Muğla.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Muğla.png")));
Muğla.setVerticalTextPosition(JLabel.BOTTOM);
Muğla.setHorizontalTextPosition(JLabel.CENTER);
Muğla.setForeground(Color.BLUE);
Muğla.setText("Muğla");
add(Muğla);
} else if (Tarayıcı.equalsIgnoreCase("Muş")) {
setLayout(new FlowLayout());
Muş.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Muş.png")));
Muş.setVerticalTextPosition(JLabel.BOTTOM);
Muş.setHorizontalTextPosition(JLabel.CENTER);
Muş.setForeground(Color.BLUE);
Muş.setText("Muş");
add(Muş);
} else if (Tarayıcı.equalsIgnoreCase("Nevşehir")) {
setLayout(new FlowLayout());
Nevşehir.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Nevşehir.png")));
Nevşehir.setVerticalTextPosition(JLabel.BOTTOM);
Nevşehir.setHorizontalTextPosition(JLabel.CENTER);
Nevşehir.setForeground(Color.BLUE);
Nevşehir.setText("Nevşehir");
add(Nevşehir);
} else if (Tarayıcı.equalsIgnoreCase("Niğde")) {
setLayout(new FlowLayout());
Niğde.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Niğde.png")));
Niğde.setVerticalTextPosition(JLabel.BOTTOM);
Niğde.setHorizontalTextPosition(JLabel.CENTER);
Niğde.setForeground(Color.BLUE);
Niğde.setText("Niğde");
add(Niğde);
} else if (Tarayıcı.equalsIgnoreCase("Ordu")) {
setLayout(new FlowLayout());
Ordu.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Ordu.png")));
Ordu.setVerticalTextPosition(JLabel.BOTTOM);
Ordu.setHorizontalTextPosition(JLabel.CENTER);
Ordu.setForeground(Color.BLUE);
Ordu.setText("Ordu");
add(Ordu);
} else if (Tarayıcı.equalsIgnoreCase("Osmaniye")) {
setLayout(new FlowLayout());
Osmaniye.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Osmaniye.png")));
Osmaniye.setVerticalTextPosition(JLabel.BOTTOM);
Osmaniye.setHorizontalTextPosition(JLabel.CENTER);
Osmaniye.setForeground(Color.BLUE);
Osmaniye.setText("Osmaniye");
add(Osmaniye);
} else if (Tarayıcı.equalsIgnoreCase("Rize")) {
setLayout(new FlowLayout());
Rize.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Rize.png")));
Rize.setVerticalTextPosition(JLabel.BOTTOM);
Rize.setHorizontalTextPosition(JLabel.CENTER);
Rize.setForeground(Color.BLUE);
Rize.setText("Rize");
add(Rize);
} else if (Tarayıcı.equalsIgnoreCase("Sakarya")) {
setLayout(new FlowLayout());
Sakarya.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Sakarya.png")));
Sakarya.setVerticalTextPosition(JLabel.BOTTOM);
Sakarya.setHorizontalTextPosition(JLabel.CENTER);
Sakarya.setForeground(Color.BLUE);
Sakarya.setText("Sakarya");
add(Sakarya);
} else if (Tarayıcı.equalsIgnoreCase("Samsun")) {
setLayout(new FlowLayout());
Samsun.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Samsun.png")));
Samsun.setVerticalTextPosition(JLabel.BOTTOM);
Samsun.setHorizontalTextPosition(JLabel.CENTER);
Samsun.setForeground(Color.BLUE);
Samsun.setText("Samsun");
add(Samsun);
} else if (Tarayıcı.equalsIgnoreCase("Siirt")) {
setLayout(new FlowLayout());
Siirt.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Siirt.png")));
Siirt.setVerticalTextPosition(JLabel.BOTTOM);
Siirt.setHorizontalTextPosition(JLabel.CENTER);
Siirt.setForeground(Color.BLUE);
Siirt.setText("Siirt");
add(Siirt);
} else if (Tarayıcı.equalsIgnoreCase("Sinop")) {
setLayout(new FlowLayout());
Sinop.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Sinop.png")));
Sinop.setVerticalTextPosition(JLabel.BOTTOM);
Sinop.setHorizontalTextPosition(JLabel.CENTER);
Sinop.setForeground(Color.BLUE);
Sinop.setText("Sinop");
add(Sinop);
} else if (Tarayıcı.equalsIgnoreCase("Sivas")) {
setLayout(new FlowLayout());
Sivas.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Sivas.png")));
Sivas.setVerticalTextPosition(JLabel.BOTTOM);
Sivas.setHorizontalTextPosition(JLabel.CENTER);
Sivas.setForeground(Color.BLUE);
Sivas.setText("Sivas");
add(Sivas);
} else if (Tarayıcı.equalsIgnoreCase("Şanlıurfa")) {
setLayout(new FlowLayout());
ŞanlıUrfa.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/ŞanlıUrfa.png")));
ŞanlıUrfa.setVerticalTextPosition(JLabel.BOTTOM);
ŞanlıUrfa.setHorizontalTextPosition(JLabel.CENTER);
ŞanlıUrfa.setForeground(Color.BLUE);
ŞanlıUrfa.setText("ŞanlıUrfa");
add(ŞanlıUrfa);
} else if (Tarayıcı.equalsIgnoreCase("Şırnak")) {
setLayout(new FlowLayout());
Şırnak.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Şırnak.png")));
Şırnak.setVerticalTextPosition(JLabel.BOTTOM);
Şırnak.setHorizontalTextPosition(JLabel.CENTER);
Şırnak.setForeground(Color.BLUE);
Şırnak.setText("Şırnak");
add(Şırnak);
} else if (Tarayıcı.equalsIgnoreCase("Tekirdağ")) {
setLayout(new FlowLayout());
Tekirdağ.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Tekirdağ.png")));
Tekirdağ.setVerticalTextPosition(JLabel.BOTTOM);
Tekirdağ.setHorizontalTextPosition(JLabel.CENTER);
Tekirdağ.setForeground(Color.BLUE);
Tekirdağ.setText("Tekirdağ");
add(Tekirdağ);
} else if (Tarayıcı.equalsIgnoreCase("Tokat")) {
setLayout(new FlowLayout());
Tokat.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Tokat.png")));
Tokat.setVerticalTextPosition(JLabel.BOTTOM);
Tokat.setHorizontalTextPosition(JLabel.CENTER);
Tokat.setForeground(Color.BLUE);
Tokat.setText("Tokat");
add(Tokat);
} else if (Tarayıcı.equalsIgnoreCase("Trabzon")) {
setLayout(new FlowLayout());
Trabzon.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Trabzon.png")));
Trabzon.setVerticalTextPosition(JLabel.BOTTOM);
Trabzon.setHorizontalTextPosition(JLabel.CENTER);
Trabzon.setForeground(Color.BLUE);
Trabzon.setText("Trabzon");
add(Trabzon);
} else if (Tarayıcı.equalsIgnoreCase("Tunceli")) {
setLayout(new FlowLayout());
Tunceli.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Tunceli.png")));
Tunceli.setVerticalTextPosition(JLabel.BOTTOM);
Tunceli.setHorizontalTextPosition(JLabel.CENTER);
Tunceli.setForeground(Color.BLUE);
Tunceli.setText("Tunceli");
add(Tunceli);
} else if (Tarayıcı.equalsIgnoreCase("Uşak")) {
setLayout(new FlowLayout());
Uşak.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Uşak.png")));
Uşak.setVerticalTextPosition(JLabel.BOTTOM);
Uşak.setHorizontalTextPosition(JLabel.CENTER);
Uşak.setForeground(Color.BLUE);
Uşak.setText("Uşak");
add(Uşak);
} else if (Tarayıcı.equalsIgnoreCase("Van")) {
setLayout(new FlowLayout());
Van.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Van.png")));
Van.setVerticalTextPosition(JLabel.BOTTOM);
Van.setHorizontalTextPosition(JLabel.CENTER);
Van.setForeground(Color.BLUE);
Van.setText("Van");
add(Van);
} else if (Tarayıcı.equalsIgnoreCase("Yalova")) {
setLayout(new FlowLayout());
Yalova.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Yalova.png")));
Yalova.setVerticalTextPosition(JLabel.BOTTOM);
Yalova.setHorizontalTextPosition(JLabel.CENTER);
Yalova.setForeground(Color.BLUE);
Yalova.setText("Yalova");
add(Yalova);
} else if (Tarayıcı.equalsIgnoreCase("Yozgat")) {
setLayout(new FlowLayout());
Yozgat.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Yozgat.png")));
Yozgat.setVerticalTextPosition(JLabel.BOTTOM);
Yozgat.setHorizontalTextPosition(JLabel.CENTER);
Yozgat.setForeground(Color.BLUE);
Yozgat.setText("Yozgat");
add(Yozgat);
} else if (Tarayıcı.equalsIgnoreCase("Zonguldak")) {
setLayout(new FlowLayout());
Zonguldak.setIcon(new ImageIcon(getImage(getDocumentBase(), "iller/Zonguldak.png")));
Zonguldak.setVerticalTextPosition(JLabel.BOTTOM);
Zonguldak.setHorizontalTextPosition(JLabel.CENTER);
Zonguldak.setForeground(Color.BLUE);
Zonguldak.setText("Zonguldak");
add(Zonguldak);
} else {
JOptionPane.showMessageDialog(null, "İl Bulunamadı");
}
}
}
Ekran Görüntüleri;
Numan Bezaroğlu
Yorumunuzu Ekleyin