import java.awt.Component;
import java.awt.ComponentOrientation;
import javax.swing.DefaultListCellRenderer;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JList;
public class Main extends JFrame {
public Main() {
JComboBox comboBox = new JComboBox();
comboBox.setRenderer(new MyListCellRenderer());
comboBox.addItem("Hi");
comboBox.addItem("Hello");
comboBox.addItem("How are you?");
getContentPane().add(comboBox, "North");
setSize(400, 300);
setDefaultCloseOperation(EXIT_ON_CLOSE);
}
public static void main(String[] args) {
new Main().setVisible(true);
}
}
class MyListCellRenderer extends DefaultListCellRenderer {
@Override
public Component getListCe