|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.wordpress.tipsforjava.swing.VisibleCaretListener
public class VisibleCaretListener extends Object
Simple class to ensure that the caret is visible within the viewport of the scrollpane. This is the normal situation. However, I've noticed that solutions that attempt to turn a text pane into a non wrapping text pane will result in the caret not being visible when adding text to the right edge of the viewport. In general, this class can be used any time you wish to increase the number of visible pixels after the caret on the right edge of a scroll pane.
| Field Summary | |
|---|---|
private int |
visiblePixels
|
| Constructor Summary | |
VisibleCaretListener()
Convenience constructor to create a VisibleCaretListener using the default value for visible pixels, which is set to 2. |
|
VisibleCaretListener(int visiblePixels)
Create a VisibleCaretListener. |
|
| Method Summary | |
|---|---|
void
|
caretUpdate(CaretEvent e)
|
int
|
getVisiblePixels()
Get the number of visble pixels displayed after the Caret. |
void
|
setVisiblePixels(int visiblePixels)
Control the number of pixels that should be visible in the viewport after the caret position. |
| Methods inherited from class Object | |
|---|---|
| wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
| Field Detail |
|---|
private int visiblePixels
| Constructor Detail |
|---|
public VisibleCaretListener()
public VisibleCaretListener(int visiblePixels)
pixels - the number of visible pixels after the caret.
| Method Detail |
|---|
public void caretUpdate(CaretEvent e)
public int getVisiblePixels()
public void setVisiblePixels(int visiblePixels)
pixels - the number of visible pixels after the caret.
Groovy Documentation