Here you can find the source of fixComboOrientation(JComboBox combo)
Parameter | Description |
---|---|
combo | The combo box. |
public static void fixComboOrientation(JComboBox combo)
//package com.java2s; /*/*from w ww . java 2 s . co m*/ * 09/08/2005 * * UIUtil.java - Utility methods for org.fife.rsta.ui classes. * This library is distributed under a modified BSD license. See the included * RSTAUI.License.txt file for details. */ import java.awt.Component; import java.awt.ComponentOrientation; import java.util.Locale; import javax.swing.JComboBox; import javax.swing.ListCellRenderer; public class Main { /** * Fixes the orientation of the renderer of a combo box. I can't believe * Swing standard LaFs don't handle this on their own. * * @param combo The combo box. */ public static void fixComboOrientation(JComboBox combo) { ListCellRenderer r = combo.getRenderer(); if (r instanceof Component) { ComponentOrientation o = ComponentOrientation.getOrientation(Locale.getDefault()); ((Component) r).setComponentOrientation(o); } } }