Java Code Examples for javax.swing.JTextArea#addFocusListener()

The following examples show how to use javax.swing.JTextArea#addFocusListener() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XTextAreaPeer.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
AWTTextPane(JTextArea jt, XWindow xwin, Container parent) {
    super(jt);
    this.xwin = xwin;
    setDoubleBuffered(true);
    jt.addFocusListener(this);
    AWTAccessor.getComponentAccessor().setParent(this,parent);
    setViewportBorder(new BevelBorder(false,SystemColor.controlDkShadow,SystemColor.controlLtHighlight) );
    this.jtext = jt;
    setFocusable(false);
    addNotify();
}
 
Example 2
Source File: XTextAreaPeer.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
AWTTextPane(JTextArea jt, XWindow xwin, Container parent) {
    super(jt);
    this.xwin = xwin;
    setDoubleBuffered(true);
    jt.addFocusListener(this);
    AWTAccessor.getComponentAccessor().setParent(this,parent);
    setViewportBorder(new BevelBorder(false,SystemColor.controlDkShadow,SystemColor.controlLtHighlight) );
    this.jtext = jt;
    setFocusable(false);
    addNotify();
}
 
Example 3
Source File: XTextAreaPeer.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
AWTTextPane(JTextArea jt, XWindow xwin, Container parent) {
    super(jt);
    this.xwin = xwin;
    setDoubleBuffered(true);
    jt.addFocusListener(this);
    AWTAccessor.getComponentAccessor().setParent(this,parent);
    setViewportBorder(new BevelBorder(false,SystemColor.controlDkShadow,SystemColor.controlLtHighlight) );
    this.jtext = jt;
    setFocusable(false);
    addNotify();
}
 
Example 4
Source File: Query.java    From OpenDA with GNU Lesser General Public License v3.0 5 votes vote down vote up
public void addTextArea(
        String name,
        String label,
        String theValue,
        Color background) {
    JLabel lbl = new JLabel(label + ": ");
    lbl.setBackground(_background);
    JTextArea textArea = new JTextArea(theValue, _height, _width);
    textArea.setEditable(true);
    textArea.setBackground(background);
    QueryScrollPane textPane = new QueryScrollPane(textArea);
    _addPair(name, lbl, textPane, textPane);
    textArea.addFocusListener(new QueryFocusListener(name));
}
 
Example 5
Source File: XTextAreaPeer.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
AWTTextPane(JTextArea jt, XWindow xwin, Container parent) {
    super(jt);
    this.xwin = xwin;
    setDoubleBuffered(true);
    jt.addFocusListener(this);
    AWTAccessor.getComponentAccessor().setParent(this,parent);
    setViewportBorder(new BevelBorder(false,SystemColor.controlDkShadow,SystemColor.controlLtHighlight) );
    this.jtext = jt;
    setFocusable(false);
    addNotify();
}
 
Example 6
Source File: XTextAreaPeer.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
AWTTextPane(JTextArea jt, XWindow xwin, Container parent) {
    super(jt);
    this.xwin = xwin;
    setDoubleBuffered(true);
    jt.addFocusListener(this);
    AWTAccessor.getComponentAccessor().setParent(this,parent);
    setViewportBorder(new BevelBorder(false,SystemColor.controlDkShadow,SystemColor.controlLtHighlight) );
    this.jtext = jt;
    setFocusable(false);
    addNotify();
}
 
Example 7
Source File: XTextAreaPeer.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
AWTTextPane(JTextArea jt, XWindow xwin, Container parent) {
    super(jt);
    this.xwin = xwin;
    setDoubleBuffered(true);
    jt.addFocusListener(this);
    AWTAccessor.getComponentAccessor().setParent(this,parent);
    setViewportBorder(new BevelBorder(false,SystemColor.controlDkShadow,SystemColor.controlLtHighlight) );
    this.jtext = jt;
    setFocusable(false);
    addNotify();
}
 
Example 8
Source File: XTextAreaPeer.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
AWTTextPane(JTextArea jt, XWindow xwin, Container parent) {
    super(jt);
    this.xwin = xwin;
    setDoubleBuffered(true);
    jt.addFocusListener(this);
    AWTAccessor.getComponentAccessor().setParent(this,parent);
    setViewportBorder(new BevelBorder(false,SystemColor.controlDkShadow,SystemColor.controlLtHighlight) );
    this.jtext = jt;
    setFocusable(false);
    addNotify();
}
 
Example 9
Source File: XTextAreaPeer.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
AWTTextPane(JTextArea jt, XWindow xwin, Container parent) {
    super(jt);
    this.xwin = xwin;
    setDoubleBuffered(true);
    jt.addFocusListener(this);
    AWTAccessor.getComponentAccessor().setParent(this,parent);
    setViewportBorder(new BevelBorder(false,SystemColor.controlDkShadow,SystemColor.controlLtHighlight) );
    this.jtext = jt;
    setFocusable(false);
    addNotify();
}
 
Example 10
Source File: XTextAreaPeer.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
AWTTextPane(JTextArea jt, XWindow xwin, Container parent) {
    super(jt);
    this.xwin = xwin;
    setDoubleBuffered(true);
    jt.addFocusListener(this);
    AWTAccessor.getComponentAccessor().setParent(this,parent);
    setViewportBorder(new BevelBorder(false,SystemColor.controlDkShadow,SystemColor.controlLtHighlight) );
    this.jtext = jt;
    setFocusable(false);
    addNotify();
}
 
Example 11
Source File: XTextAreaPeer.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
AWTTextPane(JTextArea jt, XWindow xwin, Container parent) {
    super(jt);
    this.xwin = xwin;
    setDoubleBuffered(true);
    jt.addFocusListener(this);
    AWTAccessor.getComponentAccessor().setParent(this,parent);
    setViewportBorder(new BevelBorder(false,SystemColor.controlDkShadow,SystemColor.controlLtHighlight) );
    this.jtext = jt;
    setFocusable(false);
    addNotify();
}
 
Example 12
Source File: XTextAreaPeer.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
AWTTextPane(JTextArea jt, XWindow xwin, Container parent) {
    super(jt);
    this.xwin = xwin;
    setDoubleBuffered(true);
    jt.addFocusListener(this);
    AWTAccessor.getComponentAccessor().setParent(this,parent);
    setViewportBorder(new BevelBorder(false,SystemColor.controlDkShadow,SystemColor.controlLtHighlight) );
    this.jtext = jt;
    setFocusable(false);
    addNotify();
}
 
Example 13
Source File: XTextAreaPeer.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
AWTTextPane(JTextArea jt, XWindow xwin, Container parent) {
    super(jt);
    this.xwin = xwin;
    setDoubleBuffered(true);
    jt.addFocusListener(this);
    AWTAccessor.getComponentAccessor().setParent(this,parent);
    setViewportBorder(new BevelBorder(false,SystemColor.controlDkShadow,SystemColor.controlLtHighlight) );
    this.jtext = jt;
    setFocusable(false);
    addNotify();
}
 
Example 14
Source File: XTextAreaPeer.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
AWTTextPane(JTextArea jt, XWindow xwin, Container parent) {
    super(jt);
    this.xwin = xwin;
    setDoubleBuffered(true);
    jt.addFocusListener(this);
    AWTAccessor.getComponentAccessor().setParent(this,parent);
    setViewportBorder(new BevelBorder(false,SystemColor.controlDkShadow,SystemColor.controlLtHighlight) );
    this.jtext = jt;
    setFocusable(false);
    addNotify();
}
 
Example 15
Source File: Query.java    From opt4j with MIT License 3 votes vote down vote up
/**
 * Create a text area with the specified height and width (in characters).
 * 
 * @param name
 *            The name used to identify the entry (when calling get).
 * @param label
 *            The label to attach to the entry.
 * @param theValue
 *            The value of this text area.
 * @param background
 *            The background color.
 * @param foreground
 *            The foreground color.
 * @param height
 *            The height.
 * @param width
 *            The width.
 */
public void addTextArea(String name, String label, String theValue, Color background, Color foreground, int height,
		int width) {
	JLabel lbl = new JLabel(label + ": ");
	lbl.setBackground(_background);

	JTextArea textArea = new JTextArea(theValue, height, width);
	textArea.setEditable(true);
	textArea.setBackground(background);
	textArea.setForeground(foreground);

	QueryScrollPane textPane = new QueryScrollPane(textArea);
	_addPair(name, lbl, textPane, textPane);
	textArea.addFocusListener(new QueryFocusListener(name));
}