Available Methods
- getFontMetrics ( )
- stringWidth ( )
- drawString ( )
- drawStringUnderlineCharAt ( )
- shouldIgnore ( )
- adjustFocus ( )
- compositeRequestFocus ( )
- getTreePath ( )
- makeIcon ( )
- tabbedPaneChangeFocusTo ( )
- loc2IndexFileList ( )
- getUIDefaultsInt ( )
- clipStringIfNecessary ( )
- canEventAccessSystemClipboard ( )
- isLocalDisplay ( )
- isComplexLayout ( )
- drawHLine ( )
- checkAccess ( )
- getAdjustedClickCount ( )
- setSkipClickCount ( )
- pointOutsidePrefSize ( )
- setLeadAnchorWithoutSelection ( )
- drawChars ( )
- clipString ( )
- canCurrentEventAccessSystemClipboard ( )
- isScaledGraphics ( )
- canAccessSystemClipboard ( )
- isFloatingPointScale ( )
- convertColumnIndexToView ( )
- getLeftSideBearing ( )
- isScaleChanged ( )
- makeIcon_Unprivileged ( )
- putAATextInfo ( )
Related Classes
- java.util.Locale
- java.awt.image.BufferedImage
- java.awt.Color
- java.awt.Dimension
- java.awt.Font
- java.awt.event.MouseEvent
- javax.swing.JLabel
- java.awt.Graphics2D
- java.awt.Graphics
- java.awt.event.KeyEvent
- java.awt.Component
- java.security.AccessController
- java.awt.Rectangle
- java.security.PrivilegedAction
- java.awt.Point
- javax.swing.JComponent
- javax.swing.UIManager
- java.awt.RenderingHints
- java.awt.geom.AffineTransform
- java.awt.geom.Rectangle2D
- java.awt.Insets
- java.beans.PropertyChangeEvent
- java.awt.Container
- java.awt.FontMetrics
- java.awt.font.FontRenderContext
Java Code Examples for sun.swing.SwingUtilities2#clipString()
The following examples show how to use
sun.swing.SwingUtilities2#clipString() .
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: ContentTabLabel.java From consulo with Apache License 2.0 | 6 votes |
private void updateText() { FontMetrics fm = getFontMetrics(getFont()); int textWidth = SwingUtilities2.stringWidth(this, fm, myText); int prefWidth = myIconWithInsetsWidth + textWidth; int maxWidth = getMaximumSize().width; if (prefWidth > maxWidth) { int offset = maxWidth - myIconWithInsetsWidth; String s = SwingUtilities2.clipString(this, fm, myText, offset); super.setText(s); return; } super.setText(myText); }