Methods Summary |
---|
public void | actionPerformed(java.awt.event.ActionEvent evt)
Object source = evt.getSource();
if(source == wrapButton)
{
textArea.setLineWrap(true);
scrollPane.validate();
}
else if(source == noWrapButton)
{
textArea.setLineWrap(false);
scrollPane.validate();
}
/* trying to make it auto-scroll!!!
//JViewport vp = textArea.getViewport();
JScrollBar vert = scrollPane.getVerticalScrollBar();
System.out.println("*** vertSB.getMaximum(): " + vert.getMaximum());
System.out.println("*** vertSB.getValue(): " + vert.getValue());
System.out.println("*** getRows(): " + textArea.getRows());
//System.out.println("*** getRowHeight(): " + textArea.getRowHeight());
System.out.println("*** getLineCount(): " + textArea.getLineCount());
final int numLines = textArea.getLineCount();
int endOffset;
try
{
endOffset= textArea.getLineEndOffset(numLines - 1);
System.out.println("***** numLines: " + numLines + " endOffset: " + endOffset);
}
catch(BadLocationException e)
{
System.out.println("***** Exception: " + e);
}
*/
|
private void | addButtonPanel()
JPanel panel = new JPanel();
wrapButton = new JButton("Wrap");//NOI18N
panel.add(wrapButton);
wrapButton.addActionListener(this);
noWrapButton = new JButton("No wrap");//NOI18N
panel.add(noWrapButton);
noWrapButton.addActionListener(this);
getContentPane().add(panel, "South");//NOI18N
|
private void | addTextPanel()
//textArea = new JTextPane();
textArea = new JTextArea(800, 200);
scrollPane = new JScrollPane(textArea);
getContentPane().add(scrollPane, "Center");//NOI18N
|
public void | pr(java.lang.String s)
//textArea.setText(textArea.getText() + s + "\n");//NOI18N
textArea.append(s + "\n");//NOI18N
|
static void | setStandAlone()
System.err.println("setStandAlone() here!!!");//NOI18N
standAlone = true;
|