We help IT Professionals succeed at work.
Get Started

Add Printing Settings in Java Code

Last Modified: 2018-04-26

I'm new to java, I have a jTextArea that I want to send it's content to print.
I was able to achieve that using
Boolean complete=jValueText.print();
            if (complete){
                JOptionPane.showMessageDialog(null, "Done Printing...");
                JOptionPane.showMessageDialog(null, "Printing...");

Open in new window

This approach will show a printer dialog and the user can set the settings, like paper orientation etc. But I'll like to just set the settings in the java code, so when the user clicks the print button, it will just print the text using the settings I configured in the java code.
The settings I want to configure are;
Page size
Printer to use
Scale size of the page
I'm using Netbeans 8.2, MacBook Pro Sierra
Watch Question
Distinguished Expert 2020
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE