📄 HavaDurumuInfoAnaliz.java .java dosyası

⬇️ İndir
import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.Image; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.image.BufferedImage; import java.io.File; import javax.imageio.ImageIO; import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.SwingConstants; public class HavaDurumuInfoAnaliz { public static String currentLang = "tr"; // açılış dili public static JMenu fileMenu = new JMenu(); public static JMenuItem saveAsJpeg = new JMenuItem(); public static JMenuItem exit = new JMenuItem(); public static String lastCountryCode = null; public static String lastCityName = null; public static JMenu country = new JMenu(); public static JMenu japan = new JMenu(); public static JMenu turkiye = new JMenu(); public static JMenu madagascar = new JMenu(); public static JMenu england = new JMenu(); public static JMenu all = new JMenu(); public static JMenu language = new JMenu(); public static JMenuItem japanLang = new JMenuItem(); public static JMenuItem turkish = new JMenuItem(); public static JMenuItem malagasy = new JMenuItem(); public static JMenuItem englishLang = new JMenuItem(); // Türkiye şehirleri public static JMenuItem istanbulItem = new JMenuItem(); public static JMenuItem ankaraItem = new JMenuItem(); public static JMenuItem izmirItem = new JMenuItem(); public static JMenuItem bursaItem = new JMenuItem(); public static JMenuItem antalyaItem = new JMenuItem(); public static JMenuItem konyaItem = new JMenuItem(); public static JMenuItem gaziantepItem = new JMenuItem(); public static JMenuItem trabzonItem = new JMenuItem(); public static JMenuItem samsunItem = new JMenuItem(); public static JMenuItem eskisehirItem = new JMenuItem(); // Japonya şehirleri public static JMenuItem tokyoItem = new JMenuItem(); public static JMenuItem kyotoItem = new JMenuItem(); public static JMenuItem osakaItem = new JMenuItem(); public static JMenuItem hiroshimaItem = new JMenuItem(); public static JMenuItem sapporoItem = new JMenuItem(); public static JMenuItem yokohamaItem = new JMenuItem(); public static JMenuItem nagoyaItem = new JMenuItem(); public static JMenuItem fukuokaItem = new JMenuItem(); public static JMenuItem naraItem = new JMenuItem(); public static JMenuItem kobeItem = new JMenuItem(); // Madagaskar şehirleri public static JMenuItem antananarivoItem = new JMenuItem(); public static JMenuItem toamasinaItem = new JMenuItem(); public static JMenuItem fianarantsoaItem = new JMenuItem(); public static JMenuItem mahajangaItem = new JMenuItem(); public static JMenuItem toliaraItem = new JMenuItem(); public static JMenuItem antsirananaItem = new JMenuItem(); public static JMenuItem ambatondrazakaItem = new JMenuItem(); public static JMenuItem manakaraItem = new JMenuItem(); public static JMenuItem morondavaItem = new JMenuItem(); public static JMenuItem sambavaItem = new JMenuItem(); // İngiltere şehirleri public static JMenuItem londonItem = new JMenuItem(); public static JMenuItem manchesterItem = new JMenuItem(); public static JMenuItem birminghamItem = new JMenuItem(); public static JMenuItem liverpoolItem = new JMenuItem(); public static JMenuItem leedsItem = new JMenuItem(); public static JMenuItem bristolItem = new JMenuItem(); public static JMenuItem sheffieldItem = new JMenuItem(); public static JMenuItem newcastleItem = new JMenuItem(); public static JMenuItem oxfordItem = new JMenuItem(); public static JMenuItem cambridgeItem = new JMenuItem(); public static JPanel mainPanel; public static void main(String[] args) { JFrame frame = new JFrame(); frame.setTitle("Java Blackboard 159 | Hava Durumu Bilgi Ekranı"); frame.setLayout(null); JMenuBar menuBar = new JMenuBar(); fileMenu = new JMenu(); saveAsJpeg = new JMenuItem(); exit = new JMenuItem(); fileMenu.add(saveAsJpeg); fileMenu.add(exit); saveAsJpeg.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { try { if (mainPanel.getComponentCount() == 0) { JOptionPane.showMessageDialog(mainPanel, "Kaydedilecek içerik yok!"); return; } java.awt.Component comp = mainPanel.getComponent(0); // Eğer JScrollPane geldiyse -> içindeki gerçek paneli al if (comp instanceof JScrollPane) { JScrollPane sp = (JScrollPane) comp; comp = sp.getViewport().getView(); } // Panelin tüm boyutunu al Dimension dim = comp.getPreferredSize(); // BufferedImage oluştur (tam boy) BufferedImage img = new BufferedImage(dim.width, dim.height, BufferedImage.TYPE_INT_RGB); // Paneli komple boyat comp.setSize(dim); // güvenlik için comp.paint(img.getGraphics()); // Masaüstü yolu String desktop = System.getProperty("user.home") + "/Desktop"; String filename = "screenshot.jpg"; if (lastCountryCode != null && lastCityName != null) { filename = lastCountryCode.toUpperCase() + "_" + lastCityName + ".jpg"; } File outputfile = new File(desktop, filename); ImageIO.write(img, "jpg", outputfile); //JOptionPane.showMessageDialog(mainPanel, "Dosya kaydedildi: " + outputfile.getAbsolutePath()); JOptionPane.showMessageDialog(mainPanel, "Dosya Desktop'a kaydedildi: " + outputfile.getName()); } catch (Exception ex) { ex.printStackTrace(); JOptionPane.showMessageDialog(mainPanel, "Hata oluştu: " + ex.getMessage()); } } }); exit.addActionListener(e -> System.exit(0)); country = new JMenu(); japan = new JMenu(); turkiye = new JMenu(); madagascar = new JMenu(); england = new JMenu(); all = new JMenu(); country.add(japan); country.add(turkiye); country.add(madagascar); country.add(england); country.add(all); // Türkiye'nin şehirlerini ekliyoruz... turkiye.add(istanbulItem); turkiye.add(ankaraItem); turkiye.add(izmirItem); turkiye.add(bursaItem); turkiye.add(antalyaItem); turkiye.add(konyaItem); turkiye.add(gaziantepItem); turkiye.add(trabzonItem); turkiye.add(samsunItem); turkiye.add(eskisehirItem); addCityAction(istanbulItem, "tr", "İstanbul"); addCityAction(ankaraItem, "tr", "Ankara"); addCityAction(izmirItem, "tr", "İzmir"); addCityAction(bursaItem, "tr", "Bursa"); addCityAction(antalyaItem, "tr", "Antalya"); addCityAction(konyaItem, "tr", "Konya"); addCityAction(gaziantepItem, "tr", "Gaziantep"); addCityAction(trabzonItem, "tr", "Trabzon"); addCityAction(samsunItem, "tr", "Samsun"); addCityAction(eskisehirItem, "tr", "Eskişehir"); // Japonya japan.add(tokyoItem); japan.add(kyotoItem); japan.add(osakaItem); japan.add(hiroshimaItem); japan.add(sapporoItem); japan.add(yokohamaItem); japan.add(nagoyaItem); japan.add(fukuokaItem); japan.add(naraItem); japan.add(kobeItem); addCityAction(tokyoItem, "jp", "Tokyo"); addCityAction(kyotoItem, "jp", "Kyoto"); addCityAction(osakaItem, "jp", "Osaka"); addCityAction(hiroshimaItem, "jp", "Hiroşima"); addCityAction(sapporoItem, "jp", "Sapporo"); addCityAction(yokohamaItem, "jp", "Yokohama"); addCityAction(nagoyaItem, "jp", "Nagoya"); addCityAction(fukuokaItem, "jp", "Fukuoka"); addCityAction(naraItem, "jp", "Nara"); addCityAction(kobeItem, "jp", "Kobe"); // Madagaskar madagascar.add(antananarivoItem); madagascar.add(toamasinaItem); madagascar.add(fianarantsoaItem); madagascar.add(mahajangaItem); madagascar.add(toliaraItem); madagascar.add(antsirananaItem); madagascar.add(ambatondrazakaItem); madagascar.add(manakaraItem); madagascar.add(morondavaItem); madagascar.add(sambavaItem); addCityAction(antananarivoItem, "mg", "Antananarivo"); addCityAction(toamasinaItem, "mg", "Toamasina"); addCityAction(fianarantsoaItem, "mg", "Fianarantsoa"); addCityAction(mahajangaItem, "mg", "Mahajanga"); addCityAction(toliaraItem, "mg", "Toliara"); addCityAction(antsirananaItem, "mg", "Antsiranana"); addCityAction(ambatondrazakaItem, "mg", "Ambatondrazaka"); addCityAction(manakaraItem, "mg", "Manakara"); addCityAction(morondavaItem, "mg", "Morondava"); addCityAction(sambavaItem, "mg", "Sambava"); // İngiltere england.add(londonItem); england.add(manchesterItem); england.add(birminghamItem); england.add(liverpoolItem); england.add(leedsItem); england.add(bristolItem); england.add(sheffieldItem); england.add(newcastleItem); england.add(oxfordItem); england.add(cambridgeItem); addCityAction(londonItem, "uk", "London"); addCityAction(manchesterItem, "uk", "Manchester"); addCityAction(birminghamItem, "uk", "Birmingham"); addCityAction(liverpoolItem, "uk", "Liverpool"); addCityAction(leedsItem, "uk", "Leeds"); addCityAction(bristolItem, "uk", "Bristol"); addCityAction(sheffieldItem, "uk", "Sheffield"); addCityAction(newcastleItem, "uk", "Newcastle"); addCityAction(oxfordItem, "uk", "Oxford"); addCityAction(cambridgeItem, "uk", "Cambridge"); language = new JMenu(); japanLang = new JMenuItem(); turkish = new JMenuItem(); malagasy = new JMenuItem(); language.add(japanLang); language.add(turkish); language.add(malagasy); language.add(englishLang); updateLanguage("tr"); // açilişta menü Türkçe olarak gelsin diye... japanLang.addActionListener(e -> updateLanguage("jp")); turkish.addActionListener(e -> updateLanguage("tr")); malagasy.addActionListener(e -> updateLanguage("mg")); englishLang.addActionListener(e -> updateLanguage("en")); mainPanel = new JPanel(); mainPanel.setLayout(null); mainPanel.setBackground(renk(1)); // Norlamde yükseklik: 630 - 40 = 590 olması gerekirdi // ama frame ve manuBar yüksekliği alan daralttığı için: 530 oldu mainPanel.setBounds(20, 20, 1080, 530); menuBar.add(fileMenu); menuBar.add(country); menuBar.add(language); frame.setJMenuBar(menuBar); frame.add(mainPanel); mainPanel.add(contentPanel("Welcome")); frame.setSize(1120, 630); frame.getContentPane().setBackground(renk(0)); frame.setLocationRelativeTo(null); frame.setResizable(false); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); } public static void addCityAction(JMenuItem item, String countryCode, String cityName) { item.addActionListener(e -> { lastCountryCode = countryCode; // Kaydetme için sakla lastCityName = cityName; // Kaydetme için sakla mainPanel.removeAll(); mainPanel.add(contentPanel(countryCode, cityName)); mainPanel.revalidate(); mainPanel.repaint(); }); } public static JScrollPane contentPanel(String country, String city) { String countryName = ""; String[] monthNames = monthsFor(currentLang); switch (country) { case "tr": countryName = "Türkiye"; break; case "jp": countryName = "Japonya"; break; case "mg": countryName = "Madagaskar"; break; case "uk": countryName = "İngiltere"; break; default: countryName = ""; break; } Font fontCountry = new Font("Ubuntu", Font.PLAIN, 25); Font fontCity = new Font("Ubuntu", Font.BOLD, 35); JPanel panel = new JPanel(); panel.setLayout(null); // Bayrak ImageIcon flagIcon = new ImageIcon("src/images/flags/flag_" + country + ".jpg"); Image scaledFlag = flagIcon.getImage().getScaledInstance(128, 128, Image.SCALE_SMOOTH); JLabel lblFlag = new JLabel(new ImageIcon(scaledFlag)); lblFlag.setBounds(20, 20, 128, 128); // Ülke adı JLabel lblCountry = new JLabel(countryName + " [" + country + "]"); lblCountry.setFont(fontCountry); lblCountry.setBounds(170, 20, 300, 30); // Şehir adı JLabel lblCity = new JLabel(city); lblCity.setFont(fontCity); lblCity.setOpaque(false); lblCity.setBounds(160, 50, 300, 50); // Şehir panoraması String panoPath = "src/images/panorama/" + country + "_" + city + ".jpeg"; System.out.println(panoPath); ImageIcon cityPanorama = new ImageIcon(panoPath); Image scaledCityPanorama = cityPanorama.getImage().getScaledInstance(530, 152, Image.SCALE_SMOOTH); JLabel lblCityPanorama = new JLabel(new ImageIcon(scaledCityPanorama)); lblCityPanorama.setOpaque(true); lblCityPanorama.setBounds(470, 20, 530, 128); panel.add(lblCountry); panel.add(lblCity); panel.add(lblFlag); panel.add(lblCityPanorama); panel.setBackground(renk(2)); panel.setPreferredSize(new Dimension(1020, 700)); // Scroll için yükseklik artırıldı JScrollPane scrollPane = new JScrollPane(panel); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); scrollPane.setBounds(20, 20, 1040, 500); // --- WeatherDataStore’dan sıcaklık verisini al --- System.out.println(country+", "+ city); double[] temps = WeatherDataStore.getCityWeather(country, city); // Test amaçlı console'a yazdıralım bakalım. for (int i=0; i<temps.length; i++) System.out.println(temps[i]); // Ay görsellerini 6x2 grid şeklinde yerleştirme int startX = 20; int startY = 200; // Bayrak/panorama altından başlasın int width = 150; int height = 200; int gapX = 15; int gapY = 15; Font fontAy = new Font("Ubuntu", Font.BOLD, 17); Font fontSicaklik = new Font("Ubuntu", Font.BOLD, 35); for (int month = 1; month <= 12; month++) { String monthFile = String.format("src/images/months/%02d.jpeg", month); ImageIcon monthIcon = new ImageIcon(monthFile); Image scaled = monthIcon.getImage().getScaledInstance(width, height, Image.SCALE_SMOOTH); JLabel lblMonth = new JLabel(new ImageIcon(scaled)); int row = (month - 1) / 6; int col = (month - 1) % 6; int x = startX + col * (width + gapX); int y = startY + row * (height + gapY); lblMonth.setBounds(x, y, width, height); lblMonth.setLayout(null); // Overlay başlık JPanel overlayTitle = new JPanel(); overlayTitle.setBackground(new Color(255, 255, 255, 150)); overlayTitle.setLayout(null); overlayTitle.setBounds(15, 15, 120, 40); // Overlay sıcaklık JPanel overlay = new JPanel(); overlay.setBackground(new Color(255, 255, 255, 110)); overlay.setLayout(null); overlay.setBounds(15, 15, 120, 170); // Ay adı int index = month - 1; JLabel lblMonthName = new JLabel(monthNames[index], SwingConstants.CENTER); lblMonthName.setFont(fontAy); lblMonthName.setBounds(0, 0, 120, 40); // Sıcaklık String tempText = temps != null ? String.format("%.1f °C", temps[index]) : "-- °C"; JLabel lblTemp = new JLabel(tempText, SwingConstants.CENTER); lblTemp.setFont(fontSicaklik); lblTemp.setBounds(0, 80, 120, 30); overlayTitle.add(lblMonthName); overlay.add(lblTemp); lblMonth.add(overlayTitle); lblMonth.add(overlay); panel.add(lblMonth); } return scrollPane; } public static JPanel contentPanel(String msg) { JPanel panel = new JPanel(); panel.setLayout(null); JLabel lblCountry = new JLabel(msg); lblCountry.setBounds(20,20,300,30); panel.add(lblCountry); panel.setBackground(renk(2)); panel.setBounds(20,20, 1040, 490); return panel; } public static void updateLanguage(String lang) { currentLang = lang; // seçili dili global değişkende sakla if (lang.equals("tr")) { fileMenu.setText("Dosya"); saveAsJpeg.setText("JPEG Olarak Kaydet"); exit.setText("Çıkış"); country.setText("Ülke"); japan.setText("Japonya"); turkiye.setText("Türkiye"); madagascar.setText("Madagaskar"); england.setText("İngiltere"); all.setText("Tümü"); // Türkiye'nin şehirleri... istanbulItem.setText("İstanbul"); ankaraItem.setText("Ankara"); izmirItem.setText("İzmir"); bursaItem.setText("Bursa"); antalyaItem.setText("Antalya"); konyaItem.setText("Konya"); gaziantepItem.setText("Gaziantep"); trabzonItem.setText("Trabzon"); samsunItem.setText("Samsun"); eskisehirItem.setText("Eskişehir"); // Japonya şehirleri tokyoItem.setText("Tokyo"); kyotoItem.setText("Kyoto"); osakaItem.setText("Osaka"); hiroshimaItem.setText("Hiroşima"); sapporoItem.setText("Sapporo"); yokohamaItem.setText("Yokohama"); nagoyaItem.setText("Nagoya"); fukuokaItem.setText("Fukuoka"); naraItem.setText("Nara"); kobeItem.setText("Kobe"); // Madagaskar şehirleri antananarivoItem.setText("Antananarivo"); toamasinaItem.setText("Toamasina"); fianarantsoaItem.setText("Fianarantsoa"); mahajangaItem.setText("Mahajanga"); toliaraItem.setText("Toliara"); antsirananaItem.setText("Antsiranana"); ambatondrazakaItem.setText("Ambatondrazaka"); manakaraItem.setText("Manakara"); morondavaItem.setText("Morondava"); sambavaItem.setText("Sambava"); // İngiltere şehirleri londonItem.setText("London"); manchesterItem.setText("Manchester"); birminghamItem.setText("Birmingham"); liverpoolItem.setText("Liverpool"); leedsItem.setText("Leeds"); bristolItem.setText("Bristol"); sheffieldItem.setText("Sheffield"); newcastleItem.setText("Newcastle"); oxfordItem.setText("Oxford"); cambridgeItem.setText("Cambridge"); language.setText("Dil"); japanLang.setText("Japonca"); turkish.setText("Türkçe"); malagasy.setText("Malgaşça"); englishLang.setText("İngilizce"); } else if (lang.equals("jp")) { fileMenu.setText("ファイル"); saveAsJpeg.setText("JPEGとして保存"); exit.setText("終了"); country.setText("国"); japan.setText("日本"); turkiye.setText("トルコ"); madagascar.setText("マダガスカル"); england.setText("イギリス"); all.setText("すべて"); // Türkiye'nin şehirleri istanbulItem.setText("イスタンブール"); ankaraItem.setText("アンカラ"); izmirItem.setText("イズミル"); bursaItem.setText("ブルサ"); antalyaItem.setText("アンタルヤ"); konyaItem.setText("コンヤ"); gaziantepItem.setText("ガズィアンテプ"); trabzonItem.setText("トラブゾン"); samsunItem.setText("サムスン"); eskisehirItem.setText("エスキシェヒル"); // Japonya şehirleri. tokyoItem.setText("東京"); kyotoItem.setText("京都"); osakaItem.setText("大阪"); hiroshimaItem.setText("広島"); sapporoItem.setText("札幌"); yokohamaItem.setText("横浜"); nagoyaItem.setText("名古屋"); fukuokaItem.setText("福岡"); naraItem.setText("奈良"); kobeItem.setText("神戸"); // Madagaskar şehirleri antananarivoItem.setText("アンタナナリボ"); toamasinaItem.setText("トアマシナ"); fianarantsoaItem.setText("フィアナランツォア"); mahajangaItem.setText("マハジャンガ"); toliaraItem.setText("トゥリアラ"); antsirananaItem.setText("アンツィラナナ"); ambatondrazakaItem.setText("アンバトンドラザカ"); manakaraItem.setText("マナカラ"); morondavaItem.setText("モロンダバ"); sambavaItem.setText("サンババ"); // İngiltere şehirleri londonItem.setText("ロンドン"); manchesterItem.setText("マンチェスター"); birminghamItem.setText("バーミンガム"); liverpoolItem.setText("リバプール"); leedsItem.setText("リーズ"); bristolItem.setText("ブリストル"); sheffieldItem.setText("シェフィールド"); newcastleItem.setText("ニューカッスル"); oxfordItem.setText("オックスフォード"); cambridgeItem.setText("ケンブリッジ"); language.setText("言語"); japanLang.setText("日本語"); turkish.setText("トルコ語"); malagasy.setText("マラガシ語"); englishLang.setText("英語"); } else if (lang.equals("mg")) { fileMenu.setText("Rakitra"); saveAsJpeg.setText("Tehirizo ho JPEG"); exit.setText("Fivoahana"); country.setText("Firenena"); japan.setText("Japana"); turkiye.setText("Tiorka"); madagascar.setText("Madagasikara"); england.setText("Angletera"); all.setText("Rehetra"); // Türkiye'nin şehir adları istanbulItem.setText("Istanbul"); ankaraItem.setText("Ankara"); izmirItem.setText("Izmir"); bursaItem.setText("Bursa"); antalyaItem.setText("Antalya"); konyaItem.setText("Konya"); gaziantepItem.setText("Gaziantep"); trabzonItem.setText("Trabzon"); samsunItem.setText("Samsun"); eskisehirItem.setText("Eskisehir"); // Japonya şehirleri tokyoItem.setText("Tokyo"); kyotoItem.setText("Kyoto"); osakaItem.setText("Osaka"); hiroshimaItem.setText("Hiroshima"); sapporoItem.setText("Sapporo"); yokohamaItem.setText("Yokohama"); nagoyaItem.setText("Nagoya"); fukuokaItem.setText("Fukuoka"); naraItem.setText("Nara"); kobeItem.setText("Kobe"); // Madagaskar şehirleri antananarivoItem.setText("Antananarivo"); toamasinaItem.setText("Toamasina"); fianarantsoaItem.setText("Fianarantsoa"); mahajangaItem.setText("Mahajanga"); toliaraItem.setText("Toliara"); antsirananaItem.setText("Antsiranana"); ambatondrazakaItem.setText("Ambatondrazaka"); manakaraItem.setText("Manakara"); morondavaItem.setText("Morondava"); sambavaItem.setText("Sambava"); // İngiltere şehirleri londonItem.setText("London"); manchesterItem.setText("Manchester"); birminghamItem.setText("Birmingham"); liverpoolItem.setText("Liverpool"); leedsItem.setText("Leeds"); bristolItem.setText("Bristol"); sheffieldItem.setText("Sheffield"); newcastleItem.setText("Newcastle"); oxfordItem.setText("Oxford"); cambridgeItem.setText("Cambridge"); language.setText("Fiteny"); japanLang.setText("Japoney"); turkish.setText("Tiorka"); malagasy.setText("Malagasy"); englishLang.setText("Anglisy"); } else if (lang.equals("en")) { fileMenu.setText("File"); saveAsJpeg.setText("Save as JPEG"); exit.setText("Exit"); country.setText("Country"); japan.setText("Japan"); turkiye.setText("Türkiye"); madagascar.setText("Madagascar"); england.setText("England"); all.setText("All"); // Türkiye'nin şehirleri istanbulItem.setText("Istanbul"); ankaraItem.setText("Ankara"); izmirItem.setText("Izmir"); bursaItem.setText("Bursa"); antalyaItem.setText("Antalya"); konyaItem.setText("Konya"); gaziantepItem.setText("Gaziantep"); trabzonItem.setText("Trabzon"); samsunItem.setText("Samsun"); eskisehirItem.setText("Eskisehir"); // Japonya şehirleri tokyoItem.setText("Tokyo"); kyotoItem.setText("Kyoto"); osakaItem.setText("Osaka"); hiroshimaItem.setText("Hiroshima"); sapporoItem.setText("Sapporo"); yokohamaItem.setText("Yokohama"); nagoyaItem.setText("Nagoya"); fukuokaItem.setText("Fukuoka"); naraItem.setText("Nara"); kobeItem.setText("Kobe"); // Madagaskar şehirleri antananarivoItem.setText("Antananarivo"); toamasinaItem.setText("Toamasina"); fianarantsoaItem.setText("Fianarantsoa"); mahajangaItem.setText("Mahajanga"); toliaraItem.setText("Toliara"); antsirananaItem.setText("Antsiranana"); ambatondrazakaItem.setText("Ambatondrazaka"); manakaraItem.setText("Manakara"); morondavaItem.setText("Morondava"); sambavaItem.setText("Sambava"); // İngiltere şehirleri londonItem.setText("London"); manchesterItem.setText("Manchester"); birminghamItem.setText("Birmingham"); liverpoolItem.setText("Liverpool"); leedsItem.setText("Leeds"); bristolItem.setText("Bristol"); sheffieldItem.setText("Sheffield"); newcastleItem.setText("Newcastle"); oxfordItem.setText("Oxford"); cambridgeItem.setText("Cambridge"); language.setText("Language"); japanLang.setText("Japanese"); turkish.setText("Turkish"); malagasy.setText("Malagasy"); englishLang.setText("English"); } } public static Color renk(int alanKodu) { Color renk = new Color(150, 160, 170); switch (alanKodu) { case 0: // frame'in background rengi. renk = new Color(37, 29, 89); break; case 1: // mainPanel background rengi. renk = new Color(128, 137, 166); break; case 2: // contentPanel() background rengi. renk = new Color(200, 231, 242); break; default : renk = new Color(15, 90, 120); break; } return renk; } private static String[] monthsFor(String lang) { switch (lang) { case "tr": return new String[]{"Ocak","Şubat","Mart","Nisan","Mayıs","Haziran", "Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"}; case "en": return new String[]{"January","February","March","April","May","June", "July","August","September","October","November","December"}; case "jp": // Japoncada yaygın kullanım: 1月, 2月, ... 12月 return new String[]{"1月","2月","3月","4月","5月","6月", "7月","8月","9月","10月","11月","12月"}; case "mg": // Malagasy ay adları return new String[]{"Janoary","Febroary","Martsa","Aprily","Mey","Jona", "Jolay","Aogositra","Septambra","Oktobra","Novambra","Desambra"}; default: return monthsFor("en"); } } }