We help IT Professionals succeed at work.
Get Started

Add Printing Settings in Java Code

188 Views
Last Modified: 2018-04-26
Hello!

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...");
            }
            else{
                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
Orientation
Printer to use
Scale size of the page
I'm using Netbeans 8.2, MacBook Pro Sierra
Comment
Watch Question
CERTIFIED EXPERT
Distinguished Expert 2020
Commented:
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