本文整理了Java中javax.swing.text.JTextComponent.setSelectionColor()
方法的一些代码示例,展示了JTextComponent.setSelectionColor()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextComponent.setSelectionColor()
方法的具体详情如下:
包路径:javax.swing.text.JTextComponent
类名称:JTextComponent
方法名:setSelectionColor
暂无
代码示例来源:origin: stackoverflow.com
+ "Blabla\nBlabla\nBlabla\nBlabla\nBlabla\nBlabla\nBlabla\n"
+ "Blabla\nBlabla\nBlabla\nBlabla\nBlabla\nBlabla\n");
textArea.setSelectionColor(Color.RED);
frame.add(pane);
frame.setSize(300, 120);
代码示例来源:origin: bobbylight/RSyntaxTextArea
editor.setSelectionColor(c);
代码示例来源:origin: stackoverflow.com
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextField;
public class RunnableTest{
public static void main(String args[]){
JFrame frame = new JFrame("frame");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel panel = new JPanel();
JTextField textfield = new JTextField();
textfield.setPreferredSize(new Dimension(400,30));
textfield.setForeground(Color.black);
textfield.setBackground(Color.black);
textfield.setSelectedTextColor(Color.black);
textfield.setSelectionColor(Color.black);
frame.getContentPane().add(panel);
panel.add(textfield);
frame.pack();
frame.setVisible(true);
}
}
代码示例来源:origin: stackoverflow.com
+ "Blabla\nBlabla\nBlabla\nBlabla\nBlabla\nBlabla\nBlabla\n"
+ "Blabla\nBlabla\nBlabla\nBlabla\nBlabla\nBlabla\n");
textArea.setSelectionColor(Color.RED);
frame.add(pane);
frame.setSize(300, 120);
代码示例来源:origin: jsettlers/settlers-remake
/**
* Install the border
*
* @param txt
* Text component
*/
public static void installUi(JTextComponent txt) {
txt.setOpaque(false);
Insets margin = txt.getMargin();
if (margin == null) {
margin = new Insets(5, 5, 5, 5);
}
Border marginBorder = BorderFactory.createEmptyBorder(margin.top + 3, margin.left, margin.bottom + 3, margin.right);
CompoundBorder border = new CompoundBorder(BorderFactory.createLineBorder(Color.WHITE), marginBorder);
txt.setBorder(border);
txt.setBackground(Color.BLUE);
txt.setForeground(Color.WHITE);
txt.setSelectionColor(SELECTION_COLOR);
}
代码示例来源:origin: stackoverflow.com
System.out.println(hl.getDrawsLayeredHighlights());
hl.setDrawsLayeredHighlights(false);
textArea.setSelectionColor(Color.RED);
textArea.setSelectedTextColor(Color.WHITE);
try (Reader reader = new BufferedReader(new InputStreamReader(
代码示例来源:origin: atarw/material-ui-swing
private void installMyDefaults() {
this.activeBackground = UIManager.getColor("TextField.selectionBackground");
this.activeForeground = UIManager.getColor("TextField.selectionForeground");
this.inactiveBackground = UIManager.getColor("TextField.inactiveBackground");
this.inactiveForeground = UIManager.getColor("TextField.inactiveForeground");
getComponent().setFont(MaterialFonts.REGULAR);
getComponent().setSelectionColor(getComponent().hasFocus() && getComponent().isEnabled() ? activeBackground : inactiveBackground);
getComponent().setSelectedTextColor(getComponent().hasFocus() && getComponent().isEnabled() ? activeForeground : inactiveForeground);
getComponent().setForeground(getComponent().hasFocus() && getComponent().isEnabled() ? activeForeground : inactiveForeground);
getComponent().setBorder(BorderFactory.createEmptyBorder(3, 5, 2,5));
}
@Override
代码示例来源:origin: stackoverflow.com
frame.setVisible(true);
edit.setSelectionColor( Color.GREEN );
代码示例来源:origin: com.fifesoft/rsyntaxtextarea
editor.setSelectionColor(c);
代码示例来源:origin: org.nuiton.thirdparty/rsyntaxtextarea
editor.setSelectionColor(c);
代码示例来源:origin: org.codehaus.jtstand/jtstand-editor
editor.setSelectionColor(c);
代码示例来源:origin: stackoverflow.com
setLineWrap(true);
setWrapStyleWord(true);
setSelectionColor(Color.GREEN);
setText((String)value);
setSize(table.getColumnModel().getColumn(column).getWidth(),this.getPreferredSize().height);
setSelectionColor(Color.GREEN);
代码示例来源:origin: org.swinglabs.swingx/swingx-all
promptComponent.setSelectionColor(txt.getSelectionColor());
promptComponent.setEditable(txt.isEditable());
promptComponent.setMargin(txt.getMargin());
代码示例来源:origin: com.haulmont.thirdparty/swingx-core
promptComponent.setSelectionColor(txt.getSelectionColor());
promptComponent.setEditable(txt.isEditable());
promptComponent.setMargin(txt.getMargin());
代码示例来源:origin: org.swinglabs.swingx/swingx-core
promptComponent.setSelectionColor(txt.getSelectionColor());
promptComponent.setEditable(txt.isEditable());
promptComponent.setMargin(txt.getMargin());
代码示例来源:origin: org.bidib.jbidib.swinglabs.swingx/swingx-core
promptComponent.setSelectionColor(txt.getSelectionColor());
promptComponent.setEditable(txt.isEditable());
promptComponent.setMargin(txt.getMargin());
代码示例来源:origin: org.xworker/xworker_core
comp.setSelectionColor(selectionColor);
代码示例来源:origin: khuxtable/seaglass
c.setSelectionColor(style.getColor(context, ColorType.TEXT_BACKGROUND));
代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw
editor.setSelectionColor(plaf.getColor(prefix + ".selectionBackground"));
代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw
editor.setSelectionColor(plaf.getColor(prefix + ".selectionBackground"));
内容来源于网络,如有侵权,请联系作者删除!