|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
optics.graphics.TextPanel
public class TextPanel
Class to implement a Swing text panel with can be driven by
a PrintStream
.
The PrintStream
implements the basic
print
, println
and
printf
methods only.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
TextPanel(String title)
Form a TextPanel with specifed title. |
Method Summary | |
---|---|
void |
clear()
Method to clear the test area. |
PrintStream |
getPrintStream()
Method to get the stream to allow write to panel. |
JTextArea |
getTextArea()
Method to get the text area of the Panel for direct access. |
void |
paint(Graphics g)
Paint method to force scroll pane to fill the whole the JPanel. |
void |
print(String s)
Basic print method, to print a String . |
void |
printf(String format,
Object... args)
Method to implement the Java 5.0 (and later) printf C Style print scheme with internal formating (pop-up) error trap. |
void |
println()
Method to print newline |
void |
println(String s)
Method to print a String>/code> followed by a new line. |
void |
setTitle(String title)
Method to set the title of the TextArea, actually create a border to the JScrollPane containing a title |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TextPanel(String title)
TextPanel
with specifed title.
title
- the boarder title.Method Detail |
---|
public void setTitle(String title)
title
- the titlepublic void paint(Graphics g)
paint
in class JComponent
public PrintStream getPrintStream()
The retunred PrintStream
impelents
a subset of the normal PrintStream
methods.
PrintStream
attached to the text
panel.public JTextArea getTextArea()
JTextArea
the text area of the panel.public void clear()
public void print(String s)
String
. It
will also move tex caret to end of text field.
s
- the String
to be printed.public void println()
public void println(String s)
String>/code> followed by a new line.
- Parameters:
s
- The String to be printed.
public void printf(String format, Object... args)
PopUpOptions.formatConversion(java.awt.Container, java.lang.String)
.
format
- The format stringargs
- The argument list.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |