1 19 20 package org.lucane.applications.calendar.gui; 21 22 import java.awt.Component ; 23 24 import javax.swing.DefaultListCellRenderer ; 25 import javax.swing.JLabel ; 26 import javax.swing.JList ; 27 28 import org.lucane.client.Plugin; 29 30 public class TranslatedRenderer extends DefaultListCellRenderer 31 { 32 private Plugin plugin; 33 34 public TranslatedRenderer(Plugin plugin) 35 { 36 this.plugin = plugin; 37 } 38 39 public Component getListCellRendererComponent(JList list, Object value, 40 int index, boolean isSelected, boolean cellHasFocus) 41 { 42 Component c = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); 43 JLabel label = (JLabel )c; 44 label.setText(plugin.tr(label.getText())); 45 return label; 46 } 47 } | Popular Tags |