Java 类javax.swing.plaf.metal.MetalComboBoxUI 实例源码
项目:openjdk-jdk10
文件:bug6632953.java
public static void main(String... args) throws Exception {
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
for (UIManager.LookAndFeelInfo lafInfo
: UIManager.getInstalledLookAndFeels()) {
try {
UIManager.setLookAndFeel(lafInfo.getClassName());
} catch (Exception e) {
throw new RuntimeException(e);
}
MetalComboBoxUI ui = new MetalComboBoxUI();
ui.installUI(new JComboBox());
ui.getBaseline(new JComboBox(), 0, 0);
ui.getBaseline(new JComboBox(), 1, 1);
ui.getBaseline(new JComboBox(), 2, 2);
ui.getBaseline(new JComboBox(), 3, 3);
ui.getBaseline(new JComboBox(), 4, 4);
}
}
});
}
项目:openjdk9
文件:bug6632953.java
public static void main(String... args) throws Exception {
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
for (UIManager.LookAndFeelInfo lafInfo
: UIManager.getInstalledLookAndFeels()) {
try {
UIManager.setLookAndFeel(lafInfo.getClassName());
} catch (Exception e) {
throw new RuntimeException(e);
}
MetalComboBoxUI ui = new MetalComboBoxUI();
ui.installUI(new JComboBox());
ui.getBaseline(new JComboBox(), 0, 0);
ui.getBaseline(new JComboBox(), 1, 1);
ui.getBaseline(new JComboBox(), 2, 2);
ui.getBaseline(new JComboBox(), 3, 3);
ui.getBaseline(new JComboBox(), 4, 4);
}
}
});
}
项目:jdk8u-jdk
文件:bug6632953.java
public static void main(String... args) throws Exception {
MetalComboBoxUI ui = new MetalComboBoxUI();
ui.installUI(new JComboBox());
ui.getBaseline(new JComboBox(), 0, 0);
ui.getBaseline(new JComboBox(), 1, 1);
ui.getBaseline(new JComboBox(), 2, 2);
ui.getBaseline(new JComboBox(), 3, 3);
ui.getBaseline(new JComboBox(), 4, 4);
}
项目:sbc-qsystem
文件:JTreeComboBox.java
@Override
public void updateUI() {
ComboBoxUI cui = (ComboBoxUI) UIManager.getUI(this);
if (cui instanceof MetalComboBoxUI) {
cui = new MetalTreeComboBoxUI();
} else if (cui instanceof MotifComboBoxUI) {
cui = new MotifTreeComboBoxUI();
} else if (cui instanceof WindowsComboBoxUI) {
cui = new WindowsTreeComboBoxUI();
}
setUI(cui);
}
项目:jdk8u_jdk
文件:bug6632953.java
public static void main(String... args) throws Exception {
MetalComboBoxUI ui = new MetalComboBoxUI();
ui.installUI(new JComboBox());
ui.getBaseline(new JComboBox(), 0, 0);
ui.getBaseline(new JComboBox(), 1, 1);
ui.getBaseline(new JComboBox(), 2, 2);
ui.getBaseline(new JComboBox(), 3, 3);
ui.getBaseline(new JComboBox(), 4, 4);
}
项目:lookaside_java-1.8.0-openjdk
文件:bug6632953.java
public static void main(String... args) throws Exception {
MetalComboBoxUI ui = new MetalComboBoxUI();
ui.installUI(new JComboBox());
ui.getBaseline(new JComboBox(), 0, 0);
ui.getBaseline(new JComboBox(), 1, 1);
ui.getBaseline(new JComboBox(), 2, 2);
ui.getBaseline(new JComboBox(), 3, 3);
ui.getBaseline(new JComboBox(), 4, 4);
}
项目:ezrlc
文件:ImageComboBox.java
/**
* Create new image combo box
*
* @param parent
* newmodelwindow pare t
* @param imagesName
* names of the imates
* @param imagesText
* texts of the imates
*/
public ImageComboBox(NewModelWindow parent, String[] imagesName, String[] imagesText) {
super(new BorderLayout());
this.parent = parent;
// Load images
images = new ImageIcon[imagesName.length];
Integer[] intArray = new Integer[imagesName.length];
for (int i = 0; i < imagesName.length; i++) {
intArray[i] = new Integer(i);
images[i] = UIUtil.loadResourceIcon(imagesName[i]);
if (images[i] != null) {
images[i].setDescription(imagesText[i]);
}
}
// create JComboBox
list = new JComboBox<Integer>(intArray);
Color bg = (Color) UIManager.get("ComboBox.background");
Color fg = (Color) UIManager.get("ComboBox.foreground");
UIManager.put("ComboBox.selectionBackground", bg);
UIManager.put("ComboBox.selectionForeground", fg);
list.setUI(new MetalComboBoxUI());
list.setBackground(Color.WHITE);
ComboBoxRenderer renderer = new ComboBoxRenderer(images, imagesText);
renderer.setPreferredSize(new Dimension(200, 150));
list.setRenderer(renderer);
list.setMaximumRowCount(3);
list.addActionListener(this);
// Lay out the demo.
add(list, BorderLayout.PAGE_START);
setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
}
项目:WorldGrower
文件:JComboBoxFactory.java
private static<T> void setComboBoxProperties(JComboBox<T> comboBox, ImageInfoReader imageInfoReader) {
comboBox.setOpaque(false);
comboBox.setBackground(ColorPalette.FOREGROUND_COLOR);
comboBox.setForeground(ColorPalette.FOREGROUND_COLOR);
comboBox.setFont(Fonts.FONT);
comboBox.setUI(new MetalComboBoxUI() {
@Override
protected ComboPopup createPopup() {
return new TiledImageComboPopup( comboBox, imageInfoReader );
}
});
}
项目:infobip-open-jdk-8
文件:bug6632953.java
public static void main(String... args) throws Exception {
MetalComboBoxUI ui = new MetalComboBoxUI();
ui.installUI(new JComboBox());
ui.getBaseline(new JComboBox(), 0, 0);
ui.getBaseline(new JComboBox(), 1, 1);
ui.getBaseline(new JComboBox(), 2, 2);
ui.getBaseline(new JComboBox(), 3, 3);
ui.getBaseline(new JComboBox(), 4, 4);
}
项目:jdk8u-dev-jdk
文件:bug6632953.java
public static void main(String... args) throws Exception {
MetalComboBoxUI ui = new MetalComboBoxUI();
ui.installUI(new JComboBox());
ui.getBaseline(new JComboBox(), 0, 0);
ui.getBaseline(new JComboBox(), 1, 1);
ui.getBaseline(new JComboBox(), 2, 2);
ui.getBaseline(new JComboBox(), 3, 3);
ui.getBaseline(new JComboBox(), 4, 4);
}
项目:jdk7-jdk
文件:bug6632953.java
public static void main(String... args) throws Exception {
MetalComboBoxUI ui = new MetalComboBoxUI();
ui.installUI(new JComboBox());
ui.getBaseline(new JComboBox(), 0, 0);
ui.getBaseline(new JComboBox(), 1, 1);
ui.getBaseline(new JComboBox(), 2, 2);
ui.getBaseline(new JComboBox(), 3, 3);
ui.getBaseline(new JComboBox(), 4, 4);
}
项目:openjdk-source-code-learn
文件:bug6632953.java
public static void main(String... args) throws Exception {
MetalComboBoxUI ui = new MetalComboBoxUI();
ui.installUI(new JComboBox());
ui.getBaseline(new JComboBox(), 0, 0);
ui.getBaseline(new JComboBox(), 1, 1);
ui.getBaseline(new JComboBox(), 2, 2);
ui.getBaseline(new JComboBox(), 3, 3);
ui.getBaseline(new JComboBox(), 4, 4);
}
项目:OLD-OpenJDK8
文件:bug6632953.java
public static void main(String... args) throws Exception {
MetalComboBoxUI ui = new MetalComboBoxUI();
ui.installUI(new JComboBox());
ui.getBaseline(new JComboBox(), 0, 0);
ui.getBaseline(new JComboBox(), 1, 1);
ui.getBaseline(new JComboBox(), 2, 2);
ui.getBaseline(new JComboBox(), 3, 3);
ui.getBaseline(new JComboBox(), 4, 4);
}
项目:JAVA_UNIT
文件:bug6632953.java
public static void main(String... args) throws Exception {
MetalComboBoxUI ui = new MetalComboBoxUI();
ui.installUI(new JComboBox());
ui.getBaseline(new JComboBox(), 0, 0);
ui.getBaseline(new JComboBox(), 1, 1);
ui.getBaseline(new JComboBox(), 2, 2);
ui.getBaseline(new JComboBox(), 3, 3);
ui.getBaseline(new JComboBox(), 4, 4);
}
项目:openjdk-jdk7u-jdk
文件:bug6632953.java
public static void main(String... args) throws Exception {
MetalComboBoxUI ui = new MetalComboBoxUI();
ui.installUI(new JComboBox());
ui.getBaseline(new JComboBox(), 0, 0);
ui.getBaseline(new JComboBox(), 1, 1);
ui.getBaseline(new JComboBox(), 2, 2);
ui.getBaseline(new JComboBox(), 3, 3);
ui.getBaseline(new JComboBox(), 4, 4);
}
项目:openjdk-icedtea7
文件:bug6632953.java
public static void main(String... args) throws Exception {
MetalComboBoxUI ui = new MetalComboBoxUI();
ui.installUI(new JComboBox());
ui.getBaseline(new JComboBox(), 0, 0);
ui.getBaseline(new JComboBox(), 1, 1);
ui.getBaseline(new JComboBox(), 2, 2);
ui.getBaseline(new JComboBox(), 3, 3);
ui.getBaseline(new JComboBox(), 4, 4);
}