public class MyPrinter implements Printable { private String name = null; private String name2 = null; public MyPrinter( String name, String name2 ) { this.name = name; this.name2 = name2; } public int print (Graphics....) { g.drawString(..."+name,100,100); g.drawString(..."+name2, 200,200); }}
..static void main( .. )MyPrinter mp = new MyPrinter( "Schultze", "Harald" );mp.print( .. );..