Java Code Examples for sun.swing.SwingUtilities2#drawChars()
The following examples show how to use
sun.swing.SwingUtilities2#drawChars() .
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: PasswordView.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
private float drawEchoCharacterImpl(Graphics g, float x, float y, char c, boolean useFPAPI) { ONE[0] = c; SwingUtilities2.drawChars(Utilities.getJComponent(this), g, ONE, 0, 1, x, y); if (useFPAPI) { return x + g.getFontMetrics().charWidth(c); } else { FontRenderContext frc = g.getFontMetrics().getFontRenderContext(); return x + (float) g.getFont().getStringBounds(ONE, 0, 1, frc).getWidth(); } }
Example 2
Source File: PasswordView.java From Bytecoder with Apache License 2.0 | 5 votes |
private float drawEchoCharacterImpl(Graphics g, float x, float y, char c, boolean useFPAPI) { ONE[0] = c; SwingUtilities2.drawChars(Utilities.getJComponent(this), g, ONE, 0, 1, x, y); if (useFPAPI) { return x + g.getFontMetrics().charWidth(c); } else { FontRenderContext frc = g.getFontMetrics().getFontRenderContext(); return x + (float) g.getFont().getStringBounds(ONE, 0, 1, frc).getWidth(); } }
Example 3
Source File: PasswordView.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private float drawEchoCharacterImpl(Graphics g, float x, float y, char c, boolean useFPAPI) { ONE[0] = c; SwingUtilities2.drawChars(Utilities.getJComponent(this), g, ONE, 0, 1, x, y); if (useFPAPI) { return x + g.getFontMetrics().charWidth(c); } else { FontRenderContext frc = g.getFontMetrics().getFontRenderContext(); return x + (float) g.getFont().getStringBounds(ONE, 0, 1, frc).getWidth(); } }
Example 4
Source File: PasswordView.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 3 votes |
/** * Renders the echo character, or whatever graphic should be used * to display the password characters. The color in the Graphics * object is set to the appropriate foreground color for selected * or unselected text. * * @param g the graphics context * @param x the starting X coordinate >= 0 * @param y the starting Y coordinate >= 0 * @param c the echo character * @return the updated X position >= 0 */ protected int drawEchoCharacter(Graphics g, int x, int y, char c) { ONE[0] = c; SwingUtilities2.drawChars(Utilities.getJComponent(this), g, ONE, 0, 1, x, y); return x + g.getFontMetrics().charWidth(c); }
Example 5
Source File: PasswordView.java From jdk1.8-source-analysis with Apache License 2.0 | 3 votes |
/** * Renders the echo character, or whatever graphic should be used * to display the password characters. The color in the Graphics * object is set to the appropriate foreground color for selected * or unselected text. * * @param g the graphics context * @param x the starting X coordinate >= 0 * @param y the starting Y coordinate >= 0 * @param c the echo character * @return the updated X position >= 0 */ protected int drawEchoCharacter(Graphics g, int x, int y, char c) { ONE[0] = c; SwingUtilities2.drawChars(Utilities.getJComponent(this), g, ONE, 0, 1, x, y); return x + g.getFontMetrics().charWidth(c); }
Example 6
Source File: PasswordView.java From jdk8u-jdk with GNU General Public License v2.0 | 3 votes |
/** * Renders the echo character, or whatever graphic should be used * to display the password characters. The color in the Graphics * object is set to the appropriate foreground color for selected * or unselected text. * * @param g the graphics context * @param x the starting X coordinate >= 0 * @param y the starting Y coordinate >= 0 * @param c the echo character * @return the updated X position >= 0 */ protected int drawEchoCharacter(Graphics g, int x, int y, char c) { ONE[0] = c; SwingUtilities2.drawChars(Utilities.getJComponent(this), g, ONE, 0, 1, x, y); return x + g.getFontMetrics().charWidth(c); }
Example 7
Source File: PasswordView.java From openjdk-8 with GNU General Public License v2.0 | 3 votes |
/** * Renders the echo character, or whatever graphic should be used * to display the password characters. The color in the Graphics * object is set to the appropriate foreground color for selected * or unselected text. * * @param g the graphics context * @param x the starting X coordinate >= 0 * @param y the starting Y coordinate >= 0 * @param c the echo character * @return the updated X position >= 0 */ protected int drawEchoCharacter(Graphics g, int x, int y, char c) { ONE[0] = c; SwingUtilities2.drawChars(Utilities.getJComponent(this), g, ONE, 0, 1, x, y); return x + g.getFontMetrics().charWidth(c); }
Example 8
Source File: PasswordView.java From openjdk-8-source with GNU General Public License v2.0 | 3 votes |
/** * Renders the echo character, or whatever graphic should be used * to display the password characters. The color in the Graphics * object is set to the appropriate foreground color for selected * or unselected text. * * @param g the graphics context * @param x the starting X coordinate >= 0 * @param y the starting Y coordinate >= 0 * @param c the echo character * @return the updated X position >= 0 */ protected int drawEchoCharacter(Graphics g, int x, int y, char c) { ONE[0] = c; SwingUtilities2.drawChars(Utilities.getJComponent(this), g, ONE, 0, 1, x, y); return x + g.getFontMetrics().charWidth(c); }
Example 9
Source File: PasswordView.java From hottub with GNU General Public License v2.0 | 3 votes |
/** * Renders the echo character, or whatever graphic should be used * to display the password characters. The color in the Graphics * object is set to the appropriate foreground color for selected * or unselected text. * * @param g the graphics context * @param x the starting X coordinate >= 0 * @param y the starting Y coordinate >= 0 * @param c the echo character * @return the updated X position >= 0 */ protected int drawEchoCharacter(Graphics g, int x, int y, char c) { ONE[0] = c; SwingUtilities2.drawChars(Utilities.getJComponent(this), g, ONE, 0, 1, x, y); return x + g.getFontMetrics().charWidth(c); }
Example 10
Source File: PasswordView.java From Java8CN with Apache License 2.0 | 3 votes |
/** * Renders the echo character, or whatever graphic should be used * to display the password characters. The color in the Graphics * object is set to the appropriate foreground color for selected * or unselected text. * * @param g the graphics context * @param x the starting X coordinate >= 0 * @param y the starting Y coordinate >= 0 * @param c the echo character * @return the updated X position >= 0 */ protected int drawEchoCharacter(Graphics g, int x, int y, char c) { ONE[0] = c; SwingUtilities2.drawChars(Utilities.getJComponent(this), g, ONE, 0, 1, x, y); return x + g.getFontMetrics().charWidth(c); }
Example 11
Source File: PasswordView.java From jdk8u-jdk with GNU General Public License v2.0 | 3 votes |
/** * Renders the echo character, or whatever graphic should be used * to display the password characters. The color in the Graphics * object is set to the appropriate foreground color for selected * or unselected text. * * @param g the graphics context * @param x the starting X coordinate >= 0 * @param y the starting Y coordinate >= 0 * @param c the echo character * @return the updated X position >= 0 */ protected int drawEchoCharacter(Graphics g, int x, int y, char c) { ONE[0] = c; SwingUtilities2.drawChars(Utilities.getJComponent(this), g, ONE, 0, 1, x, y); return x + g.getFontMetrics().charWidth(c); }
Example 12
Source File: PasswordView.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 3 votes |
/** * Renders the echo character, or whatever graphic should be used * to display the password characters. The color in the Graphics * object is set to the appropriate foreground color for selected * or unselected text. * * @param g the graphics context * @param x the starting X coordinate >= 0 * @param y the starting Y coordinate >= 0 * @param c the echo character * @return the updated X position >= 0 */ protected int drawEchoCharacter(Graphics g, int x, int y, char c) { ONE[0] = c; SwingUtilities2.drawChars(Utilities.getJComponent(this), g, ONE, 0, 1, x, y); return x + g.getFontMetrics().charWidth(c); }
Example 13
Source File: PasswordView.java From openjdk-jdk8u with GNU General Public License v2.0 | 3 votes |
/** * Renders the echo character, or whatever graphic should be used * to display the password characters. The color in the Graphics * object is set to the appropriate foreground color for selected * or unselected text. * * @param g the graphics context * @param x the starting X coordinate >= 0 * @param y the starting Y coordinate >= 0 * @param c the echo character * @return the updated X position >= 0 */ protected int drawEchoCharacter(Graphics g, int x, int y, char c) { ONE[0] = c; SwingUtilities2.drawChars(Utilities.getJComponent(this), g, ONE, 0, 1, x, y); return x + g.getFontMetrics().charWidth(c); }
Example 14
Source File: PasswordView.java From JDKSourceCode1.8 with MIT License | 3 votes |
/** * Renders the echo character, or whatever graphic should be used * to display the password characters. The color in the Graphics * object is set to the appropriate foreground color for selected * or unselected text. * * @param g the graphics context * @param x the starting X coordinate >= 0 * @param y the starting Y coordinate >= 0 * @param c the echo character * @return the updated X position >= 0 */ protected int drawEchoCharacter(Graphics g, int x, int y, char c) { ONE[0] = c; SwingUtilities2.drawChars(Utilities.getJComponent(this), g, ONE, 0, 1, x, y); return x + g.getFontMetrics().charWidth(c); }
Example 15
Source File: PasswordView.java From jdk8u60 with GNU General Public License v2.0 | 3 votes |
/** * Renders the echo character, or whatever graphic should be used * to display the password characters. The color in the Graphics * object is set to the appropriate foreground color for selected * or unselected text. * * @param g the graphics context * @param x the starting X coordinate >= 0 * @param y the starting Y coordinate >= 0 * @param c the echo character * @return the updated X position >= 0 */ protected int drawEchoCharacter(Graphics g, int x, int y, char c) { ONE[0] = c; SwingUtilities2.drawChars(Utilities.getJComponent(this), g, ONE, 0, 1, x, y); return x + g.getFontMetrics().charWidth(c); }
Example 16
Source File: PasswordView.java From TencentKona-8 with GNU General Public License v2.0 | 3 votes |
/** * Renders the echo character, or whatever graphic should be used * to display the password characters. The color in the Graphics * object is set to the appropriate foreground color for selected * or unselected text. * * @param g the graphics context * @param x the starting X coordinate >= 0 * @param y the starting Y coordinate >= 0 * @param c the echo character * @return the updated X position >= 0 */ protected int drawEchoCharacter(Graphics g, int x, int y, char c) { ONE[0] = c; SwingUtilities2.drawChars(Utilities.getJComponent(this), g, ONE, 0, 1, x, y); return x + g.getFontMetrics().charWidth(c); }
Example 17
Source File: PasswordView.java From dragonwell8_jdk with GNU General Public License v2.0 | 3 votes |
/** * Renders the echo character, or whatever graphic should be used * to display the password characters. The color in the Graphics * object is set to the appropriate foreground color for selected * or unselected text. * * @param g the graphics context * @param x the starting X coordinate >= 0 * @param y the starting Y coordinate >= 0 * @param c the echo character * @return the updated X position >= 0 */ protected int drawEchoCharacter(Graphics g, int x, int y, char c) { ONE[0] = c; SwingUtilities2.drawChars(Utilities.getJComponent(this), g, ONE, 0, 1, x, y); return x + g.getFontMetrics().charWidth(c); }