javax.swing.JTextField#setCaretColor ( )源码实例Demo

下面列出了javax.swing.JTextField#setCaretColor ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: nanoleaf-desktop   文件: SingleEntryDialog.java
public SingleEntryDialog(Component parent, String entryLabel,
		String buttonLabel, ActionListener buttonListener)
{
	super();
	
	entry = new JTextField(entryLabel);
	entry.setForeground(Color.WHITE);
	entry.setBackground(Color.DARK_GRAY);
	entry.setBorder(new LineBorder(Color.GRAY));
	entry.setCaretColor(Color.WHITE);
	entry.setFont(new Font("Tahoma", Font.PLAIN, 22));
	entry.addFocusListener(new TextFieldFocusListener(entry));
	contentPanel.add(entry, "cell 0 1, grow, gapx 2 2");
	
	JButton btnConfirm = new ModernButton(buttonLabel);
	btnConfirm.setFont(new Font("Tahoma", Font.PLAIN, 18));
	btnConfirm.addActionListener(buttonListener);
	contentPanel.add(btnConfirm, "cell 0 3, alignx center");
	
	JLabel spacer = new JLabel(" ");
	contentPanel.add(spacer, "cell 0 4");
	
	finalize(parent);
	
	btnConfirm.requestFocus();
}
 
源代码2 项目: jace   文件: EditableLabel.java
public static EditableLabel generateTextLabel(Object owner, String property, int width) {
    Object value = Utility.getProperty(owner, property);
    JLabel label = new JLabel(value != null ? value.toString() : null);
    JTextField editor = new JTextField("");
    editor.setCaretColor(UserInterface.Theme.foregroundEdit.color);
    editor.setBorder(new EmptyBorder(0, 0, 0, 0));
    label.setFont(UserInterface.EDITOR_FONT);
    editor.setFont(UserInterface.EDITOR_FONT);

    EditableLabel output = new EditableLabel(label, editor, width, owner, property);
    if (value == null || value.equals("")) {
        output.showBlankValue();
    }
    return output;
}
 
源代码3 项目: dragonwell8_jdk   文件: XTextFieldPeer.java
@Override
public void installUI(JComponent c) {
    super.installUI(c);

    jtf = (JTextField) c;

    JTextField editor = jtf;

    UIDefaults uidefaults = XToolkit.getUIDefaults();

    String prefix = getPropertyPrefix();
    Font f = editor.getFont();
    if ((f == null) || (f instanceof UIResource)) {
        editor.setFont(uidefaults.getFont(prefix + ".font"));
    }

    Color bg = editor.getBackground();
    if ((bg == null) || (bg instanceof UIResource)) {
        editor.setBackground(uidefaults.getColor(prefix + ".background"));
    }

    Color fg = editor.getForeground();
    if ((fg == null) || (fg instanceof UIResource)) {
        editor.setForeground(uidefaults.getColor(prefix + ".foreground"));
    }

    Color color = editor.getCaretColor();
    if ((color == null) || (color instanceof UIResource)) {
        editor.setCaretColor(uidefaults.getColor(prefix + ".caretForeground"));
    }

    Color s = editor.getSelectionColor();
    if ((s == null) || (s instanceof UIResource)) {
        editor.setSelectionColor(uidefaults.getColor(prefix + ".selectionBackground"));
    }

    Color sfg = editor.getSelectedTextColor();
    if ((sfg == null) || (sfg instanceof UIResource)) {
        editor.setSelectedTextColor(uidefaults.getColor(prefix + ".selectionForeground"));
    }

    Color dfg = editor.getDisabledTextColor();
    if ((dfg == null) || (dfg instanceof UIResource)) {
        editor.setDisabledTextColor(uidefaults.getColor(prefix + ".inactiveForeground"));
    }

    Border b = editor.getBorder();
    if ((b == null) || (b instanceof UIResource)) {
        editor.setBorder(uidefaults.getBorder(prefix + ".border"));
    }

    Insets margin = editor.getMargin();
    if (margin == null || margin instanceof UIResource) {
        editor.setMargin(uidefaults.getInsets(prefix + ".margin"));
    }
}
 
源代码4 项目: TencentKona-8   文件: XTextFieldPeer.java
@Override
public void installUI(JComponent c) {
    super.installUI(c);

    jtf = (JTextField) c;

    JTextField editor = jtf;

    UIDefaults uidefaults = XToolkit.getUIDefaults();

    String prefix = getPropertyPrefix();
    Font f = editor.getFont();
    if ((f == null) || (f instanceof UIResource)) {
        editor.setFont(uidefaults.getFont(prefix + ".font"));
    }

    Color bg = editor.getBackground();
    if ((bg == null) || (bg instanceof UIResource)) {
        editor.setBackground(uidefaults.getColor(prefix + ".background"));
    }

    Color fg = editor.getForeground();
    if ((fg == null) || (fg instanceof UIResource)) {
        editor.setForeground(uidefaults.getColor(prefix + ".foreground"));
    }

    Color color = editor.getCaretColor();
    if ((color == null) || (color instanceof UIResource)) {
        editor.setCaretColor(uidefaults.getColor(prefix + ".caretForeground"));
    }

    Color s = editor.getSelectionColor();
    if ((s == null) || (s instanceof UIResource)) {
        editor.setSelectionColor(uidefaults.getColor(prefix + ".selectionBackground"));
    }

    Color sfg = editor.getSelectedTextColor();
    if ((sfg == null) || (sfg instanceof UIResource)) {
        editor.setSelectedTextColor(uidefaults.getColor(prefix + ".selectionForeground"));
    }

    Color dfg = editor.getDisabledTextColor();
    if ((dfg == null) || (dfg instanceof UIResource)) {
        editor.setDisabledTextColor(uidefaults.getColor(prefix + ".inactiveForeground"));
    }

    Border b = editor.getBorder();
    if ((b == null) || (b instanceof UIResource)) {
        editor.setBorder(uidefaults.getBorder(prefix + ".border"));
    }

    Insets margin = editor.getMargin();
    if (margin == null || margin instanceof UIResource) {
        editor.setMargin(uidefaults.getInsets(prefix + ".margin"));
    }
}
 
源代码5 项目: xdm   文件: XDMFileSelectionPanel.java
private void initUI() {
	setBackground(ColorResource.getDarkestBgColor());
	txtFile = new JTextField();
	setBorder(new LineBorder(ColorResource.getSelectionColor(), 1));
	txtFile.setBackground(ColorResource.getDarkestBgColor());
	txtFile.setBorder(null);
	txtFile.setForeground(Color.WHITE);
	txtFile.setBounds(getScaledInt(77), getScaledInt(111), getScaledInt(241), getScaledInt(20));
	txtFile.setCaretColor(ColorResource.getSelectionColor());

	add(txtFile);
	Box hbox = Box.createHorizontalBox();

	btnBrowse = new CustomButton();
	btnBrowse.setBackground(ColorResource.getDarkestBgColor());
	btnBrowse.setIcon(ImageResource.getIcon("folder.png", 16, 16));
	btnBrowse.setMargin(new Insets(0, 0, 0, 0));
	btnBrowse.setContentAreaFilled(false);
	btnBrowse.setBorderPainted(false);
	btnBrowse.setFocusPainted(false);
	btnBrowse.setOpaque(false);
	btnBrowse.addActionListener(this);

	btnDropdown = new CustomButton();
	btnDropdown.setBackground(ColorResource.getDarkestBgColor());
	btnDropdown.setIcon(ImageResource.getIcon("down_white.png",16,16));
	btnDropdown.setMargin(new Insets(0, 0, 0, 0));
	btnDropdown.setContentAreaFilled(false);
	btnDropdown.setBorderPainted(false);
	btnDropdown.setFocusPainted(false);
	btnDropdown.addActionListener(this);

	hbox.add(btnBrowse);
	hbox.add(btnDropdown);

	add(hbox, BorderLayout.EAST);
	pop = new JPopupMenu();
	if (!StringUtils.isNullOrEmptyOrBlank(Config.getInstance().getLastFolder())) {
		pop.add(createMenuItem(Config.getInstance().getLastFolder()));
	}
	pop.add(createMenuItem(Config.getInstance().getDownloadFolder()));
	if (!Config.getInstance().isForceSingleFolder()) {
		pop.add(createMenuItem(Config.getInstance().getCategoryDocuments()));
		pop.add(createMenuItem(Config.getInstance().getCategoryMusic()));
		pop.add(createMenuItem(Config.getInstance().getCategoryPrograms()));
		pop.add(createMenuItem(Config.getInstance().getCategoryCompressed()));
		pop.add(createMenuItem(Config.getInstance().getCategoryVideos()));
	}
	pop.setInvoker(btnDropdown);
}
 
源代码6 项目: jdk8u60   文件: XTextFieldPeer.java
@Override
public void installUI(JComponent c) {
    super.installUI(c);

    jtf = (JTextField) c;

    JTextField editor = jtf;

    UIDefaults uidefaults = XToolkit.getUIDefaults();

    String prefix = getPropertyPrefix();
    Font f = editor.getFont();
    if ((f == null) || (f instanceof UIResource)) {
        editor.setFont(uidefaults.getFont(prefix + ".font"));
    }

    Color bg = editor.getBackground();
    if ((bg == null) || (bg instanceof UIResource)) {
        editor.setBackground(uidefaults.getColor(prefix + ".background"));
    }

    Color fg = editor.getForeground();
    if ((fg == null) || (fg instanceof UIResource)) {
        editor.setForeground(uidefaults.getColor(prefix + ".foreground"));
    }

    Color color = editor.getCaretColor();
    if ((color == null) || (color instanceof UIResource)) {
        editor.setCaretColor(uidefaults.getColor(prefix + ".caretForeground"));
    }

    Color s = editor.getSelectionColor();
    if ((s == null) || (s instanceof UIResource)) {
        editor.setSelectionColor(uidefaults.getColor(prefix + ".selectionBackground"));
    }

    Color sfg = editor.getSelectedTextColor();
    if ((sfg == null) || (sfg instanceof UIResource)) {
        editor.setSelectedTextColor(uidefaults.getColor(prefix + ".selectionForeground"));
    }

    Color dfg = editor.getDisabledTextColor();
    if ((dfg == null) || (dfg instanceof UIResource)) {
        editor.setDisabledTextColor(uidefaults.getColor(prefix + ".inactiveForeground"));
    }

    Border b = editor.getBorder();
    if ((b == null) || (b instanceof UIResource)) {
        editor.setBorder(uidefaults.getBorder(prefix + ".border"));
    }

    Insets margin = editor.getMargin();
    if (margin == null || margin instanceof UIResource) {
        editor.setMargin(uidefaults.getInsets(prefix + ".margin"));
    }
}
 
源代码7 项目: nanoleaf-desktop   文件: ColorEntry.java
private void initUI(Container contentPane)
{
	JPanel panel = new JPanel();
	panel.setBackground(Color.DARK_GRAY);
	contentPane.add(panel, "flowx, cell 0 1");
	panel.setLayout(new MigLayout("", "[]", "[][][]"));
	
	JLabel lblRgb = new JLabel("RGB");
	lblRgb.setForeground(Color.WHITE);
	lblRgb.setFont(new Font("Tahoma", Font.PLAIN, 20));
	panel.add(lblRgb, "flowx,cell 0 0");
	
	txtRgb = new JTextField();
	txtRgb.setFont(new Font("Tahoma", Font.PLAIN, 20));
	txtRgb.setForeground(Color.WHITE);
	txtRgb.setBackground(Color.DARK_GRAY);
	txtRgb.setText("128, 128, 128");
	txtRgb.setColumns(10);
	txtRgb.setCaretColor(Color.WHITE);
	txtRgb.addKeyListener(new EnterColorListener(EnterColorListener.RGB));
	panel.add(txtRgb, "cell 0 0,gapx 15 0");
	
	JLabel lblHsb = new JLabel("HSB");
	lblHsb.setForeground(Color.WHITE);
	lblHsb.setFont(new Font("Tahoma", Font.PLAIN, 20));
	panel.add(lblHsb, "flowx,cell 0 1");
	
	txtHsb = new JTextField();
	txtHsb.setText("0, 0, 50");
	txtHsb.setFont(new Font("Tahoma", Font.PLAIN, 20));
	txtHsb.setForeground(Color.WHITE);
	txtHsb.setBackground(Color.DARK_GRAY);
	txtHsb.setColumns(10);
	txtHsb.setCaretColor(Color.WHITE);
	txtHsb.addKeyListener(new EnterColorListener(EnterColorListener.HSB));
	panel.add(txtHsb, "cell 0 1,gapx 15 0,aligny top");
	
	JLabel lblHex = new JLabel("HEX");
	lblHex.setForeground(Color.WHITE);
	lblHex.setFont(new Font("Tahoma", Font.PLAIN, 20));
	panel.add(lblHex, "flowx,cell 0 2");
	
	txtHex = new JTextField();
	txtHex.setForeground(Color.WHITE);
	txtHex.setText("#808080");
	txtHex.setFont(new Font("Tahoma", Font.PLAIN, 20));
	txtHex.setBackground(Color.DARK_GRAY);
	txtHex.setColumns(10);
	txtHex.setCaretColor(Color.WHITE);
	txtHex.addKeyListener(new EnterColorListener(EnterColorListener.HEX));
	panel.add(txtHex, "cell 0 2,gapx 15 0");
}
 
源代码8 项目: openjdk-jdk8u   文件: XTextFieldPeer.java
@Override
public void installUI(JComponent c) {
    super.installUI(c);

    jtf = (JTextField) c;

    JTextField editor = jtf;

    UIDefaults uidefaults = XToolkit.getUIDefaults();

    String prefix = getPropertyPrefix();
    Font f = editor.getFont();
    if ((f == null) || (f instanceof UIResource)) {
        editor.setFont(uidefaults.getFont(prefix + ".font"));
    }

    Color bg = editor.getBackground();
    if ((bg == null) || (bg instanceof UIResource)) {
        editor.setBackground(uidefaults.getColor(prefix + ".background"));
    }

    Color fg = editor.getForeground();
    if ((fg == null) || (fg instanceof UIResource)) {
        editor.setForeground(uidefaults.getColor(prefix + ".foreground"));
    }

    Color color = editor.getCaretColor();
    if ((color == null) || (color instanceof UIResource)) {
        editor.setCaretColor(uidefaults.getColor(prefix + ".caretForeground"));
    }

    Color s = editor.getSelectionColor();
    if ((s == null) || (s instanceof UIResource)) {
        editor.setSelectionColor(uidefaults.getColor(prefix + ".selectionBackground"));
    }

    Color sfg = editor.getSelectedTextColor();
    if ((sfg == null) || (sfg instanceof UIResource)) {
        editor.setSelectedTextColor(uidefaults.getColor(prefix + ".selectionForeground"));
    }

    Color dfg = editor.getDisabledTextColor();
    if ((dfg == null) || (dfg instanceof UIResource)) {
        editor.setDisabledTextColor(uidefaults.getColor(prefix + ".inactiveForeground"));
    }

    Border b = editor.getBorder();
    if ((b == null) || (b instanceof UIResource)) {
        editor.setBorder(uidefaults.getBorder(prefix + ".border"));
    }

    Insets margin = editor.getMargin();
    if (margin == null || margin instanceof UIResource) {
        editor.setMargin(uidefaults.getInsets(prefix + ".margin"));
    }
}
 
源代码9 项目: openjdk-jdk8u-backup   文件: XTextFieldPeer.java
@Override
public void installUI(JComponent c) {
    super.installUI(c);

    jtf = (JTextField) c;

    JTextField editor = jtf;

    UIDefaults uidefaults = XToolkit.getUIDefaults();

    String prefix = getPropertyPrefix();
    Font f = editor.getFont();
    if ((f == null) || (f instanceof UIResource)) {
        editor.setFont(uidefaults.getFont(prefix + ".font"));
    }

    Color bg = editor.getBackground();
    if ((bg == null) || (bg instanceof UIResource)) {
        editor.setBackground(uidefaults.getColor(prefix + ".background"));
    }

    Color fg = editor.getForeground();
    if ((fg == null) || (fg instanceof UIResource)) {
        editor.setForeground(uidefaults.getColor(prefix + ".foreground"));
    }

    Color color = editor.getCaretColor();
    if ((color == null) || (color instanceof UIResource)) {
        editor.setCaretColor(uidefaults.getColor(prefix + ".caretForeground"));
    }

    Color s = editor.getSelectionColor();
    if ((s == null) || (s instanceof UIResource)) {
        editor.setSelectionColor(uidefaults.getColor(prefix + ".selectionBackground"));
    }

    Color sfg = editor.getSelectedTextColor();
    if ((sfg == null) || (sfg instanceof UIResource)) {
        editor.setSelectedTextColor(uidefaults.getColor(prefix + ".selectionForeground"));
    }

    Color dfg = editor.getDisabledTextColor();
    if ((dfg == null) || (dfg instanceof UIResource)) {
        editor.setDisabledTextColor(uidefaults.getColor(prefix + ".inactiveForeground"));
    }

    Border b = editor.getBorder();
    if ((b == null) || (b instanceof UIResource)) {
        editor.setBorder(uidefaults.getBorder(prefix + ".border"));
    }

    Insets margin = editor.getMargin();
    if (margin == null || margin instanceof UIResource) {
        editor.setMargin(uidefaults.getInsets(prefix + ".margin"));
    }
}
 
源代码10 项目: openjdk-jdk9   文件: XTextFieldPeer.java
@Override
public void installUI(JComponent c) {
    super.installUI(c);

    jtf = (JTextField) c;

    JTextField editor = jtf;

    UIDefaults uidefaults = XToolkit.getUIDefaults();

    String prefix = getPropertyPrefix();
    Font f = editor.getFont();
    if ((f == null) || (f instanceof UIResource)) {
        editor.setFont(uidefaults.getFont(prefix + ".font"));
    }

    Color bg = editor.getBackground();
    if ((bg == null) || (bg instanceof UIResource)) {
        editor.setBackground(uidefaults.getColor(prefix + ".background"));
    }

    Color fg = editor.getForeground();
    if ((fg == null) || (fg instanceof UIResource)) {
        editor.setForeground(uidefaults.getColor(prefix + ".foreground"));
    }

    Color color = editor.getCaretColor();
    if ((color == null) || (color instanceof UIResource)) {
        editor.setCaretColor(uidefaults.getColor(prefix + ".caretForeground"));
    }

    Color s = editor.getSelectionColor();
    if ((s == null) || (s instanceof UIResource)) {
        editor.setSelectionColor(uidefaults.getColor(prefix + ".selectionBackground"));
    }

    Color sfg = editor.getSelectedTextColor();
    if ((sfg == null) || (sfg instanceof UIResource)) {
        editor.setSelectedTextColor(uidefaults.getColor(prefix + ".selectionForeground"));
    }

    Color dfg = editor.getDisabledTextColor();
    if ((dfg == null) || (dfg instanceof UIResource)) {
        editor.setDisabledTextColor(uidefaults.getColor(prefix + ".inactiveForeground"));
    }

    Border b = editor.getBorder();
    if ((b == null) || (b instanceof UIResource)) {
        editor.setBorder(uidefaults.getBorder(prefix + ".border"));
    }

    Insets margin = editor.getMargin();
    if (margin == null || margin instanceof UIResource) {
        editor.setMargin(uidefaults.getInsets(prefix + ".margin"));
    }
}
 
源代码11 项目: jdk8u-jdk   文件: XTextFieldPeer.java
@Override
public void installUI(JComponent c) {
    super.installUI(c);

    jtf = (JTextField) c;

    JTextField editor = jtf;

    UIDefaults uidefaults = XToolkit.getUIDefaults();

    String prefix = getPropertyPrefix();
    Font f = editor.getFont();
    if ((f == null) || (f instanceof UIResource)) {
        editor.setFont(uidefaults.getFont(prefix + ".font"));
    }

    Color bg = editor.getBackground();
    if ((bg == null) || (bg instanceof UIResource)) {
        editor.setBackground(uidefaults.getColor(prefix + ".background"));
    }

    Color fg = editor.getForeground();
    if ((fg == null) || (fg instanceof UIResource)) {
        editor.setForeground(uidefaults.getColor(prefix + ".foreground"));
    }

    Color color = editor.getCaretColor();
    if ((color == null) || (color instanceof UIResource)) {
        editor.setCaretColor(uidefaults.getColor(prefix + ".caretForeground"));
    }

    Color s = editor.getSelectionColor();
    if ((s == null) || (s instanceof UIResource)) {
        editor.setSelectionColor(uidefaults.getColor(prefix + ".selectionBackground"));
    }

    Color sfg = editor.getSelectedTextColor();
    if ((sfg == null) || (sfg instanceof UIResource)) {
        editor.setSelectedTextColor(uidefaults.getColor(prefix + ".selectionForeground"));
    }

    Color dfg = editor.getDisabledTextColor();
    if ((dfg == null) || (dfg instanceof UIResource)) {
        editor.setDisabledTextColor(uidefaults.getColor(prefix + ".inactiveForeground"));
    }

    Border b = editor.getBorder();
    if ((b == null) || (b instanceof UIResource)) {
        editor.setBorder(uidefaults.getBorder(prefix + ".border"));
    }

    Insets margin = editor.getMargin();
    if (margin == null || margin instanceof UIResource) {
        editor.setMargin(uidefaults.getInsets(prefix + ".margin"));
    }
}
 
源代码12 项目: hottub   文件: XTextFieldPeer.java
@Override
public void installUI(JComponent c) {
    super.installUI(c);

    jtf = (JTextField) c;

    JTextField editor = jtf;

    UIDefaults uidefaults = XToolkit.getUIDefaults();

    String prefix = getPropertyPrefix();
    Font f = editor.getFont();
    if ((f == null) || (f instanceof UIResource)) {
        editor.setFont(uidefaults.getFont(prefix + ".font"));
    }

    Color bg = editor.getBackground();
    if ((bg == null) || (bg instanceof UIResource)) {
        editor.setBackground(uidefaults.getColor(prefix + ".background"));
    }

    Color fg = editor.getForeground();
    if ((fg == null) || (fg instanceof UIResource)) {
        editor.setForeground(uidefaults.getColor(prefix + ".foreground"));
    }

    Color color = editor.getCaretColor();
    if ((color == null) || (color instanceof UIResource)) {
        editor.setCaretColor(uidefaults.getColor(prefix + ".caretForeground"));
    }

    Color s = editor.getSelectionColor();
    if ((s == null) || (s instanceof UIResource)) {
        editor.setSelectionColor(uidefaults.getColor(prefix + ".selectionBackground"));
    }

    Color sfg = editor.getSelectedTextColor();
    if ((sfg == null) || (sfg instanceof UIResource)) {
        editor.setSelectedTextColor(uidefaults.getColor(prefix + ".selectionForeground"));
    }

    Color dfg = editor.getDisabledTextColor();
    if ((dfg == null) || (dfg instanceof UIResource)) {
        editor.setDisabledTextColor(uidefaults.getColor(prefix + ".inactiveForeground"));
    }

    Border b = editor.getBorder();
    if ((b == null) || (b instanceof UIResource)) {
        editor.setBorder(uidefaults.getBorder(prefix + ".border"));
    }

    Insets margin = editor.getMargin();
    if (margin == null || margin instanceof UIResource) {
        editor.setMargin(uidefaults.getInsets(prefix + ".margin"));
    }
}
 
源代码13 项目: openjdk-8-source   文件: XTextFieldPeer.java
@Override
public void installUI(JComponent c) {
    super.installUI(c);

    jtf = (JTextField) c;

    JTextField editor = jtf;

    UIDefaults uidefaults = XToolkit.getUIDefaults();

    String prefix = getPropertyPrefix();
    Font f = editor.getFont();
    if ((f == null) || (f instanceof UIResource)) {
        editor.setFont(uidefaults.getFont(prefix + ".font"));
    }

    Color bg = editor.getBackground();
    if ((bg == null) || (bg instanceof UIResource)) {
        editor.setBackground(uidefaults.getColor(prefix + ".background"));
    }

    Color fg = editor.getForeground();
    if ((fg == null) || (fg instanceof UIResource)) {
        editor.setForeground(uidefaults.getColor(prefix + ".foreground"));
    }

    Color color = editor.getCaretColor();
    if ((color == null) || (color instanceof UIResource)) {
        editor.setCaretColor(uidefaults.getColor(prefix + ".caretForeground"));
    }

    Color s = editor.getSelectionColor();
    if ((s == null) || (s instanceof UIResource)) {
        editor.setSelectionColor(uidefaults.getColor(prefix + ".selectionBackground"));
    }

    Color sfg = editor.getSelectedTextColor();
    if ((sfg == null) || (sfg instanceof UIResource)) {
        editor.setSelectedTextColor(uidefaults.getColor(prefix + ".selectionForeground"));
    }

    Color dfg = editor.getDisabledTextColor();
    if ((dfg == null) || (dfg instanceof UIResource)) {
        editor.setDisabledTextColor(uidefaults.getColor(prefix + ".inactiveForeground"));
    }

    Border b = editor.getBorder();
    if ((b == null) || (b instanceof UIResource)) {
        editor.setBorder(uidefaults.getBorder(prefix + ".border"));
    }

    Insets margin = editor.getMargin();
    if (margin == null || margin instanceof UIResource) {
        editor.setMargin(uidefaults.getInsets(prefix + ".margin"));
    }
}
 
源代码14 项目: openjdk-8   文件: XTextFieldPeer.java
@Override
public void installUI(JComponent c) {
    super.installUI(c);

    jtf = (JTextField) c;

    JTextField editor = jtf;

    UIDefaults uidefaults = XToolkit.getUIDefaults();

    String prefix = getPropertyPrefix();
    Font f = editor.getFont();
    if ((f == null) || (f instanceof UIResource)) {
        editor.setFont(uidefaults.getFont(prefix + ".font"));
    }

    Color bg = editor.getBackground();
    if ((bg == null) || (bg instanceof UIResource)) {
        editor.setBackground(uidefaults.getColor(prefix + ".background"));
    }

    Color fg = editor.getForeground();
    if ((fg == null) || (fg instanceof UIResource)) {
        editor.setForeground(uidefaults.getColor(prefix + ".foreground"));
    }

    Color color = editor.getCaretColor();
    if ((color == null) || (color instanceof UIResource)) {
        editor.setCaretColor(uidefaults.getColor(prefix + ".caretForeground"));
    }

    Color s = editor.getSelectionColor();
    if ((s == null) || (s instanceof UIResource)) {
        editor.setSelectionColor(uidefaults.getColor(prefix + ".selectionBackground"));
    }

    Color sfg = editor.getSelectedTextColor();
    if ((sfg == null) || (sfg instanceof UIResource)) {
        editor.setSelectedTextColor(uidefaults.getColor(prefix + ".selectionForeground"));
    }

    Color dfg = editor.getDisabledTextColor();
    if ((dfg == null) || (dfg instanceof UIResource)) {
        editor.setDisabledTextColor(uidefaults.getColor(prefix + ".inactiveForeground"));
    }

    Border b = editor.getBorder();
    if ((b == null) || (b instanceof UIResource)) {
        editor.setBorder(uidefaults.getBorder(prefix + ".border"));
    }

    Insets margin = editor.getMargin();
    if (margin == null || margin instanceof UIResource) {
        editor.setMargin(uidefaults.getInsets(prefix + ".margin"));
    }
}
 
源代码15 项目: jdk8u_jdk   文件: XTextFieldPeer.java
@Override
public void installUI(JComponent c) {
    super.installUI(c);

    jtf = (JTextField) c;

    JTextField editor = jtf;

    UIDefaults uidefaults = XToolkit.getUIDefaults();

    String prefix = getPropertyPrefix();
    Font f = editor.getFont();
    if ((f == null) || (f instanceof UIResource)) {
        editor.setFont(uidefaults.getFont(prefix + ".font"));
    }

    Color bg = editor.getBackground();
    if ((bg == null) || (bg instanceof UIResource)) {
        editor.setBackground(uidefaults.getColor(prefix + ".background"));
    }

    Color fg = editor.getForeground();
    if ((fg == null) || (fg instanceof UIResource)) {
        editor.setForeground(uidefaults.getColor(prefix + ".foreground"));
    }

    Color color = editor.getCaretColor();
    if ((color == null) || (color instanceof UIResource)) {
        editor.setCaretColor(uidefaults.getColor(prefix + ".caretForeground"));
    }

    Color s = editor.getSelectionColor();
    if ((s == null) || (s instanceof UIResource)) {
        editor.setSelectionColor(uidefaults.getColor(prefix + ".selectionBackground"));
    }

    Color sfg = editor.getSelectedTextColor();
    if ((sfg == null) || (sfg instanceof UIResource)) {
        editor.setSelectedTextColor(uidefaults.getColor(prefix + ".selectionForeground"));
    }

    Color dfg = editor.getDisabledTextColor();
    if ((dfg == null) || (dfg instanceof UIResource)) {
        editor.setDisabledTextColor(uidefaults.getColor(prefix + ".inactiveForeground"));
    }

    Border b = editor.getBorder();
    if ((b == null) || (b instanceof UIResource)) {
        editor.setBorder(uidefaults.getBorder(prefix + ".border"));
    }

    Insets margin = editor.getMargin();
    if (margin == null || margin instanceof UIResource) {
        editor.setMargin(uidefaults.getInsets(prefix + ".margin"));
    }
}
 
源代码16 项目: jdk8u-jdk   文件: XTextFieldPeer.java
@Override
public void installUI(JComponent c) {
    super.installUI(c);

    jtf = (JTextField) c;

    JTextField editor = jtf;

    UIDefaults uidefaults = XToolkit.getUIDefaults();

    String prefix = getPropertyPrefix();
    Font f = editor.getFont();
    if ((f == null) || (f instanceof UIResource)) {
        editor.setFont(uidefaults.getFont(prefix + ".font"));
    }

    Color bg = editor.getBackground();
    if ((bg == null) || (bg instanceof UIResource)) {
        editor.setBackground(uidefaults.getColor(prefix + ".background"));
    }

    Color fg = editor.getForeground();
    if ((fg == null) || (fg instanceof UIResource)) {
        editor.setForeground(uidefaults.getColor(prefix + ".foreground"));
    }

    Color color = editor.getCaretColor();
    if ((color == null) || (color instanceof UIResource)) {
        editor.setCaretColor(uidefaults.getColor(prefix + ".caretForeground"));
    }

    Color s = editor.getSelectionColor();
    if ((s == null) || (s instanceof UIResource)) {
        editor.setSelectionColor(uidefaults.getColor(prefix + ".selectionBackground"));
    }

    Color sfg = editor.getSelectedTextColor();
    if ((sfg == null) || (sfg instanceof UIResource)) {
        editor.setSelectedTextColor(uidefaults.getColor(prefix + ".selectionForeground"));
    }

    Color dfg = editor.getDisabledTextColor();
    if ((dfg == null) || (dfg instanceof UIResource)) {
        editor.setDisabledTextColor(uidefaults.getColor(prefix + ".inactiveForeground"));
    }

    Border b = editor.getBorder();
    if ((b == null) || (b instanceof UIResource)) {
        editor.setBorder(uidefaults.getBorder(prefix + ".border"));
    }

    Insets margin = editor.getMargin();
    if (margin == null || margin instanceof UIResource) {
        editor.setMargin(uidefaults.getInsets(prefix + ".margin"));
    }
}
 
源代码17 项目: jdk8u-dev-jdk   文件: XTextFieldPeer.java
@Override
public void installUI(JComponent c) {
    super.installUI(c);

    jtf = (JTextField) c;

    JTextField editor = jtf;

    UIDefaults uidefaults = XToolkit.getUIDefaults();

    String prefix = getPropertyPrefix();
    Font f = editor.getFont();
    if ((f == null) || (f instanceof UIResource)) {
        editor.setFont(uidefaults.getFont(prefix + ".font"));
    }

    Color bg = editor.getBackground();
    if ((bg == null) || (bg instanceof UIResource)) {
        editor.setBackground(uidefaults.getColor(prefix + ".background"));
    }

    Color fg = editor.getForeground();
    if ((fg == null) || (fg instanceof UIResource)) {
        editor.setForeground(uidefaults.getColor(prefix + ".foreground"));
    }

    Color color = editor.getCaretColor();
    if ((color == null) || (color instanceof UIResource)) {
        editor.setCaretColor(uidefaults.getColor(prefix + ".caretForeground"));
    }

    Color s = editor.getSelectionColor();
    if ((s == null) || (s instanceof UIResource)) {
        editor.setSelectionColor(uidefaults.getColor(prefix + ".selectionBackground"));
    }

    Color sfg = editor.getSelectedTextColor();
    if ((sfg == null) || (sfg instanceof UIResource)) {
        editor.setSelectedTextColor(uidefaults.getColor(prefix + ".selectionForeground"));
    }

    Color dfg = editor.getDisabledTextColor();
    if ((dfg == null) || (dfg instanceof UIResource)) {
        editor.setDisabledTextColor(uidefaults.getColor(prefix + ".inactiveForeground"));
    }

    Border b = editor.getBorder();
    if ((b == null) || (b instanceof UIResource)) {
        editor.setBorder(uidefaults.getBorder(prefix + ".border"));
    }

    Insets margin = editor.getMargin();
    if (margin == null || margin instanceof UIResource) {
        editor.setMargin(uidefaults.getInsets(prefix + ".margin"));
    }
}
 
源代码18 项目: osrsclient   文件: ChatMainPane.java
private void setup() {
    UIManager.put("Tree.rendererFillBackground", false);
    Border loweredbevel = BorderFactory.createEtchedBorder(EtchedBorder.RAISED);
    DefaultListModel<String> curChans = new DefaultListModel<>();
    messagewindow = new JTextArea();
    messagewindow.setLineWrap(true);
    inputfield = new JTextField();
    userlist = new JTextArea();
    chanlist = new JList(curChans);

    chanscroll = new JScrollPane(chanlist, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    messagescroll = new JScrollPane(messagewindow, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    userscroll = new JScrollPane(userlist, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);

    chanscroll.setBorder(loweredbevel);
    messagescroll.setBorder(loweredbevel);
    userscroll.setBorder(loweredbevel);
    inputfield.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.RAISED, new Color(51, 51, 51), new Color(51, 51, 51)));

    inputfield.setBackground(new Color(71, 71, 71));
    messagewindow.setBackground(new Color(71, 71, 71));
    userlist.setBackground(new Color(71, 71, 71));
    chanlist.setBackground(new Color(71, 71, 71));

    chanlist.setForeground(Color.white);
    messagewindow.setForeground(Color.white);
    messagewindow.setFont(ircFont);
    inputfield.setForeground(Color.white);
    messagewindow.setText("");

    messagewindow.setEditable(false);
    inputfield.setCaretColor(Color.black);

    chanlist.setForeground(Color.white);

    add(chanscroll, "cell 0 0, growx, growy, height 100%,width 15%, align left, spany, ");
    add(messagescroll, "growy, cell 1 0, width 68%, height 80%, align center, align left");
    add(userscroll, "grow y, cell 2 0, width 17%, height 80%, align left");
    add(inputfield, "growx, cell 1 1, spanx,  width 68%,height 20,align left");

    // messagescroll.setViewportView((messagewindow2));
}