I've tested your program....
Win XP SP3
Im using jdk 6 update 3
bin path already set
Build and Runtime error. why? using Runtime? or JavaCompiler class?
I suggest you shall create a documentation about your program. How should specifically use it, its condition before using it, and EULA ( detailed )...
Not bad, keep it up.....
Here is a simple PrintData Class, it will print a page.
public class PrintData implements Printable{
private Component data;
public PrintData(Component e){
this.data = e;
}
public void setValue(){
new PrintData(data).initializePrint();
}
public void initializePrint(){
PrinterJob proceed = PrinterJob.getPrinterJob();
proceed.setPrintable(this);
if(proceed.printDialog()){
try{
proceed.print();
}catch(Exception e){
JOptionPane.showMessageDialog(null,"AN ERROR OCCURED WHILE INITIALIZING PRINTER");
}
}
}
public int print(Graphics g, PageFormat format, int page){
int value = Printable.PAGE_EXISTS;
Font pattern = new Font("Arial",Font.PLAIN,10);
if(page>0){value = Printable.NO_SUCH_PAGE;}
Graphics2D g2D = (Graphics2D)g;
g2D.setFont(pattern);
g2D.translate(format.getImageableX(),format.getImageableY());
data.setFont(pattern);
data.paint(g2D);
return value;
}
}
where Component e should be the source of text ( TextArea for example )