本文整理了Java中javax.swing.JComboBox.hasFocus()
方法的一些代码示例,展示了JComboBox.hasFocus()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JComboBox.hasFocus()
方法的具体详情如下:
包路径:javax.swing.JComboBox
类名称:JComboBox
方法名:hasFocus
暂无
代码示例来源:origin: omegat-org/omegat
private JComboBox<String> getActiveField() {
return form.m_replaceField.hasFocus() ? form.m_replaceField : form.m_searchField;
}
代码示例来源:origin: pentaho/pentaho-reporting
/**
* Return the component that should be added to the tree hierarchy for this editor
*/
public Component getEditorComponent() {
final Component listCellRendererComponent = renderer.getListCellRendererComponent
( new JList(), comboBox.getSelectedItem(), comboBox.getSelectedIndex(), false, comboBox.hasFocus() );
if ( listCellRendererComponent instanceof JComponent ) {
final JComponent jc = (JComponent) listCellRendererComponent;
jc.setBorder( new LineBorder( Color.BLACK ) );
}
return listCellRendererComponent;
}
代码示例来源:origin: com.github.arnabk/pgslookandfeel
public void paint(Graphics g, JComponent c) {
hasFocus = comboBox.hasFocus();
if (comboBox.isEditable()) {
Color old = g.getColor();
g.setColor(UIManager.getColor("TextField.background"));
g.fillRect(0, 0, c.getWidth()+1, c.getHeight()+1);
g.setColor(old);
} else {
Rectangle r = rectangleForCurrentValue();
paintCurrentValueBackground(g, r, hasFocus);
paintCurrentValue(g, r, hasFocus);
}
}
代码示例来源:origin: de.dfki.mary/marytts-client
private void verifyEnableButtons() {
if (((MaryClient.DataType) cbOutputType.getSelectedItem()).isTextType()) {
buttonPanel.setVisible(true);
if (!cbOutputType.hasFocus())
bProcess.requestFocusInWindow();
} else { // do not show these three buttons for audio output:
buttonPanel.setVisible(false);
if (!cbOutputType.hasFocus())
bPlay.requestFocusInWindow();
代码示例来源:origin: khuxtable/seaglass
protected void paint(SeaGlassContext context, Graphics g) {
hasFocus = comboBox.hasFocus();
if (!comboBox.isEditable()) {
Rectangle r = rectangleForCurrentValue();
paintCurrentValue(g, r, hasFocus);
}
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf
public void paint(Graphics g, JComponent c)
{
hasFocus= comboBox.hasFocus();
if (!comboBox.isEditable())
{
Rectangle r= rectangleForCurrentValue();
paintCurrentValueBackground(g, r, hasFocus);
paintCurrentValue(g, r, hasFocus);
}
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/skinlf
/**
* Description of the Method
*
* @param g Description of Parameter
* @param c Description of Parameter
*/
public void paint(Graphics g, JComponent c) {
hasFocus = comboBox.hasFocus();
Rectangle r = rectangleForCurrentValue();
skin.getPersonality().paintComboBox(g, comboBox, r, hasFocus, rollover);
if (!comboBox.isEditable() || editor == null || !editor.isVisible()) {
paintCurrentValue(g, r, false);
}
}
代码示例来源:origin: org.java.net.substance/substance
hasFocus = comboBox.hasFocus();
if (!comboBox.isEditable()) {
Rectangle r = rectangleForCurrentValue();
代码示例来源:origin: com.github.insubstantial/substance
hasFocus = comboBox.hasFocus();
if (!comboBox.isEditable()) {
Rectangle r = rectangleForCurrentValue();
内容来源于网络,如有侵权,请联系作者删除!