KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > edu > neu > ccs > jmk > swing > JmkWriter


1 // $Id: JmkWriter.java,v 1.2 2001/12/07 11:41:24 ramsdell Exp $
2

3 /*
4  * Copyright 1997 by Olivier Refalo
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  */

20
21 package edu.neu.ccs.jmk.swing;
22
23 import java.io.*;
24
25 public
26 class JmkWriter
27 extends Writer
28 {
29     // system msg (printed in blue)
30
public void jmk_println(String JavaDoc _s)
31     {
32         System.out.println(_s);
33     }
34
35     // error msg (printed in red + flag updates)
36
public void jmkerr_println(String JavaDoc _s)
37     {
38         System.err.println(_s);
39     }
40
41     public void write(char[] _c, int _p, int _l)
42     throws IOException
43     {
44
45         String JavaDoc s=new String JavaDoc(_c,_p,_l);
46         jmk_println(s);
47     }
48
49     public void close()
50     throws IOException
51     {};
52
53     public void flush()
54     throws IOException
55     {};
56
57 }
58
Popular Tags