Thread: Javapad 2.0
View Single Post
  #2 (permalink)  
Old 05-13-2008, 07:01 AM
sukatoa's Avatar
sukatoa sukatoa is offline
Senior Member
 
Join Date: Jan 2008
Location: Cebu City, Philippines
Posts: 527
sukatoa is on a distinguished road
Send a message via Yahoo to sukatoa
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.

Code:
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 )
__________________
A specific, detailed, simple, well elaborated, and "tested before asking" question may gather more quick replies. hopefully
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by sukatoa : 05-13-2008 at 07:08 AM.
Reply With Quote