[SouJava-J] Impressão de novo...

2000-01-21 Por tôpico william jr caetano

Será que ninguém nessa lista nunca trabalhou com impressão em Java


--- LISTA SOUJAVA ---
http://www.soujava.org.br  -  Sociedade de Usuários Java da Sucesu-SP
[para sair da lista: http://www.soujava.org.br/forum/cadastrados.htm]
-



[SouJava-J] RES: [SouJava-J] Re: [SouJava-J] Impressão de novo...

2000-01-21 Por tôpico Vagner

Você conhece alguma lista que seja melhor que esta aqui?

-Mensagem original-
De: Carlos [mailto:[EMAIL PROTECTED]]
Enviada em: Sexta-feira, 21 de Janeiro de 2000 8:21
Para:   [EMAIL PROTECTED]
Assunto:[SouJava-J] Re: [SouJava-J] Impressão de novo...

A lista aki eh fraquissima!
:)
Carlos
-Original Message-
From: william jr caetano [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
Date: Sexta-feira, 21 de Janeiro de 2000 08:35
Subject: [SouJava-J] Impressão de novo...


Será que ninguém nessa lista nunca trabalhou com impressão em
Java


--- LISTA SOUJAVA
---
http://www.soujava.org.br  -  Sociedade de Usuários Java da
Sucesu-SP
[para sair da lista:
http://www.soujava.org.br/forum/cadastrados.htm]

-



--- LISTA SOUJAVA
---
http://www.soujava.org.br  -  Sociedade de Usuários Java da
Sucesu-SP
[para sair da lista:
http://www.soujava.org.br/forum/cadastrados.htm]

-

--- LISTA SOUJAVA ---
http://www.soujava.org.br  -  Sociedade de Usuários Java da Sucesu-SP
[para sair da lista: http://www.soujava.org.br/forum/cadastrados.htm]
-



Re: [SouJava-J] Impressão de novo...

2000-01-21 Por tôpico Marcelo Mayworm

Prezado amigo,
antes de fazer qualquer tipo de pergunta, perca alguns minutos 
no site da SUN ou na iternet, procurando a sua resposta. Em 
ultimo caso envia para a lista, que teremos o maior prazer em 
ajuda-lo

talvez isso possa lhe ajudar...

17.5 Printing Arbitrary Content

Of course, in many situations, you want to do more than print the appearance
of a component. You often want to print the
contents of some component, rather than the component itself. For example, you
may want to print the text the user has typed
into a text area, rather than the text area itself. Or you may want to print
the contents of a spreadsheet, rather than the collection
of components that compose the spreadsheet. 

Java 1.1 lets you print arbitrary content, which may include multipage documents.
You aren't restricted to printing your
components' appearance. In many ways, the steps required to print arbitrary
content are similar to those we outlined
previously. However, a few tricks are involved: 

   1.Get the PrintJob: 

 PrintJob pjob = getToolkit().getPrintJob(this, "Job Title", (Properties)null);


   2.Get the graphics context from the PrintJob: 

 Graphics pg = pjob.getGraphics();

   3.Don't call printAll() or print(). These methods will try to draw your component
on the page, which you don't
 want. Instead, get the dimensions of the page by calling getPageDimension():


 pjob.getPageDimension();

   4.Set the font for your graphics context; then get the font metrics from
your graphics context. 

 Font times = new Font ("SansSerif", Font.PLAIN, 12);
 pg.setFont(times); 
 FontMetrics tm = pg.getFontMetrics(times);

   5.Draw whatever you want into the graphics context, using the methods of
the Graphics class. If you are drawing text, it's
 your responsibility to do all the positioning, making sure that your text
falls within the page boundaries. By the time you're
 through with this, you'll have the FontMetrics class memorized. 

   6.When you've finished drawing the current page, call dispose(); this sends
the page to the printer and releases the
 resources tied up by the PrintGraphics object. 

 pg.dispose(); // This is like sending a form feed

   7.If you want to print more pages, return to step 2. 

   8.Clean up after yourself: 

 pjob.end();

Remember to set a font for the PrintGraphics object explicitly! It doesn't have
a default font. 



[]'s
Marcelo de Mattos Mayworm
Negocios  Sistemas Consultoria
Tel.: 0xx21 556-9006  0xx24 9965-1518 
[EMAIL PROTECTED]
[EMAIL PROTECTED]

Conhecendo-se a quietude, pode-se possuir a estabilidade. 
Conhecendo a estabilidade, pode-se encontrar a serenidade.
Conhecendo a serenidade, pode-se encontrar a paz. 
Possuindo a paz, então pode-se pensar.
E podendo pensar, pode-se agir.
Mêncio (Filósofo chinês)
http://www.compuland.com.br

--- LISTA SOUJAVA ---
http://www.soujava.org.br  -  Sociedade de Usuários Java da Sucesu-SP
[para sair da lista: http://www.soujava.org.br/forum/cadastrados.htm]
-



[SouJava-J] Re:[SouJava-J] Impressão de novo...

2000-01-21 Por tôpico rubens . amaral . nt

Dá uma olhada em
 
 http://java.about.com/compute/java/msubprint.htm
 
 Rubens
 http://www.mass.eti.br/java/
 
  Será que ninguém nessa lista nunca trabalhou com impressão em Java
  
  
  --- LISTA SOUJAVA 
 ---
  http://www.soujava.org.br  -  Sociedade de Usuários Java da 
 Sucesu-SP
  [para sair da lista: 
 http://www.soujava.org.br/forum/cadastrados.htm]
  --
 ---
  
  
 
 
--- LISTA SOUJAVA ---
http://www.soujava.org.br  -  Sociedade de Usuários Java da Sucesu-SP
[para sair da lista: http://www.soujava.org.br/forum/cadastrados.htm]
-